-
Notifications
You must be signed in to change notification settings - Fork 0
Test PyPI Repository
From StackOverflow, https://stackoverflow.com/questions/68882603/using-python-poetry-to-publish-to-test-pypi-org:
I've successfully used tokens and poetry to upload to PyPI and TestPyPI. I believe you just need to change the TestPyPI URL you are configuring by appending /legacy/:
poetry config repositories.test-pypi https://test.pypi.org/legacy/You can then add your token, which can be generated from your account settings page on Test PyPI.
poetry config pypi-token.test-pypi <your-token>https://test.pypi.org/legacy/ is the API endpoint for uploading packages. It's a bit hidden in the documentation but it is mentioned here that that is the URL you should use. Also note that the name succeeding the period in repositories. and pypi-token. is what needs to match which is why we have specified: repositories.test-pypi and pypi-token.test-pypi
Add to pyproject.toml:
[[tool.poetry.source]]
name = "test-pypi"
url = "https://test.pypi.org/simple"