Skip to content

Commit

Permalink
pyproject.toml: update mypy to recent version
Browse files Browse the repository at this point in the history
Also update the scripts affected by the newer mypy.
  • Loading branch information
csernazs committed Apr 3, 2024
1 parent ef7153d commit 659ca7d
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 36 deletions.
63 changes: 34 additions & 29 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ requests = "^2.28.1"
Sphinx = ">=5.1.1,<8.0.0"
sphinx-rtd-theme = "^1.0.0"
reno = "^3.5.0"
mypy = "^0.971"
types-requests = "^2.28.9"
pytest = ">=7.1.3,<9.0.0"
pytest-cov = ">=3,<5"
Expand All @@ -52,6 +51,7 @@ types-toml = "^0.10.8"
toml = "^0.10.2"
black = ">=23.1,<25.0"
ruff = "^0.2.1"
mypy = "^1.9.0"


[tool.poetry.group.doc]
Expand All @@ -70,11 +70,11 @@ pytest = ">=7.1.3,<9.0.0"
pytest-cov = ">=3,<5"
coverage = ">=6.4.4,<8.0.0"
requests = "^2.28.1"
mypy = "^0.971"
types-requests = "^2.28.9"
pre-commit = ">=2.20,<4.0"
types-toml = "^0.10.8"
toml = "^0.10.2"
mypy = "^1.9.0"

[build-system]
requires = ["poetry-core>=1.0.0"]
Expand Down
2 changes: 1 addition & 1 deletion scripts/release.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def check_environment():
raise UsageError("No such binary: {}".format(binary))


def main():
def main() -> None:
parser = argparse.ArgumentParser()
parser.add_argument("new_version", help="Version to release")

Expand Down
14 changes: 10 additions & 4 deletions tests/test_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,13 @@ def version_to_tuple(version: str) -> tuple:
def test_no_duplicate_classifiers(build: Build, pyproject):
pyproject_meta = pyproject["tool"]["poetry"]
wheel_meta = build.wheel.get_meta(version=pyproject_meta["version"])
classifiers = sorted(wheel_meta.get_all("Classifier"))
unique_classifiers = sorted(set(wheel_meta.get_all("Classifier")))
classifiers = wheel_meta.get_all("Classifier")
assert classifiers is not None

assert classifiers == unique_classifiers
sorted_classifiers = sorted(classifiers)
unique_classifiers = sorted(set(classifiers))

assert sorted_classifiers == unique_classifiers


def test_python_version(build: Build, pyproject):
Expand All @@ -130,7 +133,10 @@ def test_python_version(build: Build, pyproject):

min_version_tuple = version_to_tuple(min_version)

for classifier in wheel_meta.get_all("Classifier"):
classifiers = wheel_meta.get_all("Classifier")
assert classifiers is not None

for classifier in classifiers:
if classifier.startswith("Programming Language :: Python ::"):
version_tuple = version_to_tuple(classifier.split("::")[-1].strip())
if len(version_tuple) > 1:
Expand Down

0 comments on commit 659ca7d

Please sign in to comment.