user8369173
user8369173

Reputation: 1

400 Client Error: Web Environment' is not a valid choice for this field for url: https://upload.pypi.org/legacy/

When i put my module on the package when uploading to pypi, something went wrong and I did not know how to fix it

$ twine upload dist/*
Uploading distributions to https://upload.pypi.org/legacy/
Uploading zaoshu-0.1.1-py3-none-any.whl

HTTPError: 400 Client Error: classifiers: 'Development Status :: 4 - 
BetaEnvironment :: Web Environment' is not a valid choice for this 
field for url: https://upload.pypi.org/legacy/

my setup.py

setup(
    name="zaoshu",
    version="0.1.1",
    author="Wei Cheng",
    author_email="*****@zaoshu.io",
    description="zaoshu包实现里对造数openapi功能的封装,提高开发效率.",
    long_description=open("README.md").read(),
    license="MIT",
    url="https://github.com/zaoshu/pysdk",
    packages=['zaoshu'],
    install_requires=[
        "requests",
    ],
    python_requires = '> = 3',
    classifiers=[
        "Development Status :: 4 - Beta"
        "Environment :: Web Environment",
        "Intended Audience :: Developers",
        "License :: Free For Home Use",
        "Natural Language :: Chinese (Simplified)",
        "Programming Language :: Python",
        "Programming Language :: Python :: 3",
        "Programming Language :: Python :: 3.0",
        "Programming Language :: Python :: 3.1",
        "Programming Language :: Python :: 3.2",
        "Programming Language :: Python :: 3.3",

    ],
)

my .pypirc

[distutils] 
index-servers  =
pypi 

[pypi] 
username = your_username 
password = your_password

Above is my code, we help look at the reasons

Upvotes: 0

Views: 716

Answers (1)

phd
phd

Reputation: 94483

You're missing a comma after the 1st classifier:

classifiers=[
        "Development Status :: 4 - Beta", <<<=== Here!

Without the comma Python concatenates the strings:

classifiers=[
    "Development Status :: 4 - BetaEnvironment :: Web Environment",

Well-known Python misfeature. :-(

Upvotes: 3

Related Questions