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

No longer works without having a MANIFEST.in #6

Closed
jpmvferreira opened this issue Oct 30, 2021 · 4 comments
Closed

No longer works without having a MANIFEST.in #6

jpmvferreira opened this issue Oct 30, 2021 · 4 comments

Comments

@jpmvferreira
Copy link

If I run pyproject-build without having a MANIFEST.in (caps does seem to be mandatory) in the same directory as setup.py, and in it add the line include README.md, I will get an error saying that it can't find such a file when turning this into a package.

@di
Copy link
Owner

di commented Oct 30, 2021

What is pyproject-build? Are you referring to https://github.com/pypa/build?

@jpmvferreira
Copy link
Author

Yes, I'm using Manjaro and when installing python-build from the official repositories, which have that exact github repository as their upstream URL, I get a binary named pyproject-build, which I use to build the packages, before uploading them to Pypi with twine.

When building the package with pyproject-build I have an error saying that the file was not found, and if I print the path its currently working on, it shows some folder in /tmp, and to get the readme.md over there I require the MANIFEST.in file with the line include readme.md.

This issue isn't just happening for me, as noted by this post in stack overflow, and because I found you repository somehow when looking for a solution for this issue, I thought about letting you know about it.

@di
Copy link
Owner

di commented Oct 30, 2021

This works fine for me:

$ git clone di/markdown-description-example
Cloning into 'markdown-description-example'...
remote: Enumerating objects: 5, done.
remote: Total 5 (delta 0), reused 0 (delta 0), pack-reused 5
Receiving objects: 100% (5/5), done.

$ python -m build
* Creating virtualenv isolated environment...
* Installing packages in isolated environment... (setuptools >= 40.8.0, wheel)
* Getting dependencies for sdist...
running egg_info
creating markdown_description_example.egg-info
writing markdown_description_example.egg-info/PKG-INFO
writing dependency_links to markdown_description_example.egg-info/dependency_links.txt
writing top-level names to markdown_description_example.egg-info/top_level.txt
writing manifest file 'markdown_description_example.egg-info/SOURCES.txt'
reading manifest file 'markdown_description_example.egg-info/SOURCES.txt'
writing manifest file 'markdown_description_example.egg-info/SOURCES.txt'
* Building sdist...
running sdist
running egg_info
writing markdown_description_example.egg-info/PKG-INFO
writing dependency_links to markdown_description_example.egg-info/dependency_links.txt
writing top-level names to markdown_description_example.egg-info/top_level.txt
reading manifest file 'markdown_description_example.egg-info/SOURCES.txt'
writing manifest file 'markdown_description_example.egg-info/SOURCES.txt'
running check
creating markdown-description-example-0.0.1
creating markdown-description-example-0.0.1/markdown_description_example.egg-info
copying files to markdown-description-example-0.0.1...
copying README.md -> markdown-description-example-0.0.1
copying setup.py -> markdown-description-example-0.0.1
copying markdown_description_example.egg-info/PKG-INFO -> markdown-description-example-0.0.1/markdown_description_example.egg-info
copying markdown_description_example.egg-info/SOURCES.txt -> markdown-description-example-0.0.1/markdown_description_example.egg-info
copying markdown_description_example.egg-info/dependency_links.txt -> markdown-description-example-0.0.1/markdown_description_example.egg-info
copying markdown_description_example.egg-info/top_level.txt -> markdown-description-example-0.0.1/markdown_description_example.egg-info
Writing markdown-description-example-0.0.1/setup.cfg
Creating tar archive
removing 'markdown-description-example-0.0.1' (and everything under it)
* Building wheel from sdist
* Creating virtualenv isolated environment...
* Installing packages in isolated environment... (setuptools >= 40.8.0, wheel)
* Getting dependencies for wheel...
running egg_info
writing markdown_description_example.egg-info/PKG-INFO
writing dependency_links to markdown_description_example.egg-info/dependency_links.txt
writing top-level names to markdown_description_example.egg-info/top_level.txt
reading manifest file 'markdown_description_example.egg-info/SOURCES.txt'
writing manifest file 'markdown_description_example.egg-info/SOURCES.txt'
* Installing packages in isolated environment... (wheel)
* Building wheel...
running bdist_wheel
running build
/private/var/folders/m_/ffctv9r113lb285667lc7fh800k0_0/T/build-env-7w_pptfz/lib/python3.8/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
installing to build/bdist.macosx-10.15-x86_64/wheel
running install
running install_egg_info
running egg_info
writing markdown_description_example.egg-info/PKG-INFO
writing dependency_links to markdown_description_example.egg-info/dependency_links.txt
writing top-level names to markdown_description_example.egg-info/top_level.txt
reading manifest file 'markdown_description_example.egg-info/SOURCES.txt'
writing manifest file 'markdown_description_example.egg-info/SOURCES.txt'
Copying markdown_description_example.egg-info to build/bdist.macosx-10.15-x86_64/wheel/markdown_description_example-0.0.1-py3.8.egg-info
running install_scripts
creating build/bdist.macosx-10.15-x86_64/wheel/markdown_description_example-0.0.1.dist-info/WHEEL
creating '/Users/dustiningram/git/di/markdown-description-example/dist/tmpv0da2_qc/markdown_description_example-0.0.1-py3-none-any.whl' and adding 'build/bdist.macosx-10.15-x86_64/wheel' to it
adding 'markdown_description_example-0.0.1.dist-info/METADATA'
adding 'markdown_description_example-0.0.1.dist-info/WHEEL'
adding 'markdown_description_example-0.0.1.dist-info/top_level.txt'
adding 'markdown_description_example-0.0.1.dist-info/RECORD'
removing build/bdist.macosx-10.15-x86_64/wheel
Successfully built markdown-description-example-0.0.1.tar.gz and markdown_description_example-0.0.1-py3-none-any.whl

$ tar -tf dist/markdown-description-example-0.0.1.tar.gz
markdown-description-example-0.0.1/
markdown-description-example-0.0.1/PKG-INFO
markdown-description-example-0.0.1/README.md
markdown-description-example-0.0.1/markdown_description_example.egg-info/
markdown-description-example-0.0.1/markdown_description_example.egg-info/PKG-INFO
markdown-description-example-0.0.1/markdown_description_example.egg-info/SOURCES.txt
markdown-description-example-0.0.1/markdown_description_example.egg-info/dependency_links.txt
markdown-description-example-0.0.1/markdown_description_example.egg-info/top_level.txt
markdown-description-example-0.0.1/setup.cfg
markdown-description-example-0.0.1/setup.py

The README.md file should be included by default without having to specify it in the manifest: https://packaging.python.org/guides/using-manifest-in/#how-files-are-included-in-an-sdist

I suspect this might be due to your distro modifying the build tool after the fact in a way that deviates from its canonical behavior.

Can you give me the versions of setuptools and build you have installed? Also if you can show the exact command you ran on this repo and the output, that would be helpful as well.

@jpmvferreira
Copy link
Author

Ah you are right, it seems that the caps lock does make a difference in the readme as it does in the manifest.

When I copied your setup.py I added my own readme to test it out, and forgot the caps, and ended up modifying your setup.py instead of renaming my readme.

Thanks for the link you've sent, it seems that the hardest part about python is the creating and sharing packages.

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

2 participants