Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .mise.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[tools]
pdm = "2.25"
python = ["3.12", "3.13", "3.11", "3.10", "3.9"]
python = ["3.12", "3.13", "3.14", "3.11", "3.10", "3.9"]
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
default_language_version:
python: python3.11
python: python3.12
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
rev: v6.0.0
hooks:
- id: check-toml
- id: trailing-whitespace
Expand Down Expand Up @@ -32,7 +32,7 @@ repos:
- id: tox-ini-fmt

- repo: https://github.com/tox-dev/pyproject-fmt
rev: "v2.5.0"
rev: "v2.10.0"
hooks:
- id: pyproject-fmt
additional_dependencies: ["tox>=4.14.1"]
Expand All @@ -54,6 +54,6 @@ repos:
- id: ruff-format

- repo: https://github.com/pdm-project/pdm
rev: 2.26.0
rev: 2.25.1
Comment thread
GabDug marked this conversation as resolved.
hooks:
- id: pdm-lock-check
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ PDM and Poetry plugin to sync your pre-commit versions with your lockfile and au

## Supported versions

- Python 3.9+ to 3.13+
- PDM 2.7.4 to 2.25+
- Python 3.9+ to 3.14+
- PDM 2.7.4 to 2.26+
- Python 3.12.7+ requires PDM 2.20.1+
- Poetry 1.6 to 2.1+
- Poetry 1.6 to 2.2+
- uv (lock version 1)

> ℹ️ While we only test these versions, it should work with more recent versions.
Expand Down Expand Up @@ -160,7 +160,7 @@ You can also add a pre-commit hook to sync your lock file before committing, by
```yaml
repos:
- repo: https://github.com/GabDug/sync-pre-commit-lock
rev: v0.7.3 # Use the latest tag
rev: v0.7.3 # Use the latest tag
hooks: # Choose the one matching your package manager
- id: sync-pre-commit-pdm
- id: sync-pre-commit-poetry
Expand Down Expand Up @@ -215,20 +215,20 @@ Feel free to open an issue or a PR if you have any idea, or if you want to help!

### Features or fixes

- [x] Support automatic repository URL update (from legacy aliased repositories)
- [x] Expose a pre-commit hook to sync the lockfile
- [x] Support nested `additional_dependencies`, (i.e. mypy types)
- [x] Support hooks URL aliases for the same Python package
- [ ] Support user configuration of aliases
- [ ] Support `pdm config` and clear configuration precedence
- [ ] Create a more verbose command
- [ ] Add support for other lockfiles / project managers (pipenv, flit, hatch, etc.)
- [x] Expose a pre-commit hook to sync the lockfile
- [x] Support nested `additional_dependencies`, (i.e. mypy types)
- [ ] Support reading DB from a Python module?
- [ ] Support reordering DB inputs (file/global config/python module/cli)?
- [ ] Test using SSH/file dependencies?
- [ ] Check ref existence before writing?
- [ ] New feature to convert from pre-commit online to local?
- [ ] Warning if pre-commit CI auto update is also set?
- [x] Support automatic repository URL update (from legacy aliased repositories)

## Inspiration

Expand Down
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ license = { file = "LICENSE" }
authors = [ { name = "Gabriel Dugny", email = "sync-pre-commit-lock@dugny.me" } ]
requires-python = ">=3.9"
classifiers = [
"Development Status :: 3 - Alpha",
"Development Status :: 4 - Beta",
"Environment :: Console",
"Environment :: Plugins",
"Intended Audience :: Developers",
Expand All @@ -25,6 +25,7 @@ classifiers = [
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Typing :: Typed",
]
dynamic = [
Expand Down Expand Up @@ -100,7 +101,7 @@ lint.extend-select = [ "D202", "D209", "EM101", "I001", "PTH", "PYI", "Q000", "R
lint.extend-ignore = [ "S101" ]

[tool.pyproject-fmt]
max_supported_python = "3.13"
max_supported_python = "3.14"

[tool.pytest.ini_options]
minversion = "7.0"
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/uv_project/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[project]
classifiers = [
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
Comment thread
GabDug marked this conversation as resolved.
]
40 changes: 23 additions & 17 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,29 @@ requires =
env_list =
clean
report
py{313, 312}-pdm{225, 224, 223, 222, 221, 220, HEAD}
py{311, 310, 39}-pdm{225, 224, 223, 222, 221, 220, 219, 218, 217, 216, 215, 214, 213, 212, 211, 210, 29, 28, 27, HEAD}
py{313, 312, 311, 310, 39}-poetry{21, 20, 18, 17, 16, HEAD}
py{314}-pdm{226, HEAD}
py{313, 312}-pdm{226, 225, 224, 223, 222, 221, 220, HEAD}
py{311, 310, 39}-pdm{226, 225, 224, 223, 222, 221, 220, 219, 218, 217, 216, 215, 214, 213, 212, 211, 210, 29, 28, 27, HEAD}
py{313, 312, 311, 310, 39}-poetry{22, 21, 20, 18, 17, 16, HEAD}
py{314}-poetry{22, 18, HEAD}

[testenv]
set_env =
py{312,313}-pdm{220,221,222,223,225, 224,HEAD}: COVERAGE_FILE = .coverage.{envname}
py{39,310,311,312,313}-poetry{21, 20, 18, 17, 16, HEAD}: COVERAGE_FILE = .coverage.{envname}
py{39,310,311}-pdm{27,28,29,210,211,212,213,214,215,216,217,218,219,220,221,222,223,225, 224,HEAD}: COVERAGE_FILE = .coverage.{envname}
py{312,313}-pdm{220,221,222,223,226, 225, 224, 226,HEAD}: COVERAGE_FILE = .coverage.{envname}
py{314}-pdm{224,HEAD}: COVERAGE_FILE = .coverage.{envname}
py{39,310,311,312,313,314}-poetry{22, 21, 20, 18, 17, 16, HEAD}: COVERAGE_FILE = .coverage.{envname}
py{39,310,311}-pdm{27,28,29,210,211,212,213,214,215,216,217,218,219,220,221,222,223,226, 225, 224,HEAD}: COVERAGE_FILE = .coverage.{envname}
commands =
pytest --cov --cov-append --cov-report=term-missing {posargs:-vv} --cov-config=pyproject.toml
allowlist_externals =
coverage
pdm
pytest
depends =
report: py{313, 312, 311, 310, 39}-pdm{225, 224, 223, 222, 221, 220, 219, 218, 217, 216, 215, 214, 213, 212, 211, 210, 29, 28, 27, HEAD}
report: py{313, 312, 311, 310, 39}-poetry{21, 20, 18, 17, 16, HEAD}
py{313, 312, 311, 310, 39}-pdm{225, 224, 223, 222, 221, 220, 219, 218, 217, 216, 215, 214, 213, 212, 211, 210, 29, 28, 27, HEAD}: clean
py{313, 312, 311, 310, 39}-poetry{21, 20, 18, 17, 16, HEAD}: clean
report: py{314, 313, 312, 311, 310, 39}-pdm{226, 225, 224, 223, 222, 221, 220, 219, 218, 217, 216, 215, 214, 213, 212, 211, 210, 29, 28, 27, HEAD}
report: py{314, 313, 312, 311, 310, 39}-poetry{22, 21, 20, 18, 17, 16, HEAD}
py{314, 313, 312, 311, 310, 39}-pdm{226, 225, 224, 223, 222, 221, 220, 219, 218, 217, 216, 215, 214, 213, 212, 211, 210, 29, 28, 27, HEAD}: clean
py{314, 313, 312, 311, 310, 39}-poetry{22, 21, 20, 18, 17, 16, HEAD}: clean

[testenv:clean]
skip_install = true
Expand All @@ -43,7 +46,7 @@ commands =
coverage html
coverage xml

[testenv:py{39,310,311,312,313}-pdm{27,28,29,210,211,212,213,214,215,216,217,218,219,220,221,222,223,225,224,225,HEAD}]
[testenv:py{39,310,311,312,313,314}-pdm{27,28,29,210,211,212,213,214,215,216,217,218,219,220,221,222,223,225,224,225,226,HEAD}]
package = editable
deps =
-r requirements-tox.txt
Expand All @@ -67,12 +70,13 @@ deps =
pdm223: pdm<2.24,>=2.23
pdm224: pdm<2.25,>=2.24
pdm225: pdm<2.26,>=2.25
pdm226: pdm<2.27,>=2.26
pdm27: pdm<2.8,>=2.7
pdm28: pdm<2.9,>=2.8
pdm29: pdm<2.10,>=2.9
pdmHEAD: pdm@ git+https://github.com/pdm-project/pdm.git

[testenv:py{313,312, 311, 310, 39}-poetry{16, 17, 18, 20, 21,HEAD}]
[testenv:py{314,313,312, 311, 310, 39}-poetry{16, 17, 18, 20, 21, 22, HEAD}]
package = editable
deps =
-r requirements-tox.txt
Expand All @@ -81,13 +85,15 @@ deps =
poetry18: poetry<1.9,>=1.8
poetry20: poetry<2.1,>=2
poetry21: poetry<2.2,>=2.1
poetry22: poetry<2.3,>=2.2
poetryHEAD: poetry@ git+https://github.com/python-poetry/poetry.git

[gh]
python =
3.9= py39-pdm{27,28,29,210,211,212,213,214,215,216,217,218,219,220,221,222,223,225,224,HEAD},py39-poetry{21, 20, 18, 17, 16, HEAD}, report, clean
3.10= py310-pdm{27,28,29,210,211,212,213,214,215,216,217,218,219,220,221,222,223,225,224,HEAD}, py310-poetry{21, 20, 18, 17, 16, HEAD}, report, clean
3.11= py311-pdm{27,28,29,210,211,212,213,214,215,216,217,218,219,220,221,222,223,225,224,HEAD}, py311-poetry{21, 20, 18, 17, 16, HEAD}, report, clean
3.12= py312-pdm{220,221,222,223,225,224,HEAD}, py312-poetry{21, 20, 18, 17, 16, HEAD}, report, clean
3.13= py313-pdm{220,221,222,223,225,224,HEAD}, py313-poetry{21, 20, 18, 17, 16, HEAD}, report, clean
3.9= py39-pdm{27,28,29,210,211,212,213,214,215,216,217,218,219,220,221,222,223,225,224,HEAD},py39-poetry{22, 21, 20, 18, 17, 16, HEAD}, report, clean
3.10= py310-pdm{27,28,29,210,211,212,213,214,215,216,217,218,219,220,221,222,223,225,224,HEAD}, py310-poetry{22, 21, 20, 18, 17, 16, HEAD}, report, clean
3.11= py311-pdm{27,28,29,210,211,212,213,214,215,216,217,218,219,220,221,222,223,225,224,HEAD}, py311-poetry{22, 21, 20, 18, 17, 16, HEAD}, report, clean
3.12= py312-pdm{220,221,222,223,225,224,226,HEAD}, py312-poetry{22, 21, 20, 18, 17, 16, HEAD}, report, clean
3.13= py313-pdm{220,221,222,223,225,224,226,HEAD}, py313-poetry{22, 21, 20, 18, 17, 16, HEAD}, report, clean
3.14= py314-pdm{226,HEAD}, py314-poetry{22, 21, 20, 18, 17, 16, HEAD}, report, clean
Comment thread
GabDug marked this conversation as resolved.
Comment thread
GabDug marked this conversation as resolved.
fail_on_no_env = True
Loading