-
Notifications
You must be signed in to change notification settings - Fork 112
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
Update pre-commit hooks and drop support for Python 3.6 & 3.7 #1109
Merged
odelalleau
merged 8 commits into
omry:master
from
odelalleau:od/update-pre-commit-hooks
Sep 22, 2023
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
057dc66
Update pre-commit hooks
odelalleau 01fd396
Update dev requirements to recent enough versions of code check tools
odelalleau b155a60
Update mypy Python version to match recommended dev version (3.8)
odelalleau d6bac51
Drop support for Python 3.6 and Python 3.7
odelalleau 7554b9c
Enforce that dev linters match their pre-commit version
odelalleau d3cb092
Bump dev version
odelalleau 6b37a5b
Add news fragment
odelalleau 42f1135
Remove useless `# pragma: no cover`
odelalleau File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,26 @@ | ||
default_language_version: | ||
python: python3.8 | ||
|
||
# Hook versions should match those in requirements/dev.txt | ||
repos: | ||
- repo: https://github.com/timothycrosley/isort | ||
rev: 5.0.9 | ||
- repo: https://github.com/PyCQA/isort | ||
rev: 5.12.0 | ||
hooks: | ||
- id: isort | ||
|
||
- repo: https://github.com/psf/black | ||
rev: 20.8b1 | ||
rev: 23.7.0 | ||
hooks: | ||
- id: black | ||
language_version: python3.8 | ||
|
||
- repo: https://gitlab.com/pycqa/flake8 | ||
rev: 3.7.9 | ||
- repo: https://github.com/PyCQA/flake8 | ||
rev: 6.0.0 | ||
hooks: | ||
- id: flake8 | ||
additional_dependencies: [-e, 'git+https://github.com/pycqa/pyflakes.git@1911c20#egg=pyflakes'] | ||
|
||
- repo: https://github.com/pre-commit/mirrors-mypy | ||
rev: v0.931 | ||
rev: v1.4.1 | ||
hooks: | ||
- id: mypy | ||
args: [--strict] | ||
additional_dependencies: ['pytest'] | ||
additional_dependencies: ['attrs', 'pytest'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Python 3.6 and 3.7 are not supported anymore: OmegaConf now requires Python 3.8+ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,14 @@ | ||
import sys # pragma: no cover | ||
|
||
__version__ = "2.4.0.dev0" | ||
__version__ = "2.4.0.dev1" | ||
|
||
msg = """OmegaConf 2.0 and above is compatible with Python 3.6 and newer. | ||
msg = """OmegaConf 2.4 and above is compatible with Python 3.8 and newer. | ||
You have the following options: | ||
1. Upgrade to Python 3.6 or newer. | ||
This is highly recommended. new features will not be added to OmegaConf 1.4. | ||
2. Continue using OmegaConf 1.4: | ||
You can pip install 'OmegaConf<1.5' to do that. | ||
1. Upgrade to Python 3.8 or newer. | ||
This is highly recommended. new features will not be added to OmegaConf 2.3. | ||
2. Continue using OmegaConf 2.3: | ||
You can pip install 'OmegaConf<2.4' to do that. | ||
""" | ||
if sys.version_info < (3, 6): | ||
|
||
if sys.version_info < (3, 8): | ||
raise ImportError(msg) # pragma: no cover |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,2 @@ | ||
antlr4-python3-runtime==4.9.* | ||
PyYAML>=5.1.0 | ||
# Use dataclasses backport for Python 3.6. | ||
dataclasses;python_version=='3.6' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
test=pytest | ||
|
||
[mypy] | ||
python_version = 3.7 | ||
python_version = 3.8 | ||
mypy_path=.stubs | ||
exclude = build/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This gets into actual cleanup of 3.6 code.
@Jasha10 , did we officially removed support for it yet?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When you said "lgtm" I thought you were saying "yes" to my question "thoughts on enforcing Python >= 3.8?"
All official releases of OmegaConf / Hydra still support Python 3.6. I'm proposing to drop this support in the next release (because it will make our lives easier, and I doubt anyone still runing 3.6/3.7 would care about not being able to run the latest version).
Edit: actually Hydra already dropped support for 3.6