Skip to content

Commit 266d2d1

Browse files
author
FirstUnicorn
committed
fix: remove invalid --check flag from poetry-lock hook
Poetry 2.3.3 removed the --check flag. Lock file regenerated by Poetry 2.3.3.
1 parent 03073b4 commit 266d2d1

5 files changed

Lines changed: 20 additions & 26 deletions

File tree

.github/workflows/validate-dependencies.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818

1919
- name: Install Poetry and dependencies
2020
run: |
21-
pip install poetry==2.2.1 toml
21+
pip install poetry==2.3.3 tomli
2222
2323
# Option 1: Poetry lock file validation
2424
- name: Check pyproject.toml validity

.pre-commit-config.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/python-poetry/poetry
3-
rev: '1.8.0'
3+
rev: '2.3.3'
44
hooks:
55
- id: poetry-check
66
name: Validate pyproject.toml
@@ -9,7 +9,6 @@ repos:
99
- id: poetry-lock
1010
name: Check poetry.lock is up to date
1111
description: Verify lock file matches pyproject.toml
12-
args: ['--check']
1312

1413
- repo: local
1514
hooks:
@@ -18,6 +17,6 @@ repos:
1817
description: Check that package names match their directory structure
1918
entry: python scripts/validation/validate_packages.py
2019
language: python
21-
additional_dependencies: ['toml']
20+
additional_dependencies: ['tomli']
2221
pass_filenames: false
2322
files: '^(pyproject\.toml|poetry\.lock|packages/.*/pyproject\.toml)$'

poetry.lock

Lines changed: 11 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ ruff = ">=0.15,<1.0"
6363
mypy = "^1.19"
6464
import-linter = "^2.11"
6565
pre-commit = "^4.5"
66-
toml = "^0.10"
66+
tomli = "^2.0"
6767

6868
[tool.poetry.group.docs.dependencies]
6969
sphinx = "^8.1"
@@ -74,7 +74,7 @@ sphinx-copybutton = "^0.5"
7474
sphinx-llms-txt = "^0.7"
7575

7676
[build-system]
77-
requires = ["poetry-core>=1.0.0"]
77+
requires = ["poetry-core>=2.0.0"]
7878
build-backend = "poetry.core.masonry.api"
7979

8080
[tool.pytest.ini_options]

scripts/validation/validate_packages.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
from pathlib import Path
1414

1515
try:
16-
import toml
16+
import tomli
1717
except ImportError:
18-
print("ERROR: toml library not found. Install with: pip install toml")
18+
print("ERROR: tomli library not found. Install with: pip install tomli")
1919
sys.exit(1)
2020

2121

@@ -57,7 +57,7 @@ def check_name_path_consistency():
5757

5858
print("\n[1/2] Checking name/path consistency...")
5959

60-
root_config = toml.load('pyproject.toml')
60+
root_config = tomli.load(open('pyproject.toml', 'rb'))
6161
dependencies = root_config.get('tool', {}).get('poetry', {}).get('dependencies', {})
6262

6363
for pkg_name, config in dependencies.items():
@@ -79,7 +79,7 @@ def check_name_path_consistency():
7979
continue
8080

8181
# Verify package name matches
82-
pkg_config = toml.load(pkg_toml_path)
82+
pkg_config = tomli.load(open(pkg_toml_path, 'rb'))
8383

8484
# Try PEP 621 format first ([project] section)
8585
actual_name = pkg_config.get('project', {}).get('name')

0 commit comments

Comments
 (0)