简体   繁体   中英

Why isn't setup.py metadata being used on PyPI?

I had a beta-version of my package up on PyPi.

The meta-information (eg home page, categories, etc.) from setup.py appeared on the project's PyPi page .

Later, I updated the project. The only thing I changed in the setup.py was the version number.

Update : As always, never trust someone who says that. I changed from setuptools to distutils. Cargo Cult programming - I just copied what another project had done. Sorry.

But the next version in the project's PyPi page has no meta-information.

I am trying to work out how I broke it; I find PyPi rather taxing to get right, so I am sure it was me. This time, I used Python 2.7.1 on a fairly fresh install of Windows (where previously I had used Python 2.6.x)

I almost certainly used a different command-line to upload it. (This time, it seemed to need signing and pgp installed, which I don't recall needing last time).

Where should I look to see why the meta-information in the setup.py file is no longer being uploaded?

Running the following command on your setup.py should correct the issue:

$ python setup.py register

Ideally, you would want to run the register command alongside the upload. I usually use a minimum of three commands when releasing any package (sdist, register, upload). The following will make a typical release to PyPI:

$ python setup.py sdist register upload

The rest of this post is a brief explanation of what these commands do.

The sdist command is one of a few build commands that will build a source distribution. You are likely familiar with it already since you have uploaded a.zip file. A similar command is bdist , which builds binary distributions.

The distribution (or package) metadata is sent separate from the built distribute. The setuptools' upload command will upload your project build(s) (eg myproject-0.0.zip). The register command should be used to update the metadata information. The register command sends the PKGINFO (or egg_info) to PyPI in a format that it understands.

This is hard to answer. Can you give us the command lines you used? Does your setup.py use distutils or setuptools? Have you changed your pydistutils.cfg or.pypirc file between the two times?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM