Skip to content

Commit

Permalink
drop compatibility with python3.7 (reached end of life on 2023-06-27)
Browse files Browse the repository at this point in the history
  • Loading branch information
fphammerle committed Jul 14, 2023
1 parent cc5555b commit 4ebe0aa
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 131 deletions.
1 change: 0 additions & 1 deletion .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ jobs:
strategy:
matrix:
python-version:
- '3.7'
- '3.8'
- '3.9'
- '3.10'
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Removed
- compatibility with `python3.7`

## [1.0.0] - 2022-05-12
### Added
Expand Down
22 changes: 0 additions & 22 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,33 +14,11 @@ pylint-import-requirements = "*"
pytest = "*"
pytest-cov = "*"

# python3.7 compatibility
# https://github.com/PyCQA/isort/commit/47cedf3583f338e8ce9c906fc95c9fee6c57404d
isort = "<5.12"
# python3.10 compatibility
# > File "[...]/lib/python3.10/site-packages/mypy/main.py", line 11, in <module>
# > from typing_extensions import Final, NoReturn
# > ModuleNotFoundError: No module named 'typing_extensions'
typing-extensions = "*"
# mypy on python<3.8
typed-ast = {markers = "python_version < '3.8'"}
# > File "[...]/lib/python3.10/site-packages/_pytest/_code/code.py", line 60, in <module>
# > from exceptiongroup import BaseExceptionGroup
# > ModuleNotFoundError: No module named 'exceptiongroup'
exceptiongroup = {markers = "python_version < '3.11'"}
# > File "[...]/lib/python3.10/site-packages/_pytest/config/findpaths.py", line 71, in load_config_dict_from_file
# > import tomli as tomllib
# > ModuleNotFoundError: No module named 'tomli'
tomli = {markers = "python_version < '3.11'"}
# > File "[...]/lib/python3.10/site-packages/astroid/decorators.py", line 16, in <module>
# > import wrapt
# > ModuleNotFoundError: No module named 'wrapt'
wrapt = "*"
# remove `"markers": "python_version >= '3.11'"` to workaround:
# > File "[...]/lib/python3.7/site-packages/pylint/lint/parallel.py", line 13, in <module>
# > import dill
# > ModuleNotFoundError: No module named 'dill'
dill = {markers = "python_version >= '0'"}

[requires]
python_version = "3"
Expand Down
147 changes: 44 additions & 103 deletions Pipfile.lock

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

3 changes: 1 addition & 2 deletions free_disk/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ def _data_size_to_bytes(size_with_unit: str) -> int:
match = re.match(r"^([\d\.]+)\s*([A-Za-z]+)?$", size_with_unit)
if not match:
raise ValueError(f"Unable to parse data size {size_with_unit!r}")
unit_symbol = match.group(2)
if unit_symbol:
if unit_symbol := match.group(2):
try:
byte_conversion_factor = _DATA_SIZE_UNIT_BYTE_CONVERSION_FACTOR[unit_symbol]
except KeyError as exc:
Expand Down
5 changes: 2 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
"License :: OSI Approved :: MIT License",
"Operating System :: POSIX",
# .github/workflows/python.yml
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
Expand All @@ -43,8 +42,8 @@
},
# >=3.5 pathlib.Path.read_text()
# >=3.6 f-strings
# <3.7 untested
python_requires=">=3.7",
# >=3.8 walrus operator
python_requires=">=3.8",
install_requires=[],
setup_requires=["setuptools_scm"],
tests_require=["pytest"],
Expand Down

0 comments on commit 4ebe0aa

Please sign in to comment.