Skip to content
This repository has been archived by the owner on May 30, 2020. It is now read-only.

Upload fails if classifier is tuple rather than list #670

Closed
gilessbrown opened this issue Jul 11, 2017 · 6 comments
Closed

Upload fails if classifier is tuple rather than list #670

gilessbrown opened this issue Jul 11, 2017 · 6 comments

Comments

@gilessbrown
Copy link

This did not used to be the case.
The error message is confusing as it looks like the classifier value is not correct.

@berkerpeksag
Copy link
Collaborator

Thank you for the report. Could you paste the exact traceback? Did you see it on PyPI or when you run python setup.py sdist? I've opened issue 19610 on bugs.p.o for the latter case a while ago.

@gilessbrown
Copy link
Author

gilessbrown commented Jul 11, 2017

It doesn't happen with just the python setup.py sdist, only when I add the upload.

There is no traceback just a message:

(wextracto) gsbrown$ python setup.py sdist upload
running sdist
running egg_info
writing requirements to Wextracto.egg-info/requires.txt
writing Wextracto.egg-info/PKG-INFO
writing top-level names to Wextracto.egg-info/top_level.txt
writing dependency_links to Wextracto.egg-info/dependency_links.txt
writing entry points to Wextracto.egg-info/entry_points.txt
reading manifest file 'Wextracto.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'Wextracto.egg-info/SOURCES.txt'
running check
creating Wextracto-0.14.0
creating Wextracto-0.14.0/Wextracto.egg-info
creating Wextracto-0.14.0/wex
creating Wextracto-0.14.0/wex/js
copying files to Wextracto-0.14.0...
<lots of "copying ..." lines snipped>
Writing Wextracto-0.14.0/setup.cfg
Creating tar archive
removing 'Wextracto-0.14.0' (and everything under it)
running upload
Submitting dist/Wextracto-0.14.0.tar.gz to https://upload.pypi.org/legacy/
Upload failed (400): classifiers: 'FieldStorage('classifiers', 'Development Status :: 4 - Beta')' is not a valid choice for this field
error: Upload failed (400): classifiers: 'FieldStorage('classifiers', 'Development Status :: 4 - Beta')' is not a valid choice for this field

That is with a tuple for classifiers as per:
https://github.com/eBay/wextracto/blob/master/setup.py#L31

If I change from ( to [ (and the other end of course) to make it a list rather than a tuple it upload successfully.

@berkerpeksag
Copy link
Collaborator

Perhaps there could be a custom validator to convert tuple to list at https://github.com/pypa/warehouse/blob/57f70e977c979f0ca2a2fe640a9362eaf72898af/warehouse/forklift/legacy.py#L338 But I'm not sure if it's worth to do anything to handle tuples (or if there's a better way). It's ultimately up to @dstufft and @ewdurbin.

@gilessbrown
Copy link
Author

gilessbrown commented Jul 11, 2017 via email

@ewdurbin
Copy link
Member

howdy!

we recently deprecated upload functionality from this codebase and it is now powered by https://github.com/pypa/warehouse and this is likely a regression introduced during that migration. would you mind filing an issue with warehouse?

@gilessbrown
Copy link
Author

NP

simon-weber added a commit to venmo/nose-detecthttp that referenced this issue Aug 15, 2017
@ewdurbin ewdurbin closed this as completed Sep 9, 2017
jackiekazil added a commit to projectmesa/mesa that referenced this issue Nov 2, 2017
ulfalizer added a commit to ulfalizer/Kconfiglib that referenced this issue Oct 1, 2018
Fixes a warning on Python 3.7:

  Warning: 'classifiers' should be a list, got type 'tuple'

Maybe it could prevent other issues too:
pypi/legacy#670
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants
@berkerpeksag @ewdurbin @gilessbrown and others