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

Add CMakeLists.txt (etc...) to sdist #90

Open
tlambert03 opened this issue Oct 1, 2021 · 3 comments
Open

Add CMakeLists.txt (etc...) to sdist #90

tlambert03 opened this issue Oct 1, 2021 · 3 comments

Comments

@tlambert03
Copy link

tlambert03 commented Oct 1, 2021

#89 added the sdist to pypi, which is great. However, in trying to build this package on conda-forge, I pulled the sdist from pypi and tried to build, but the sdist doesn't contain CMakeLists.txt (and perhaps other things) required to actually build the source.

error

Building wheels for collected packages: aicspylibczi
  Created temporary directory: /tmp/pip-wheel-nnka06mp
  Running command /home/conda/staged-recipes/build_artifacts/aicspylibczi_1633099207316/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-o13na_jo/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-o13na_jo/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-nnka06mp
  Building wheel for aicspylibczi (setup.py): started
  Destination directory: /tmp/pip-wheel-nnka06mp
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.8
  creating build/lib.linux-x86_64-3.8/aicspylibczi
  copying aicspylibczi/__init__.py -> build/lib.linux-x86_64-3.8/aicspylibczi
  copying aicspylibczi/types.py -> build/lib.linux-x86_64-3.8/aicspylibczi
  copying aicspylibczi/CziFile.py -> build/lib.linux-x86_64-3.8/aicspylibczi
  copying aicspylibczi/_version.py -> build/lib.linux-x86_64-3.8/aicspylibczi
  running egg_info
  writing aicspylibczi.egg-info/PKG-INFO
  writing dependency_links to aicspylibczi.egg-info/dependency_links.txt
  writing requirements to aicspylibczi.egg-info/requires.txt
  writing top-level names to aicspylibczi.egg-info/top_level.txt
  reading manifest file 'aicspylibczi.egg-info/SOURCES.txt'
  adding license file 'LICENSE'
  writing manifest file 'aicspylibczi.egg-info/SOURCES.txt'
  running build_ext
  CMake Error: The source directory "/tmp/pip-req-build-o13na_jo" does not appear to contain CMakeLists.txt.

I can use the tar.gz from the github releases for now, but it would be nice to make the sdist fully "build-competent"

@toloudis
Copy link
Collaborator

ok I think the sdist wants to see a MANIFEST.in file that lists out all the source files to be included. (reference: pytorch/pytorch#52843)

@tlambert03
Copy link
Author

manifest.in is one option (the "classic distutils option") for declaring what should get into the sdist, but if you're using setuptools, it gets slightly more complicated. suggest reading this page: https://setuptools.pypa.io/en/latest/userguide/datafiles.html and note the include_package_data and package_data options.

Ultimately, as many times as I've read through those docs, I generally end up doing this by some degree of trial and error. running python setup.py sdist bdist_wheel over and over again, inspecting both the wheel and the sdist, and modifying setup.py and manifest.in until I'm happy.

@toloudis
Copy link
Collaborator

I have attempted to do this in the aicspylibczi 3.1.1 build. Still untested but the sdist now has a more complete attempt to bundle all source code. (Gotta figure out how to test this!)

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