I'm a bit of a beginner to working with Azure, in particular my problem is related to publishing python packages. I have a package managed with poetry, i am posting it to the private repository with the help of twine. The commands I am using to post are as follows (in this part i have installed artifacts-keyring in the virtual environment)
poetry build
python -m twine upload -r ${ARTIFACT_FEED} --config-file /PYPIRC dist/*
Here, ARTIFACT_FEED
is the name of the feed. I have no problems with those commands and the package is published without problems.
Now, to use a project managed also with poetry and that uses my other package already published, I would like to do
poetry add my_package_name
With the pyproject.toml
as poetry's documentation
[[tool.poetry.source]]
name = "foo"
url = <MY_PRIVATE_COMPANY_REPO_URL>
secondary = true
With artifacts-keyring
installed in the virtual env, i get this error 401 Client Error: Unauthorized for url: <MY_PRIVATE_COMPANY_REPO_URL>
. Using pipenv
i have the same problem. Ok, maybe poetry
dosen't support this kind of auth. Related links:
- https://github.com/microsoft/artifacts-keyring/issues/37
- https://github.com/microsoft/artifacts-keyring/issues/8
- https://github.com/python-poetry/poetry/issues/2857
Is it possible for the administrator to change the authentication type? When i enter to Connect to feed page, I see this
So, seems to be mandatory use artifacts-keyrings
. In a previous project, for another company, we used basic authentication, like this
poetry publish --repository <PRIVATE_REPO> --username <USERNAME> --password <PASSWORD> --build
And then to install the package I had no problem.