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

MNT: Update build system and CI invocations #792

Merged
merged 18 commits into from
Apr 3, 2023

Conversation

effigies
Copy link
Member

Switch to hatchling+hatch-vcs. Move configuration to pyproject.toml where supported, away from setup.cfg in any case. Also generally use pipx instead of installing one-off tools in the base environment.

@effigies effigies force-pushed the mnt/modern_build branch 10 times, most recently from 9def2da to 5301b33 Compare March 29, 2023 18:19
@effigies
Copy link
Member Author

effigies commented Apr 3, 2023

@mgxd Would you mind having a look through?

Copy link
Contributor

@mgxd mgxd left a comment

Choose a reason for hiding this comment

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

Looks good! Thanks for modernizing 😄

Comment on lines +33 to +36
try:
import importlib_resources
except ImportError:
import importlib.resources as importlib_resources
Copy link
Contributor

Choose a reason for hiding this comment

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

nitpick: shouldn't the backport be the fallback?

Suggested change
try:
import importlib_resources
except ImportError:
import importlib.resources as importlib_resources
try:
import importlib.resources as importlib_resources
except ImportError:
import importlib_resources

Copy link
Member Author

Choose a reason for hiding this comment

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

importlib.resources is present I think in all supported versions, so this would prevent us from using the backported features.

An alternative is to import the specific required functions:

try:
    from importlib.resources import files, as_file
except ImportError:
    from importlib_resources import files, as_file

But they're a little cryptic without the module name. We could do import files as ... but then we'd need to come up with a name.

pyproject.toml Outdated Show resolved Hide resolved
.github/workflows/pythonpackage.yml Outdated Show resolved Hide resolved
Comment on lines +38 to +41
try:
import importlib_resources
except ImportError:
import importlib.resources as importlib_resources
Copy link
Contributor

Choose a reason for hiding this comment

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

and here

Suggested change
try:
import importlib_resources
except ImportError:
import importlib.resources as importlib_resources
try:
import importlib.resources as importlib_resources
except ImportError:
import importlib_resources

@codecov-commenter
Copy link

Codecov Report

Patch coverage: 70.96% and project coverage change: +9.59 🎉

Comparison is base (71a946d) 63.37% compared to head (a27fdf8) 72.96%.

❗ Current head a27fdf8 differs from pull request most recent head 52a9fb6. Consider uploading reports for the commit 52a9fb6 to get more accurate results

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #792      +/-   ##
==========================================
+ Coverage   63.37%   72.96%   +9.59%     
==========================================
  Files          49       76      +27     
  Lines        5966     7547    +1581     
  Branches     1170      872     -298     
==========================================
+ Hits         3781     5507    +1726     
- Misses       2003     2004       +1     
+ Partials      182       36     -146     
Flag Coverage Δ
reportlettests ∅ <ø> (∅)
unittests 64.75% <75.86%> (+14.11%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
niworkflows/__about__.py 100.00% <ø> (ø)
niworkflows/interfaces/bids.py 97.70% <ø> (+1.14%) ⬆️
niworkflows/interfaces/cifti.py 95.86% <ø> (+0.06%) ⬆️
niworkflows/reports/core.py 81.28% <ø> (+4.67%) ⬆️
niworkflows/utils/bids.py 76.41% <ø> (+0.22%) ⬆️
niworkflows/utils/spaces.py 91.79% <ø> (+1.53%) ⬆️
niworkflows/__init__.py 73.33% <60.00%> (-8.49%) ⬇️
niworkflows/conftest.py 93.93% <66.66%> (ø)
niworkflows/reports/tests/test_core.py 91.75% <78.57%> (ø)

... and 45 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@effigies effigies merged commit d735e87 into nipreps:master Apr 3, 2023
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.

3 participants