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

Use pyproject.toml with hatch #156

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open

Conversation

getzze
Copy link
Contributor

@getzze getzze commented Jul 25, 2024

Modernize the building and testing framework:

  • use pyproject.toml
  • use hatch environments
  • add test_script to test plotting figures

To build: hatch build or python -m build
To bump version: hatch version minor
To test: hatch run tests:run
To test with coverage: hatch run tests:run-cov && hatch run coverage:run
To build and test docs: hatch run docs:all
To run examples: hatch run examples:run -- --plot_type=boxplot --data_type=df_with_group_and_hue

To test #155 I had to write the test_script.py file and it was very convenient to use hatch environments for testing. So I thought I should actually make a PR about it :)

use hatch environments

add test_script to test plotting figures
Copy link

codecov bot commented Jul 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.45%. Comparing base (8f148c1) to head (3439ec8).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #156      +/-   ##
==========================================
- Coverage   97.11%   92.45%   -4.66%     
==========================================
  Files          29       15      -14     
  Lines        1939     1127     -812     
  Branches        0      227     +227     
==========================================
- Hits         1883     1042     -841     
+ Misses         56       52       -4     
- Partials        0       33      +33     

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

@getzze
Copy link
Contributor Author

getzze commented Jul 31, 2024

I modified a bit the Github action so instead of calling hatch once to run all the tests, the workflow creates a matrix of python and seaborn versions (we could also add an OS matrix if needed, see https://github.com/platformdirs/platformdirs/ for the modifications to do).

Github runs matrix jobs in parallel so the tests are substantially faster.

@getzze
Copy link
Contributor Author

getzze commented Jul 31, 2024

I forgot to mention that python 3.7 is not tested (hatch was not working for me with this python version). It would be better to drop it, as it is EOL anyway.

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