Skip to content

Commit dc08b28

Browse files
author
Maciej Rapacz
committed
Ensure versions in pyproject.toml and __version__ match
1 parent fd879e8 commit dc08b28

4 files changed

Lines changed: 35 additions & 10 deletions

File tree

.pre-commit-config.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,24 @@ repos:
33
rev: v1.7.5
44
hooks:
55
- id: docformatter
6-
args: ['--pre-summary-newline', '--wrap-summaries', '132', '--wrap-descriptions', '132', --in-place]
6+
args: ["--pre-summary-newline", "--wrap-summaries", "132", "--wrap-descriptions", "132", --in-place]
77

88
- repo: https://github.com/pycqa/pydocstyle
99
rev: 6.3.0
1010
hooks:
1111
- id: pydocstyle
12-
args: ['--convention', 'pep257', '--add-ignore', 'D100, D107, D104, D105']
13-
exclude: '^(tests/|setup.py|ntgen/__main__.py)'
12+
args: ["--convention", "pep257", "--add-ignore", "D100, D107, D104, D105"]
13+
exclude: "^(tests/|setup.py|ntgen/__main__.py)"
1414

1515
- repo: https://github.com/pre-commit/pre-commit-hooks
1616
rev: v4.5.0
1717
hooks:
1818
- id: check-json
1919
- id: pretty-format-json
20-
exclude: '^acceptance'
20+
exclude: "^acceptance"
2121
- id: check-merge-conflict
2222
- id: end-of-file-fixer
23-
exclude: '^acceptance'
23+
exclude: "^acceptance"
2424
- id: requirements-txt-fixer
2525
- id: trailing-whitespace
2626

@@ -29,7 +29,7 @@ repos:
2929
hooks:
3030
- id: black
3131
language_version: python3.8
32-
args: ['--line-length', '131']
32+
args: ["--line-length", "131"]
3333

3434
- repo: https://github.com/asottile/reorder_python_imports
3535
rev: v3.12.0
@@ -41,7 +41,7 @@ repos:
4141
rev: 7.0.0
4242
hooks:
4343
- id: flake8
44-
args: [ '--ignore', 'E231', '--ignore', 'W503', '--max-line-length', '131' ]
44+
args: ["--ignore", "E231", "--ignore", "W503", "--max-line-length", "131"]
4545

4646
- repo: https://github.com/asottile/pyupgrade
4747
rev: v3.15.1
@@ -53,7 +53,7 @@ repos:
5353
rev: v1.9.0
5454
hooks:
5555
- id: mypy
56-
exclude: '^tests/$'
56+
exclude: "^tests/"
5757
- repo: https://github.com/pre-commit/pygrep-hooks
5858
rev: v1.10.0
5959
hooks:

poetry.lock

Lines changed: 12 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "disjoint-set"
3-
version = "0.7.4"
3+
version = "0.8.0"
44
description = "Disjoint Set data structure implementation for Python"
55
authors = ["Maciej Rapacz <mmrapacz@protonmail.ch>"]
66
license = "MIT"
@@ -16,6 +16,7 @@ mypy = "^1.9.0"
1616
tox = "^4.14.1"
1717
twine = "^5.0.0"
1818
pre-commit = "3.5.0"
19+
toml = "^0.10.2"
1920

2021
[build-system]
2122
requires = ["poetry-core"]

tests/test_versions_match.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
from pathlib import Path
2+
3+
import toml
4+
5+
import disjoint_set
6+
7+
8+
def parse_pyproject_for_version() -> str:
9+
return toml.loads(Path("pyproject.toml").read_text())["tool"]["poetry"]["version"]
10+
11+
12+
def test_versions_match():
13+
assert disjoint_set.__version__ == parse_pyproject_for_version()

0 commit comments

Comments
 (0)