Skip to content

Commit

Permalink
Drop py37 and py38 support
Browse files Browse the repository at this point in the history
  • Loading branch information
unmade committed Oct 20, 2024
1 parent be6b32c commit bb69899
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 34 deletions.
2 changes: 1 addition & 1 deletion mypy.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[mypy]
python_version = 3.7
python_version = 3.9
warn_return_any = True
warn_redundant_casts = True
warn_unused_configs = True
Expand Down
17 changes: 6 additions & 11 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@ packages = [
{ include = "thriftpyi", from = "src" },
]
classifiers = [
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Topic :: Software Development :: Code Generators",
Expand All @@ -24,22 +23,18 @@ classifiers = [
thriftpyi = "thriftpyi.cli:main"

[tool.poetry.dependencies]
python = "^3.7"
astunparse = {version = "^1.6.3", python = "< 3.9.0" }
python = "^3.9"
autoflake = "*"
black = "*"
thriftpy2 = "^0.4.2"

[tool.poetry.dev-dependencies]
tox = "^3.24"
pre-commit = "^2.20"
mypy = "^0.971"
pylint = [
{version = ">=2.13.9,<2.14.0", python = ">= 3.7.0, < 3.7.2"},
{version = "^2.15", python = ">= 3.7.2, < 4.0.0"},
]
pytest = "^7.1.2"
pytest-cov = "^3.0.0"
mypy = "^1.12"
pylint = "^3.3"
pytest = "^8.3"
pytest-cov = "^5.0"


[build-system]
Expand Down
10 changes: 0 additions & 10 deletions src/thriftpyi/compat.py

This file was deleted.

4 changes: 2 additions & 2 deletions src/thriftpyi/entities.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def as_ast(

return ast.ClassDef(
name=self.name,
bases=[[ast.Name(id=base, ctx=ast.Load())] for base in bases],
bases=[ast.Name(id=base, ctx=ast.Load()) for base in bases],
keywords=[],
body=body,
decorator_list=[
Expand Down Expand Up @@ -117,7 +117,7 @@ def as_ast(self) -> AnyFunctionDef:

return factory(
name=self.name,
args=ast.arguments(
args=ast.arguments( # type: ignore[call-overload]
posonlyargs=[],
args=[
ast.arg(arg="self", annotation=None),
Expand Down
6 changes: 3 additions & 3 deletions src/thriftpyi/main.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
from __future__ import annotations

import ast
import subprocess
import sys
from pathlib import Path

import thriftpy2

from thriftpyi import files, stubs
from thriftpyi.compat import ast_unparse
from thriftpyi.proxies import TModuleProxy


Expand All @@ -22,7 +22,7 @@ def thriftpyi( # pylint: disable=too-many-locals
interfaces = files.list_interfaces(interfaces_dir)

stub = stubs.build_init(path.stem for path in interfaces)
files.save(ast_unparse(stub), to=output_dir / "__init__.pyi")
files.save(ast.unparse(stub), to=output_dir / "__init__.pyi")

for path in interfaces:
tmodule = thriftpy2.load(str(path))
Expand All @@ -33,7 +33,7 @@ def thriftpyi( # pylint: disable=too-many-locals
strict_fields=strict_fields,
strict_methods=strict_methods,
)
files.save(ast_unparse(stub), to=output_dir / path.with_suffix(".pyi").name)
files.save(ast.unparse(stub), to=output_dir / path.with_suffix(".pyi").name)

lint(output_dir)

Expand Down
14 changes: 7 additions & 7 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ skip_missing_interpreters = true
envlist =
clean
lint
{py37,py38,py39,py310}
{py39,py310,py311,py312}
coverage

[tox:.package]
Expand All @@ -17,17 +17,17 @@ setenv =
PYTHONUNBUFFERED=yes
usedevelop = false
deps =
pytest<7.3
pytest-cov<4.1
pytest>=8.3,<9
pytest-cov>=5,<6
commands =
{posargs:pytest -vvv --cov tests}

[testenv:lint]
deps =
pre-commit<2.21
pylint<2.16
pytest<7.3
mypy
pylint>=3.3,<4
pytest>=8,<9
mypy>=1.12,<2
commands = pre-commit run --all-files {posargs}

[testenv:coverage]
Expand All @@ -41,7 +41,7 @@ commands =
coverage report {posargs:--fail-under=100}
coverage xml -o {toxinidir}/test-reports/coverage.xml
depends =
{py37,py38,py39,py310}
{py39,py310,py311,py312}

[testenv:clean]
commands = coverage erase
Expand Down

0 comments on commit bb69899

Please sign in to comment.