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

enable black for py311 #1697

Merged
merged 4 commits into from
Jun 26, 2024
Merged

Conversation

lundybernard
Copy link
Contributor

black version 24 has been released

@lundybernard
Copy link
Contributor Author

CI Tests / Linters (3.11)
failed with error:

Run pre-commit run black --all-files
[INFO] Installing environment for https://github.com/psf/black.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
black....................................................................Failed
- hook id: black
- exit code: 2

Usage: black [OPTIONS] SRC ...
Try 'black -h' for help.

Error: Invalid value for '-t' / '--target-version': 'py311' is not one of 'py33', 'py34', 'py35', 'py36', 'py37', 'py38', 'py39', 'py310'.

Error: Process completed with exit code 1.

This looks like an older version of black, which does not support py311, is installed the CI environment.
I checked the CI tests log but could not see where black is installed, it looks like it's wrapped up in pre-commit.

Copy link

codecov bot commented Jun 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.48%. Comparing base (812b2a8) to head (36a20cb).
Report is 148 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #1697       +/-   ##
===========================================
- Coverage   94.28%   82.48%   -11.80%     
===========================================
  Files          91      117       +26     
  Lines        7013     8683     +1670     
===========================================
+ Hits         6612     7162      +550     
- Misses        401     1521     +1120     

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

@cosmicBboy
Copy link
Collaborator

can you bump the black version used in the pre-commit file? https://github.com/unionai-oss/pandera/blob/main/.pre-commit-config.yaml#L36

@lundybernard
Copy link
Contributor Author

lundybernard commented Jun 22, 2024

yes, thanks.
should I bump the minimum version in environment.yml as well?
set both to 24.4.*?

Edit:

pre-commit requires an exact version, so it must be set to 24.4.2.

@lundybernard lundybernard force-pushed the bugfix/black-py311 branch 2 times, most recently from 0e0f763 to f98ff79 Compare June 23, 2024 21:21
Fixes: unionai-oss#1698

Signed-off-by: LundyBernard <[email protected]>
linter changes for black=24.4

Signed-off-by: LundyBernard <[email protected]>
@cosmicBboy
Copy link
Collaborator

cosmicBboy commented Jun 24, 2024

requirements need to be regenerated with make nox-requirements (you may need to install nox and conda to get this to work, see here)

* update .pre-commit-config.yml
* Update environment.yaml
* updated auto-generated config files using `make nox-requirements`

Signed-off-by: LundyBernard <[email protected]>
black version 24 has been released

Signed-off-by: LundyBernard <[email protected]>
@cosmicBboy cosmicBboy merged commit 5046d18 into unionai-oss:main Jun 26, 2024
155 of 156 checks passed
@lundybernard lundybernard deleted the bugfix/black-py311 branch June 26, 2024 17:55
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