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 6231bf7
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 49 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,22 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Python
id: set-python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.7" # don't forget to update cache key below
python-version: "3.9" # don't forget to update cache key below

- name: Cache pip dependencies
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-3.7-pip-${{ hashFiles('**/poetry.lock') }}
key: ${{ runner.os }}-3.9-pip-${{ hashFiles('**/poetry.lock') }}

- name: Cache pre-commit dependencies
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.cache/pre-commit
key: ${{ runner.os }}-pre-commit-${{ hashFiles('**/.pre-commit-config.yaml') }}-${{ hashFiles('**/tox.ini') }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@master
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@master
uses: actions/setup-python@v5
with:
python-version: "3.8"
python-version: "3.9"

- name: Build and Publish package
env:
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,24 @@ jobs:
strategy:
max-parallel: 4
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
python-version: ['3.9', '3.10', '3.11', '3.12']

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Cache pip dependencies
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-${{ matrix.python-version }}-pip-${{ hashFiles('**/poetry.lock') }}

- name: Cache pre-commit dependencies
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.cache/pre-commit
key: ${{ runner.os }}-${{ matrix.python-version }}-pre-commit-${{ hashFiles('**/.pre-commit-config.yaml') }}-${{ hashFiles('**/tox.ini') }}
Expand All @@ -52,7 +52,7 @@ jobs:
tox -e coverage -- --fail-under=99
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./test-reports/coverage.xml
Expand Down
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 6231bf7

Please sign in to comment.