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

Switch to modern python packaging #406

Merged
merged 2 commits into from
Feb 25, 2024

Conversation

getzze
Copy link
Contributor

@getzze getzze commented Feb 16, 2024

Using setup.py and setup.cfg is deprecated in favor of a single pyproject.toml file:
https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html

This PR removes these two files and the requirements*.txt files and puts all the relevant information in pyproject.toml.
Also the pingouin subfolder is removed, the tests are moved to the tests folder and the source to the src/pingouin folder.

The version number is uniquely defined in the __init__.py source file.

Copy link
Owner

@raphaelvallat raphaelvallat left a comment

Choose a reason for hiding this comment

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

This is absolutely fantastic @getzze! Thank you for implementing this. I'll definitely re-use this as a template in some of my other projects. One request to update the datasets path and then we should be good to merge.

README.rst Outdated Show resolved Hide resolved
README.rst Outdated Show resolved Hide resolved
pyproject.toml Show resolved Hide resolved
Copy link
Owner

@raphaelvallat raphaelvallat left a comment

Choose a reason for hiding this comment

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

Approved! Thanks again, I'll run some final checks and merge later this week.

@raphaelvallat
Copy link
Owner

@getzze could you please rebase to the latest master, which includes a fix for the unit tests: #403? Thanks

@getzze
Copy link
Contributor Author

getzze commented Feb 21, 2024

I just rebased.

I saw that you don't run the tests on python 3.8 anymore, do you want me to bump the minimal python version in pyproject.toml also?

Copy link

codecov bot commented Feb 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (0fb0277) 98.54% compared to head (b30cced) 98.54%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #406   +/-   ##
=======================================
  Coverage   98.54%   98.54%           
=======================================
  Files          19       19           
  Lines        3359     3359           
  Branches      547      547           
=======================================
  Hits         3310     3310           
  Misses         26       26           
  Partials       23       23           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@raphaelvallat
Copy link
Owner

Thank you!

I saw that you don't run the tests on python 3.8 anymore, do you want me to bump the minimal python version in pyproject.toml also?

I've disabled them because it led to a small rounding error for one particular unit test (logistic regression), most likely related to sklearn version differences. I didn't have time to investigate more, but all the other tests are working fine so I don't think there's a need to bump the minimal version to 3.8.

@hoechenberger
Copy link

Just FYI with this change, editable installations won't work the way you're used to. We experienced this issue with various MNE-Python-related projects.

The solution was to switch from the setuptools to the hatchling build backend. It's an easy thing to do and actually a more modern solution. I can help you do the switch either in this PR or in a followup.

See mne-tools/mne-python#12169 for details

@raphaelvallat
Copy link
Owner

@hoechenberger thank you for the heads-up! Very good to know. Let me merge this PR now and feel free to create a new one to use the hatchling backend.

@raphaelvallat raphaelvallat merged commit 3cfb649 into raphaelvallat:master Feb 25, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants