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

move generation of pari bindings sources out of build_ext #163

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@

ext_kwds = dict(include_dirs=include_dirs(), library_dirs=library_dirs())

# Generate auto-generated sources from pari.desc
# This needs to be done before build/build_ext so the generated pxd is moved
# to the build directory and installed with newer setuptools.
rebuild()
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will make this run even on just building the sdist, which does not seem correct

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had not thought of that because I did not produce sdist off course. It may need to be in build.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just did a basic test by adding a build class and running rebuild there. The .pxd are only generated once but are now properly shipped with each python implementation. I would prefer if .pxd where always re-generated but that may be considered an efficiency win. I will check what happens to sdist.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, that still generate and incorporate .pxd in sdist. I may have to use MANIFEST.in instead to exclude them.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I keep forgetting. This is not about all .pxd files, it is about just auto_paridecl.pxd. The sdist is fine putting rebuild in a build class.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And auto_paridecl.pxd is also not included in sdist with my current PR.


if "READTHEDOCS" in os.environ:
# When building with readthedocs, disable optimizations to decrease
Expand All @@ -28,9 +32,6 @@
# Adapted from Cython's new_build_ext
class build_ext(_build_ext):
def finalize_options(self):
# Generate auto-generated sources from pari.desc
rebuild()

self.directives = {
"autotestdict.cdef": True,
"binding": True,
Expand Down
Loading