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

DRAFT: Updated packaging scheme #147

Open
wants to merge 30 commits into
base: main
Choose a base branch
from
Open

DRAFT: Updated packaging scheme #147

wants to merge 30 commits into from

Conversation

jared321
Copy link
Contributor

@jared321 jared321 commented Feb 5, 2025

I need a PR to get the actions running.

Put all information needed by pip to build distributions in a dedicated build
system venv in the TOML file.  All information needed to dictate the composition
of the package in setup.py.  I was able to remove dependencies.
With this, I can get tox -e coverage working.  I see that .so is installed
correctly in the nocoverage installation as well.
This is recommended by both the Cython and setuptools docs.  As a result Cython
need only be installed by developers that are actually working on that file.
setup.py is responsible only for compiling the c file, which requires numpy
headers but not cython.  This can be seen in the changes here including the fact
that the test suite no longer needs to cythonize the c file to run.

I added a cythonize tox task to setup a venv with Cython and generate the c file
with it.  The coverage test is still passing.  I was also able to install
surmise in a venv and run the GP_surmise notebook sucessfully, which should be
using the Cython code.
I have never had to exclude files like this.  If I comment out the Extension
line in setup.py and get rid of pyproject.toml, I don't in fact need to do the
exclusions.  Note clear why the TOML file is causing this mass inclusion by
default.
This is necessitated so that binary wheels are built with a numpy version that
is ABI compatible with all numpy versions that users can choose to install
alongside surmise.
The inability that I had with installing numpy < 1.26 in build systems is no
longer an issue since we are now fixed at the more modern 2.0.0.  On my system,
I was able to get tests working with 1.22.0.

Developers should all use the same Cython version.

Explicitly fix the Cython language directive to Python 3 to get rid of warnings.
According to the warning, it was previously using 3str by default.  Therefore,
there are a few changes to the .c file, which was generated using the new Cython
version and the target 2.0.0 numpy version.
@jared321 jared321 self-assigned this Feb 5, 2025
The actions also failed on macOS-13, which was using numpy 2.2.2.  Other macos
tests passed with older numpy versions.  I did see at least one Ubuntu test pass
with 2.2.2.  Try restricting version to see if we can get all tests passing.
Try numpy 2.0.0 to match the version used to build wheels.  Also try adding in
Python 3.13.
Remove macos-13 and see if any others are failing with the newest numpy.
macos-13 works in the oldest test with Python 3.9.  See if it works with more
modern numpy.
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

Successfully merging this pull request may close these issues.

1 participant