-vvv option).I am having trouble effectively/seamlessly setting package info/metadata for PyPI uploads. This includes:
long_description and long_description_content_type)This is the current build script I am using: https://github.com/ttymck/crucyble/blob/master/bin/build.sh
It first runs poetry build -f sdist (i'm distributing a cython package, so sources only). Then I manually manipulate the source distribution archive (tarball) adding the readme + readme content type as well as additional classifiers (from a etc/classifiers.txt in source control) directly to the generated PKG-INFO file. I then zip the modified archive and upload it.
The issue appears to be in generating the PKG-INFO file for sdist formats. It's entirely possible I am mis-configuring my build.py or pyproject.toml, or have missed some directions regarding a setup.cfg, etc. If it is indeed a bug or requires a new feature, I would be happy to help define the requirements and work on a patch.
Surprisingly it does look like the sdist builder doesn't have feature parity with the wheel builder. When comparing the two the license, description content type, and description fields seem to be missing.
Digging deeper it seems distutils.core.setup gets used instead of setuptools.setup in the generated setup.py which is a bit weird since it doesn't support the install_requires or python_requires arguments being passed to it. I'm guessing the setup.py is planned to get replaced with a pyproject.toml that installs via poetry which would solve this problem.
Thanks for surfacing that @orlnub123 ! I'll start there and try to launch a patch and see what reaction it gets.
I'm guessing the setup.py is planned to get replaced with a pyproject.toml that installs via poetry which would solve this problem.
I think I've seen mention of that before. Do you know where that conversation is being had? (github issue, pypa mailing list, etc)
@ttymck I wouldn't know, it just seems like the logical thing to do since PEP 518 got implemented in pip.
I'm not sure how I missed this but the pyproject.toml file has always been included.
@ttymck Are you using twine to upload to PyPI? I don't think poetry publish has this issue.
just published a package with poetry publish --build and no project description was produced although I have the README.md file in the root of project.
@AndreGuerra123 Have you specified the readme section in your pyproject.toml? I don't think poetry automatically detects it.
I ran into this. README is correctly specified, and the contents correctly appear in setup.py under long_description. However twine check reports:
Checking distribution dist/taguette-0.5.tar.gz: warning: `long_description_content_type` missing. defaulting to `text/x-rst`.
warning: `long_description` missing.
Then when I upload to PyPI, no README appears.
I can confirm that there is no description in PKG-INFO.
Because of Poetry I now have a completely broken release out. I love Poetry and how it makes it simple for me to build packages, however I will not keep using it if those packages are broken.
I have built a new tarball manually, but that doesn't even fix my PyPI page. Is there a way to recover from this bug?
Version 0.12.12, which has just been released, fixes the metadata inconsistency between wheels and sdists.
Most helpful comment
Digging deeper it seems
distutils.core.setupgets used instead ofsetuptools.setupin the generatedsetup.pywhich is a bit weird since it doesn't support the install_requires or python_requires arguments being passed to it. I'm guessing thesetup.pyis planned to get replaced with apyproject.tomlthat installs via poetry which would solve this problem.