-
Notifications
You must be signed in to change notification settings - Fork 959
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to Use uv for Publishing a Package to Private GitLab and Install from It #8352
Comments
Q1: Publish a Python package to a private GitLab repo using uv.After I created the deploy tokens, setting Q2: Install the package from the private GitLab repo in another project.For Q2, you should be able to find the answer in the GitLab documentation. As for Q1, you can refer to it as well since they are quite similar. Note: Currently, UV does not support Uploading packages locally is done this way for me, but it seems unnecessary to apply for Deploy tokens when uploading packages from GitLab CI/CD. |
Thanks, i was able to publish my packages. |
I haven't used any PyPI packages that require authentication. However, UV usually implements PEPs (Python Enhancement Proposals) and doesn't always introduce non-standard behaviors. Therefore, formats that pip can parse often only require minor modifications to work with UV.
|
I think this has been sufficiently answered. |
I had the same issue (with publishing), and it still took me some time to figure it out. So I wrote a blog post about it. Basically it boils down to the following stages:
- publish
variables:
PYTHON_VERSION: "3.13"
UV_VERSION: "0.5.5"
UV_PUBLISH_URL: "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/pypi"
UV_PUBLISH_USERNAME: "gitlab-ci-token"
UV_PUBLISH_PASSWORD: "${CI_JOB_TOKEN}"
before_script:
- pip install uv==${UV_VERSION}
publish:
stage: publish
image: python:${PYTHON_VERSION}
script:
# Set the version in pyproject.toml to the current git tag
- VERSION=$(git describe --exact-match --tags)
- uvx --from=toml-cli toml set --toml-path=pyproject.toml project.version $VERSION
# Build and publish the package
- uv build
- uv publish dist/*.whl
only:
- tags
Hope this helps. |
Hi,
I'm looking for guidance on how to:
Thanks!
The text was updated successfully, but these errors were encountered: