poetry: setting up gemfury is not obvious
- I am on the latest Poetry version.
- I have searched the issues of this repo and believe that this is not a duplicate.
- If an exception occurs when executing a command, I executed it again in debug mode (
-vvv
option).
- OS version and name:
macOS 10.14.3 (18D109)
- Poetry version:
0.12.11
Issue
I tried following the instructions at https://poetry.eustace.io/docs/repositories/ but it doesn’t seem to be working.
❯ poetry config repositories.REDACTED https://pypi.fury.io/REDACTED/
❯ poetry config http-basic.dialogue jasonkuhrt
Password:
❯ poetry config --list
settings.virtualenvs.create = true
settings.virtualenvs.in-project = false
settings.virtualenvs.path = "/Users/jasonkuhrt/Library/Caches/pypoetry/virtualenvs"
repositories.dialogue.url = "https://pypi.fury.io/REDACTED/"
❯ head pyproject.toml
REDACTED
[[tool.poetry.source]]
name = "REDACTED"
url = "https://pypi.fury.io/REDACTED/"
❯ poetry add REDACTED
[PackageNotFound]
Package [REDACTED] not found.
add [-D|--dev] [--git GIT] [--path PATH] [-E|--extras EXTRAS] [--optional] [--python PYTHON] [--platform PLATFORM] [--allow-prereleases] [--dry-run] [--] <name> (<name>)...
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 6
- Comments: 16 (2 by maintainers)
These are the instructions we currently have at Dialogue internally. Hope its useful to anyone else. I would be happy to make a PR to the official docs but not sure if these instructions are flawed in some way.
Publishing Packages
Steps
Register the dialogue package repository
Setup auth to dialogue repo
Specify dialogue repo when publishing. Do not specify -p or -u (auth done in previous step)
Example
Using Dialogue gemfury private repository
Steps:
Add in pyproject.toml:
To
poetry add
orpoetry remove
, setup poetry with gemfury token for user and pass like so:In CI, since changes are not done, http-basic config is not needed, just the env var which is present in contect via org-global-v2. However, as you can see in publishing setup, this step is always needed for that.
In order to do
poetry install
with private packages listed in lock file, must havePIP_EXTRA_INDEX_URL
set globally like so:Hey @cenzhe,
We discovered that we had not configured things properly.
In order to make changes like
poetry add
orpoetry remove
with private packages, we must have setup gemfury token for user and pass like so:In order to do
poetry install
with private packages listed in lock file, must havePIP_EXTRA_INDEX_URL
set globally like so:Observations:
I realize this may be/is an integration issue, but I think it could only help poetry to take it upon itself to have a doc section for various private PyPI registries.
We were very close to delaying adoption of poetry until one team member cracked the issue.
I’ve renamed the issue title to reflect this new information
I’m not sure if specifying
$GEMFURY_TOKEN
as the password is strictly necessary. I use this command just fine across several Dockerfiles:We use this command on our local development machines too, to set up our private Gemfury repository across all of our projects. The repository for each package installed is recorded in
poetry.lock
so we don’t need thePIP_EXTRA_INDEX_URL
environment variable.Agree - the docs have placeholder values in their examples, but don’t explain what they mean! An actual worked example would be really helpful.
When using poetry 1.5.1 the problem I have is that I get a 403 when poetry tries to download the file. This only happens in my github action. Locally everything works. I found that gemfury expects the authorization and poetry is not providing it.
Ohhh that makes a lot of sens but this is very odd as I have the problem only inside docker build and not on my local machine 🤔
We still have the problem from time to time as soon as the cache gets bumped and also when we push to gemfury. yes the above solution works but since poetry 1.0.0 it is getting clunky.