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 15 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:

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 :)

Copy link

codecov bot commented Jul 27, 2024

Codecov Report

Attention: Patch coverage is 72.72727% with 3 lines in your changes missing coverage. Please review.

Project coverage is 97.37%. Comparing base (1dd7714) to head (02aa6ac).
Report is 11 commits behind head on master.

Files with missing lines Patch % Lines
src/statannotations/compat.py 72.72% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #156      +/-   ##
==========================================
+ Coverage   91.37%   97.37%   +5.99%     
==========================================
  Files          31       16      -15     
  Lines        2493     1484    -1009     
  Branches        0      209     +209     
==========================================
- Hits         2278     1445     -833     
+ Misses        215       26     -189     
- Partials        0       13      +13     

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


🚨 Try these New Features:

@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.

use hatch environments

add test_script to test plotting figures
@getzze
Copy link
Contributor Author

getzze commented Nov 19, 2024

Thanks for merging #155, I rebased this PR, all tests are passing now. I will check the jupyter notebook.

Reminder: minimal python version is set to 3.8

@getzze
Copy link
Contributor Author

getzze commented Nov 19, 2024

The notebook runs correctly with python 3.12.

I added support for python 3.13 (only compatible with seaborn 0.13), the tests are passing.

@getzze
Copy link
Contributor Author

getzze commented Nov 19, 2024

Coverage is working now!

@getzze
Copy link
Contributor Author

getzze commented Nov 19, 2024

@trevismd it's ready for review

@@ -9,15 +9,14 @@ name = "statannotations"
description = "add statistical significance or custom annotations on seaborn plots. Based on statannot 0.2.3"
readme = "README.md"
license = {text = "MIT License"}
requires-python = ">=3.7"
requires-python = ">=3.8"
Copy link
Owner

Choose a reason for hiding this comment

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

Ah forgot about this one... Do you mind if I cherry-pick this one independently?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, sure!
If you are planning a patch release, I realized the README also needs minor corrections: mention that the last version is 0.6, should be 0.7.

@getzze
Copy link
Contributor Author

getzze commented Nov 19, 2024

closes #150

I moved all the source files to a src folder, which avoids some errors when running tests and building docs.

Also I added some linting scripts: typos , end-of-file-fixer and trailing-whitespace

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