You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(buildtest) ~/Documents/github/buildtest/ [pyproject.toml+*] black --version
black, 23.3.0 (compiled: yes)
Python (CPython) 3.10.12
(buildtest) ~/Documents/github/buildtest/ [pyproject.toml+*] pip list | grep black
black 23.3.0
The problem is when i install the hook pre-commit install it doesnt work and states the following
(buildtest) ~/Documents/github/buildtest/ [pyproject.toml+*] git commit
[WARNING] Unstaged files detected.
[INFO] Stashing unstaged files to /Users/siddiq90/.cache/pre-commit/patch1689195589-35757.
isort....................................................................Passed
black....................................................................Failed
- hook id: black
- exit code: 1
Identified `/Users/siddiq90/Documents/github/buildtest` as project root containing a .git directory.
Sources to be formatted: "buildtest/cli/report.py", "buildtest/main.py", "buildtest/system.py", "buildtest/tools/stylecheck.py", "buildtest/tools/unittests.py", "buildtest/utils/command.py", "buildtest/utils/file.py", "buildtest/utils/shell.py", "buildtest/utils/tools.py", "tests/cli/test_history.py", "tests/cli/test_inspect.py", "tests/cli/test_report.py", "tests/schemas/test_utils.py", "tests/test_ascent.py", "tests/test_jlse.py", "tests/test_nersc.py", "tests/test_pbs.py", "tests/tools/test_stylecheck.py", "tests/utils/test_file.py"
Using configuration from project root.
required_version: 23.3.0
target_version: ['py38', 'py39', 'py310', 'py311']
skip_magic_trailing_comma: True
line_length: 88
verbose: True
Oh no! 💥 💔 💥 The required version `23.3.0` does not match the running version `0.1.dev1+gbf7a162`!
[INFO] Restored changes from /Users/siddiq90/.cache/pre-commit/patch1689195589-35757.
It is confusing because i am able to run black manually and --required-version works for me but it doesnt work when i add to configuration file
(buildtest) ~/Documents/github/buildtest/ [pyproject.toml+*] black --required-version 23.3.0 --check buildtest/main.py
Identified `/Users/siddiq90/Documents/github/buildtest` as project root containing a .git directory.
Sources to be formatted: "buildtest/main.py"
Using configuration from project root.
target_version: ['py38', 'py39', 'py310', 'py311']
skip_magic_trailing_comma: True
line_length: 88
verbose: True
buildtest/main.py wasn't modified on disk since last run.
All done! ✨ 🍰 ✨
1 file would be left unchanged.
Is this key not accepted in pyproject.toml
required-version = '23.3.0'
Note i have this working when i dont have the key and install the precommit hook it only fails when i add this configuration in my pyproject.toml
The text was updated successfully, but these errors were encountered:
JelleZijlstra
changed the title
black not working with required_version in pyproject.toml
black not working with required_version in pre-commit
Jul 12, 2023
Here is my black configuration in pyproject.toml
I have a .pre-commit-config.yaml file that will install the black hook
I can confirm the black version is 23.3.0
The problem is when i install the hook
pre-commit install
it doesnt work and states the followingIt is confusing because i am able to run black manually and
--required-version
works for me but it doesnt work when i add to configuration fileIs this key not accepted in pyproject.toml
Note i have this working when i dont have the key and install the precommit hook it only fails when i add this configuration in my pyproject.toml
The text was updated successfully, but these errors were encountered: