This release is a pre-release and may not be stable for production use.
[Return to Examples Documentation]
Publish Package to Development Repository
Overview
This example demonstrates how to use Habushu to publish a package to a development repository, streamlining the deployment process for development and testing purposes. With Habushu, you can configure a package's build settings to automatically push to a private development repository, ensuring a smooth workflow for private deployments and iterative testing before release.
Key Features
- Development Repository Configuration: Easily configure your
pom.xmlto publish directly to a private development repository. - Secure Credentials: Leverages Maven's secure password encryption to safely store repository credentials.
- Private Repository Usage: Guides on setting up a private PyPI server to act as a development repository.
- Flexible Configuration: Includes options for enabling or disabling URL suffix additions for custom repositories.
How It Works
The example involves configuring pom.xml and Maven settings to enable the publishing of packages to a private repository during development. The configuration includes:
- Activate development repository publishing by setting the following parameters in the
pom.xml:
<configuration>
<useDevRepository>true</useDevRepository>
<devRepositoryId>YOUR-REPO-NAME</devRepositoryId>
<devRepositoryUrl>http://YOUR-URL-ADDERSS/</devRepositoryUrl>
<!-- Set enableDevRepositoryUrlUploadSuffix to false if your devRepositoryUrl
does not have an upload suffix -->
<enableDevRepositoryUrlUploadSuffix>false</enableDevRepositoryUrlUploadSuffix>
</configuration>
- Store credentials securely in Maven settings using an encrypted password:
<server>
<id>YOUR-REPO-NAME</id>
<username>YOUR-USERNAME</username>
<password>{ENCRYPTED-PASSWORD}</password>
</server>
- Build and deploy the package with the command:
mvn clean deploy
When the project is built, Habushu will push the packaged module to the configured development repository.
Benefits
- Simplified Development: Quickly deploy packages to a development repository for private testing.
- Secure Integration: Ensures development repository credentials are securely managed.
- Customizable Repository Settings: Flexible settings allow easy integration with a variety of private repository setups.
- Streamlined Workflow: Enables rapid iteration during development by decoupling testing deployments from production releases.
Example Setup
This section is required purely to execute this example. If you already have a private repository, you can skip this section.
Install Required Packages
The pypiserver and passlib packages are required to execute this example.
pip install pypiserver passlib
Make the Private PyPi Directory
mkdir ~/private-pypi
Create the Username and Password File for pypiserver
htpasswd -c ~/.htpasswd myuser
# Set the password to whatever you want. e.g., `password`
Start the Private Server
In a separate terminal, start the private server and keep it running until you are completed with this example.
pypi-server run -p 8080 -a update,download,list --passwords ~/.htpasswd ~/private-pypi
Save your Development Repository Credentials in Maven
Encrypt the password you chose by running mvn --encrypt-password <your-password>. For example,
% mvn --encrypt-password password
{j5M3wbZdMlYHNEgrFNEPuDMN20jlMOkryKoKSjNzyc8=}
Then update your ~/.m2/settings.xml.
<!-- ~/.m2/settings.xml -->
<server>
<id>private-repo</id>
<username>myuser</username>
<password>{j5M3wbZdMlYHNEgrFNEPuDMN20jlMOkryKoKSjNzyc8=}</password>
</server>
Update your pom.xml
In this example, the following configuration is located in the deploy-example profile. Outside the habushu repository, you can save this configuration in the build section of your project/module's pom.xml file.
<configuration>
<useDevRepository>true</useDevRepository>
<devRepositoryId>private-repo</devRepositoryId>
<!-- Leave off simple/ suffix to enable seamless upload and download capabilities -->
<devRepositoryUrl>http://127.0.0.1:8080/</devRepositoryUrl>
<enableDevRepositoryUrlUploadSuffix>false</enableDevRepositoryUrlUploadSuffix>
</configuration>
Build the project
To publish this package/module to the development repository, run mvn clean deploy -pl :habushu-uv-publish-to-dev-repo -Pdeploy-example from the root directory.
Metadata
Release files for habushu-uv-publish-to-dev-repo 3.1.0.dev1750247662
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| habushu_uv_publish_to_dev_repo-3.1.0.dev1750247662.tar.gz | 3.6 kB | Without provenance | Details for habushu_uv_publish_to_dev_repo-3.1.0.dev1750247662.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| habushu_uv_publish_to_dev_repo-3.1.0.dev1750247662-py3-none-any.whl | Python 3 | none | any | Details for habushu_uv_publish_to_dev_repo-3.1.0.dev1750247662-py3-none-any.whl |
Total release size: 7.0 kB
Release files / habushu_uv_publish_to_dev_repo-3.1.0.dev1750247662.tar.gz
| Download URL | habushu_uv_publish_to_dev_repo-3.1.0.dev1750247662.tar.gz |
|---|---|
| Size | 3.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c203c18f21afd7915fc8a46fe4cb49f389feb9580f950faabfeb8b0e24a7acf4
|
|
BLAKE2b-256 checksum How to use checksums |
7b462ababaf82da171764a7dd93cf3e81543e0f7e670850e2101fa7f5b1469ac
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.6.10
|
Release files / habushu_uv_publish_to_dev_repo-3.1.0.dev1750247662-py3-none-any.whl
| Download URL | habushu_uv_publish_to_dev_repo-3.1.0.dev1750247662-py3-none-any.whl |
|---|---|
| Size | 3.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
731715e9044a6600cbc4fa8a2bb9dafefca0560e1ac5fbf19ac8792d003d312e
|
|
BLAKE2b-256 checksum How to use checksums |
53ca8113fe24a68ec310cc56f365cd9ae4d6e42c4773e8c82c47a0afae8e1d26
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.6.10
|
Security for habushu-uv-publish-to-dev-repo 3.1.0.dev1750247662
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.