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

Include Cython sources via package_data #6232

Merged
merged 3 commits into from
Feb 10, 2022

Conversation

grlee77
Copy link
Contributor

@grlee77 grlee77 commented Feb 7, 2022

Description

The point of this PR is to get the .pyx, .pxd or .pxi Cython files included in the wheels again while still avoiding inclusion of the large Cython-generated .c or .cpp files. It resolves the discussion in #6177

It seems like we should just be able to set include_package_data=True and rely on the MANIFEST.in, but whenever I tried this locally, the .c and .cpp files generated by Cython also end up getting included in the wheels (but not in the source distribution). I am not sure why that is.

So, rather than set include_package_data=True, this PR leaves that variable False and just manually specifies package_data in setup.py. I had to add a few missing __init__.py files for this to properly include all the tests.

Checklist

  • Docstrings for all functions
  • Gallery example in ./doc/examples (new features only)
  • Benchmark in ./benchmarks, if your changes aren't covered by an
    existing benchmark
  • Unit tests
  • Clean style in the spirit of PEP8
  • Descriptive commit messages (see below)

For reviewers

  • Check that the PR title is short, concise, and will make sense 1 year
    later.
  • Check that new functions are imported in corresponding __init__.py.
  • Check that new features, API changes, and deprecations are mentioned in
    doc/release/release_dev.rst.
  • There is a bot to help automate backporting a PR to an older branch. For
    example, to backport to v0.19.x after merging, add the following in a PR
    comment: @meeseeksdev backport to v0.19.x
  • To run benchmarks on a PR, add the run-benchmark label. To rerun, the label
    can be removed and then added again. The benchmark output can be checked in
    the "Actions" tab.

made sure all tests folders have an __init__.py so they get automatically included
need to manually include files in tests/data subdirectories
include all cython source files (.pyx, .pxd, .pxi)
@grlee77 grlee77 added 🔧 type: Maintenance Refactoring and maintenance of internals backport: 0.19.x labels Feb 7, 2022
@grlee77 grlee77 added this to the 0.19.2 milestone Feb 7, 2022
setup.py Outdated Show resolved Hide resolved
@grlee77
Copy link
Contributor Author

grlee77 commented Feb 8, 2022

Thanks, @hmaarrfk. I updated this and it is ready to review now (there is only the unrelated Appveyor failure)

@hmaarrfk hmaarrfk merged commit a5579b5 into scikit-image:main Feb 10, 2022
@grlee77
Copy link
Contributor Author

grlee77 commented Feb 13, 2022

@meeseeksdev backport to v0.19.x

meeseeksmachine pushed a commit to meeseeksmachine/scikit-image that referenced this pull request Feb 13, 2022
grlee77 added a commit that referenced this pull request Feb 13, 2022
…2-on-v0.19.x

Backport PR #6232 on branch v0.19.x (Include Cython sources via package_data)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔧 type: Maintenance Refactoring and maintenance of internals
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants