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

feat: numpy 2.0rc support #651

Merged
merged 5 commits into from
Apr 20, 2024
Merged

Conversation

FBruzzesi
Copy link
Collaborator

@FBruzzesi FBruzzesi commented Apr 19, 2024

Description

There are 3 folds on this PR:

  • Numpy changes needed for v2 which are compatible with v1:
    • np.lib.pad to np.pad
    • np.NaN to np.nan
  • Pytest marks
  • Constraining numpy<2.0 for cvxpy and umap extra dependencies: it is out of our control for them to support latest numpy version.
    • This last bit led me to separate the cron gha into base and extra

Edit: Manual trigger of cron gha is successful

uv pip install ${{ matrix.pre-release-dependencies }} -e ".[test-all]" --system
uv pip freeze
- name: Test with pytest
run: pytest -n auto --disable-warnings --cov=sklego -m "cvxpy or formulaic or umap"
Copy link
Owner

Choose a reason for hiding this comment

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

I wonder ... is the -m part needed here? Don't we test for everything by default?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oh true, by default everything is tested, with such flag just the extras. I was thinking doing a sort of "delta".

Copy link
Owner

Choose a reason for hiding this comment

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

That can still be a good idea. I guess we could first do a run without those marked tests and then run a step for each of them. Just make sure that you always run each step.

Copy link
Collaborator Author

@FBruzzesi FBruzzesi Apr 19, 2024

Choose a reason for hiding this comment

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

I split each extra using matrix, it gets a little spammy but very detailed (example)

Copy link
Owner

@koaning koaning left a comment

Choose a reason for hiding this comment

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

Looks great overall, just wanted to double-check two things.

@FBruzzesi FBruzzesi marked this pull request as ready for review April 19, 2024 18:17
uv pip freeze
- name: Test with pytest
run: pytest -n auto --disable-warnings --cov=sklego -m "not cvxpy and not formulaic and not umap"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

As far as I know, there is no easy way to ask only for those tests without a "registered" mark.
I tried to achieve that dynamically via pytest_collection_modifyitems, but it's a bit of a headache as @pytest.mark.parametrize and any other pytest marker count as a mark in the items

Copy link
Owner

Choose a reason for hiding this comment

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

As-is seems perfectly fine :)

@koaning koaning merged commit 8cabda3 into koaning:main Apr 20, 2024
17 checks passed
@FBruzzesi FBruzzesi deleted the feature/numpy2.0-support branch April 20, 2024 11:46
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.

2 participants