Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not recognising URL for ‘--repository’ option #265

Closed
benf-wspdigital opened this issue Aug 7, 2017 · 4 comments
Closed

Not recognising URL for ‘--repository’ option #265

benf-wspdigital opened this issue Aug 7, 2017 · 4 comments

Comments

@benf-wspdigital
Copy link

benf-wspdigital commented Aug 7, 2017

The --repository option does not recognise a URL to a private package index server.

$ python3 -m twine --version
twine version 1.9.1 (pkginfo: 1.4.1, requests: 2.18.2, setuptools: 28.8.0,
requests-toolbelt: 0.8.0, tqdm: 4.15.0)

$ python3 -m twine upload --repository "https://[email protected]/foo/" dist/*
KeyError: Missing 'https://[email protected]/foo/' section from the configuration file
or not a complete URL in --repository.
Maybe you have a out-dated '~/.pypirc' format?
more info: https://docs.python.org/distutils/packageindex.html#pypirc

Why does Twine complain that the URL is “not a complete URL”? How can I convince Twine to accept that repository URL on the command line?

@jamadden
Copy link
Member

jamadden commented Aug 7, 2017

I suspect the --repository option is looking for the name of a repository section found in ~/.pypirc (despite what the help says) (It needs to be there so that you can include credentials.) Have you tried that? The format is documented at the link included in the error message.

There is also the --repository-url option, though I haven't tried that.

@sigmavirus24
Copy link
Member

Thanks for beating me to this @jamadden :) I believe that's exactly what @benf-wspdigital is looking for

@jamadden
Copy link
Member

jamadden commented Aug 7, 2017

The help output is confusing to me though. It claims that --repository can accept a URL, but that doesn't seem to be the case.

  -r REPOSITORY, --repository REPOSITORY
                        The repository to register the package to. Can be a
                        section in the config file or a full URL to the
                        repository (default: pypi). (Can also be set via
                        TWINE_REPOSITORY environment variable)
  --repository-url REPOSITORY_URL
                        The repository URL to upload the package to. This can
                        be specified with --repository because it will be used
                        if there is no configuration for the value passed to
                        --repository. (Can also be set via
                        TWINE_REPOSITORY_URL environment variable.)

@sigmavirus24
Copy link
Member

That's probably out-dated. I'd be happy to merge a PR to correct that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants