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 instead of setup.py/setup.cfg #2540

Merged
merged 16 commits into from
Oct 16, 2024
Merged

Conversation

bouweandela
Copy link
Member

@bouweandela bouweandela commented Oct 3, 2024

Description

Use pyproject.toml instead of setup.py/setup.cfg, as this is the modern way of doing things.

Also added some improvements suggested by https://learn.scientific-python.org/development/guides/repo-review/?repo=esmvalgroup%2Fesmvalcore&branch=pyproject-toml

Link to documentation: https://esmvaltool--2540.org.readthedocs.build/projects/ESMValCore/en/2540/contributing.html

Related to ESMValGroup/ESMValTool#3584


Before you get started

Checklist

It is the responsibility of the author to make sure the pull request is ready to review. The icons indicate whether the item will be subject to the 🛠 Technical or 🧪 Scientific review.


To help with the number pull requests:

@bouweandela bouweandela added the installation Installation problem label Oct 3, 2024
Copy link

codecov bot commented Oct 3, 2024

Codecov Report

Attention: Patch coverage is 85.71429% with 1 line in your changes missing coverage. Please review.

Project coverage is 94.77%. Comparing base (e69ec5d) to head (50e09ff).
Report is 46 commits behind head on main.

Files with missing lines Patch % Lines
esmvalcore/_task.py 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2540      +/-   ##
==========================================
- Coverage   95.01%   94.77%   -0.25%     
==========================================
  Files         251      251              
  Lines       14268    14266       -2     
==========================================
- Hits        13557    13520      -37     
- Misses        711      746      +35     

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

Copy link
Contributor

@valeriupredoi valeriupredoi left a comment

Choose a reason for hiding this comment

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

absolutely YES for this 🍺

@bouweandela bouweandela marked this pull request as ready for review October 3, 2024 12:39
Copy link
Contributor

@schlunma schlunma left a comment

Choose a reason for hiding this comment

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

Great, thanks Bouwe, I really like this! 🚀

There's one more suggestion at https://learn.scientific-python.org/development/guides/repo-review/?repo=esmvalgroup%2Fesmvalcore&branch=pyproject-toml about pyproject:

[PP309](https://learn.scientific-python.org/development/guides/pytest#PP309): Filter warnings specified

filterwarnings must be set (probably to at least ["error"]). Python will hide important warnings otherwise, like deprecations.

[tool.pytest.ini_options]
filterwarnings = ["error"]

Would it make sense to implement this as well?

@bouweandela
Copy link
Member Author

Would it make sense to implement this as well?

I tried, but it causes the tests to fail because some of our dependencies are using deprecated features. It would be good to enable that though, but it will require extra work.

@bouweandela
Copy link
Member Author

bouweandela commented Oct 15, 2024

Would it make sense to implement this as well?

I tried, but it causes the tests to fail because some of our dependencies are using deprecated features. It would be good to enable that though, but it will require extra work.

Created #2555 as a reminder.

Copy link
Contributor

@schlunma schlunma left a comment

Choose a reason for hiding this comment

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

Great, thanks Bouwe!!

@schlunma schlunma added this to the v2.12.0 milestone Oct 16, 2024
Copy link
Contributor

@valeriupredoi valeriupredoi left a comment

Choose a reason for hiding this comment

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

very cool! A few remoarks from me only, but I think we now need to add importlib_metadata to our deps if we use it directly

@valeriupredoi
Copy link
Contributor

valeriupredoi commented Oct 16, 2024

PS: will remove the three bits in the Github Action, just need to see those slow OSX tests pass first

just the call to run GA, Mambaforge can bite the dust via here, am just about to open a PR to remove it from the other tests too

@bouweandela
Copy link
Member Author

we now need to add importlib_metadata to our deps if we use it directly

Can you point me to a line of code where it is used? I couldn't find any.

@valeriupredoi
Copy link
Contributor

we now need to add importlib_metadata to our deps if we use it directly

Can you point me to a line of code where it is used? I couldn't find any.

nevermind, it was from importlib.metadata - dot is essential, V 😁

@valeriupredoi
Copy link
Contributor

soz, conflict - want me to fix it? 🍺

@bouweandela
Copy link
Member Author

No thanks, I'm on it.

@valeriupredoi
Copy link
Contributor

superb @bouweandela 🥳

@valeriupredoi valeriupredoi merged commit 56a9756 into main Oct 16, 2024
6 of 7 checks passed
@valeriupredoi valeriupredoi deleted the pyproject-toml branch October 16, 2024 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
installation Installation problem
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants