The Poetry client can be used to both install and publish Python packages.
To connect the Poetry PyPI Client to Artifactory:
In the command line, configure the upload endpoint for your publishable repository with the following commands:
poetry config repositories.artifactory-<REPOSITORY_NAME> https://<YOUR_JFROG_DOMAIN>/artifactory/api/pypi/<REPOSITORY_KEY> poetry config http-basic.artifactory-<REPOSITORY_NAME> <USER> <PASSWORD/TOKEN>
For example:
poetry config repositories.artifactory-pypi-local https://my-awesome.jfrog.io/artifactory/api/pypi/pypi-local poetry config http-basic.artifactory-pypi-local johnfrog RANDOM_TOKEN_YWRtaW46QVBBVWJjTExkZTU4WT
Add the repository source with the
source add
command as follows:poetry config http-basic.<REPOSITORY_NAME> <USER><PASSWORD/TOKEN> poetry source add <REPOSITORY_NAME> https://<YOUR_JFROG_DOMAIN>/artifactory/api/pypi/<REPOSITORY_NAME>/simple
For example:
poetry config http-basic.pypi-local johnfrog RANDOM_TOKEN_YWRtaW46QVBBVWJjTExkZTU4WT poetry source add pypi-local https://my-awesome.jfrog.io/artifactory/api/pypi/pypi-local/simple
Note
The
source add
command inserts the URL into the project'spyproject.toml
.
Next steps: