Skip to content

Commit

Permalink
fix py37 statement
Browse files Browse the repository at this point in the history
  • Loading branch information
linshokaku committed Feb 20, 2024
1 parent e4756e2 commit b666cc7
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 22 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ enable_isort = true
enable_mypy = true
mypy_preset = "strict"
line_length = 88
py_version = "py37"
py_version = "py38"
[[tool.pysen.lint.mypy_targets]]
paths = ["."]
```
Expand Down Expand Up @@ -215,7 +215,7 @@ enable_isort = true
enable_mypy = true
mypy_preset = "strict"
line_length = 88
py_version = "py37"
py_version = "py38"
isort_known_third_party = ["numpy"]
isort_known_first_party = ["pysen"]
mypy_ignore_packages = ["pysen.generated.*"]
Expand Down
2 changes: 1 addition & 1 deletion examples/simple_package/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ enable_black = true
enable_mypy = true
mypy_preset = "strict"
line_length = 100
py_version = "py37"
py_version = "py38"

[[tool.pysen.lint.mypy_targets]]
paths = ["."]
2 changes: 1 addition & 1 deletion examples/sync_cmdclass_pyproject/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ enable_black = true
enable_mypy = true
mypy_preset = "strict"
line_length = 100
py_version = "py37"
py_version = "py38"

[[tool.pysen.lint.mypy_targets]]
paths = ["."]
2 changes: 1 addition & 1 deletion tests/fakes/configs/base.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
base = "base2.toml"
enable_isort = true
line_length = 88
py_version = "py37"
py_version = "py38"
isort_known_third_party = ["fuga", "piyo"]
isort_known_first_party = ["foo"]

Expand Down
2 changes: 1 addition & 1 deletion tests/fakes/configs/example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ enable_isort = true
enable_mypy = true
mypy_preset = "strict"
line_length = 88
py_version = "py37"
py_version = "8"
isort_known_first_party = ["alpha"]
isort_known_third_party = ["beta", "gamma"]
mypy_ignore_packages = ["pysen.stubs", "pysen.proto"]
Expand Down
2 changes: 1 addition & 1 deletion tests/fakes/configs/non_pysen_config.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[tool.nonpysen]
line-length = 100
target-version = ["py37"]
target-version = ["py38"]
26 changes: 13 additions & 13 deletions tests/test_py_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,24 @@


def test_python_version() -> None:
py37 = PythonVersion(3, 7)
py38 = PythonVersion(3, 8)

assert py37 == PythonVersion(3, 7)
assert py37 != PythonVersion(3, 8)
assert py38 == PythonVersion(3, 8)
assert py38 != PythonVersion(3, 9)

assert py37.version == "3.7"
assert py37.full_representation == "Python3.7"
assert py37.short_representation == "py37"
assert py38.version == "3.8"
assert py38.full_representation == "Python3.8"
assert py38.short_representation == "py38"

py378 = PythonVersion(3, 7, 8)
py388 = PythonVersion(3, 8, 8)

assert py378 == PythonVersion(3, 7, 8)
assert py378 != PythonVersion(3, 7, 9)
assert py378 != py37
assert py388 == PythonVersion(3, 8, 8)
assert py388 != PythonVersion(3, 8, 9)
assert py388 != py38

assert py378.version == "3.7.8"
assert py378.full_representation == "Python3.7.8"
assert py378.short_representation == "py37"
assert py388.version == "3.8.8"
assert py388.full_representation == "Python3.8.8"
assert py388.short_representation == "py38"


def test_version_ops() -> None:
Expand Down
4 changes: 2 additions & 2 deletions tests/test_pyproject_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,15 +138,15 @@ def test__parse_source() -> None:


def test__parse_python_version() -> None:
assert _parse_python_version("py37") == PythonVersion(3, 7)
assert _parse_python_version("py38") == PythonVersion(3, 8)
assert _parse_python_version("PY38") == PythonVersion(3, 8)
with pytest.raises(dacite.DaciteError) as ex:
_parse_python_version("PY999")

assert "one of" in str(ex.value) # ensure that we suggest some options

with pytest.raises(dacite.WrongTypeError):
_parse_python_version(37)
_parse_python_version(38)


def test__parse_mypy_target() -> None:
Expand Down

0 comments on commit b666cc7

Please sign in to comment.