Skip to content
代码片段 群组 项目
未验证 提交 7a3ee415 编辑于 作者: Eduardo Bonet's avatar Eduardo Bonet 提交者: GitLab
浏览文件

Merge branch 'eduardobonet-master-patch-e221' into 'master'

Clarifies usage of pypi

See merge request https://gitlab.com/gitlab-org/gitlab/-/merge_requests/182589



Merged-by: default avatarEduardo Bonet <ebonet@gitlab.com>
Approved-by: default avatarTan Le <tle@gitlab.com>
No related branches found
No related tags found
无相关合并请求
...@@ -23,17 +23,26 @@ repository = "https://gitlab.com/gitlab/<path/to/repository>" ...@@ -23,17 +23,26 @@ repository = "https://gitlab.com/gitlab/<path/to/repository>"
Refer to [poetry's documentation](https://python-poetry.org/docs/pyproject/) for additional configuration options. Refer to [poetry's documentation](https://python-poetry.org/docs/pyproject/) for additional configuration options.
The following job can be used to deploy the image. Note that PyPI uses [trusted publishers](https://docs.pypi.org/trusted-publishers/), no keys are necessary when the CI pipeline is configured. To configure deployment of the PyPI package:
```yaml 1. [Authenticate to PyPI](https://pypi.org/account/login/) using the "PyPI GitLab" credentials found in 1Password (PyPI does not support organizations as of now).
deploy: 1. Create a token under `Account Settings > Add API Tokens`.
stage: deploy 1. For the initial publish, select `Entire account (all projects)` scope. If the project already exists, scope the token to the specific project.
image: python:3.12 1. Configure credentials:
script:
- poetry --build publish Locally:
rules:
- if: $CI_COMMIT_TAG =~ /^v-/ ```shell
``` poetry config pypi-token.pypi <your-api-token>
```
To configure deployment with CI, set the `POETRY_PYPI_TOKEN_PYPI` to the token created. Alternatively, define a [trusted publisher](https://docs.pypi.org/trusted-publishers/) for the project, in which case no token is needed.
1. Use [Poetry to publish](https://python-poetry.org/docs/cli/#publish) your package:
```shell
poetry publish
```
## Python Services ## Python Services
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册