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

Uploading broken #258

Closed
ghost opened this issue Jul 5, 2017 · 14 comments
Closed

Uploading broken #258

ghost opened this issue Jul 5, 2017 · 14 comments

Comments

@ghost
Copy link

ghost commented Jul 5, 2017

I get this error when uploading files:

[================================] 357045/357045 - 00:00:00
HTTPError: 410 Client Error: Gone (This API has been deprecated and removed from legacy PyPI in favor of using the APIs available in the new PyPI.org implementation of PyPI (located at https://pypi.org/). For more information about migrating your use of this API to PyPI.org, please see https://packaging.python.org/guides/migrating-to-pypi-org/#uploading. For more information about the sunsetting of this API, please see https://mail.python.org/pipermail/distutils-sig/2017-June/030766.html) for url: https://pypi.python.org/pypi
@dstufft
Copy link
Member

dstufft commented Jul 5, 2017

Did you read the URL in the error message that tells you how to point your twine to the new uploading endpoint and is that not working for you?

@ghost
Copy link
Author

ghost commented Jul 5, 2017

I did upload it successfully with python3 setup.py ... upload (without any changes)

@sigmavirus24
Copy link
Member

It seems as though your configuration is mildly broken in hard-coding the old URL for PyPI uploads. Twine is not broken, although we could probably do something and detect (in newest version(s) only) if you're trying to use Legacy PyPI for uploads.

@bradaallen
Copy link

bradaallen commented Jul 8, 2017

I flagged this on stackoverflow, but thought it might be helpful to share here as well...

I followed the official documentation for uploading packages to PyPI, as well as the information provided in PyPI readme, but I get a HTTP 400 error each time:$ twine upload dist/*

Uploading distributions to https://upload.pypi.org/legacy/ 
Enter your username: bradaallen
Enter your password:
Uploading brad_nlp_helpers-0.1.1-py3-none-any.whl
HTTPError: 400 Client Error: home_page: Invalid URI for url: 
https://upload.pypi.org/legacy/

I am using a ~/.pypirc

[distutils]
index-servers =
  pypi
  pypitest

[pypi]
username=bradaallen
password=[password]

[pypitest]
username=bradaallen
password=[password]

For packages, I am using twine version 1.9.1 (pkginfo: 1.4.1, requests: 2.12.4, setuptools: 27.2.0, requests-toolbelt: 0.8.0, tqdm: 4.14.0)

When I use python setup.py sdist bdist_wheel upload I get the same issue:

Submitting dist\brad_nlp_helpers-0.1.1.tar.gz to
https://upload.pypi.org/legacy/ Upload failed (400): home_page: Invalid URI
error: Upload failed (400): home_page: Invalid URI

I have not specified the repository, as that is recommendation that is given by the API when uploading. I am seeing a 404 error at the link that PyPI recommends and am not seeing an alternative site I should use!This is my first package, and I am not seeing this error elsewhere on the internet. Any thoughts re: what's going on?

@jamadden
Copy link
Member

jamadden commented Jul 9, 2017

HTTPError: 400 Client Error: home_page: Invalid URI for url:

This indicates that your package contains an incorrect URI value ("") for the home_page field. This (usually) comes from the url argument passed to setup in your setup.py.

@jamadden
Copy link
Member

jamadden commented Jul 9, 2017

Sorry, I think I take that back. I was looking at my checkout of the old webui.py code for pypi.python.org for this, but I forgot that doesn't handle this anymore. I'm not familiar with warehouse uploading yet.

@devangel77b
Copy link

i am seeing similar trying to update two packages i have had up for a while on pypi - sba and argus. when i did old python setup.py upload i got errors saying the site had moved to pypi.org; when i made the changes to .pypirc and switched to twine i get the same error messages as the original poster. i do't think it's the home page in the setup.py - on mine that is and has always been the bitbucket or github pages for the code rcs repository...

@bradaallen
Copy link

In both I get the sense that home_page is https://upload.pypi.org/legacy/ - which is the recommended URL at both PyPI and Twine documentation (and through the API).

There aren't any alternative URIs in the documentation, which is confusing for me. I thought it might just be new projects being registered, but @devangel77b makes it seem like it might be a more global issue?

@devangel77b
Copy link

both packages i am trying to update i had registered previously on the old pypi.python.org and they have been there for some time. i get similar problems for both packages and on a few different machines, and when i tried to clone the example package and then do my own testpypi one.

@dstufft
Copy link
Member

dstufft commented Jul 10, 2017

I think there's some confusion here, because there are two URLs at play. One is the URL you're uploading to, which from the error message appears that you've gotten correct (https://upload.pypi.org/legacy/). So that's good, you're uploading to Warehouse!

The flip side here is that Warehouse has gotten stricter about some things, and once is validating that if your metadata includes a home page URL, that it is, in fact, a valid home page URL and not something that doesn't make sense as an URL. I suspect if you look at your setup() kwargs, you'll locate in them a url="..." line kwarg that is passing something into it that isn't a valid URL (alternatively, the error could be that you're passing a valid URL and there is a bug in Warehouse's URL validation routine).

@dstufft
Copy link
Member

dstufft commented Jul 10, 2017

For an example of the metadata I'm talking about, take a look a pip's setup.py#L61. You can see our value there is "https://pip.pypa.io/", which is a valid URL and thus passes the new, stricter validation checks.

@bradaallen
Copy link

bradaallen commented Jul 11, 2017

That was exactly it!! Thank you so much. By the way, the URL was for my personal website, but did not contain any code related to the package.

@lrntct
Copy link

lrntct commented Jan 6, 2018

I just ran into the issue. I had the URL in setup.cfg instead of setup.py.
Is it an expected behaviour to ignore the URL when defined in setup.cfg?
Maybe related: pypa/setuptools#862

@brainwane
Copy link
Contributor

@lrntct I'm sorry you had that trouble! I'm going to bring this up in pypa/packaging-problems#29 because I think this is a policy question first, then an implementation question. Thanks for the report.

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

7 participants