From c9601994b96b9a977b31e21ff9a5e6717e5e3ffe Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Thu, 3 Oct 2024 16:54:48 +0300 Subject: [PATCH] Drop support for Python 3.8 (#207) * Bump GitHub Actions * Drop support for Python 3.8 * Allow testing feature branches --- .github/workflows/build.yml | 8 +------- .github/workflows/publish.yml | 4 ++-- pyperf/tests/test_misc.py | 6 +----- pyperf/tests/test_runner.py | 10 ++-------- pyproject.toml | 3 +-- 5 files changed, 7 insertions(+), 24 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ffce66ef..1ab31b5a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,9 +2,7 @@ name: Build on: push: - branches: [main] pull_request: - branches: [main] jobs: tox-jobs: @@ -33,10 +31,6 @@ jobs: python: 'pypy3.10' - os: ubuntu-latest python: 'pypy3.9' - - os: ubuntu-latest - python: 'pypy3.8' - - os: ubuntu-latest - python: '3.8' - os: ubuntu-latest python: '3.9' - os: ubuntu-latest @@ -57,7 +51,7 @@ jobs: with: python-version: ${{ matrix.python }} - name: Set up Python ${{ matrix.python }} using deadsnakes - uses: deadsnakes/action@v3.1.0 + uses: deadsnakes/action@v3.2.0 if: ${{ matrix.build == 'free-threading' }} with: python-version: ${{ matrix.python }} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index ab0fa635..4da8f261 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -13,9 +13,9 @@ jobs: id-token: write steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: '3.x' cache: pip diff --git a/pyperf/tests/test_misc.py b/pyperf/tests/test_misc.py index 2f8c5952..94981b38 100644 --- a/pyperf/tests/test_misc.py +++ b/pyperf/tests/test_misc.py @@ -67,11 +67,7 @@ def test_parse_run_list(self): self.assertRaises(ValueError, parse_run_list, '1,') def test_setup_version(self): - try: - from importlib.metadata import version - except ModuleNotFoundError: - # Workaround for Python 3.7 - from importlib_metadata import version + from importlib.metadata import version self.assertEqual(pyperf.__version__, version("pyperf")) diff --git a/pyperf/tests/test_runner.py b/pyperf/tests/test_runner.py index 154c220b..1fa1594f 100644 --- a/pyperf/tests/test_runner.py +++ b/pyperf/tests/test_runner.py @@ -97,10 +97,7 @@ def time_func(loops): try: s = pstats.Stats(name) - if sys.version_info < (3, 9): - assert len(s.stats) - else: - assert len(s.get_stats_profile().func_profiles) + assert len(s.get_stats_profile().func_profiles) finally: if os.path.isfile(name): os.unlink(name) @@ -123,10 +120,7 @@ def func(): try: import pstats s = pstats.Stats(name) - if sys.version_info < (3, 9): - assert len(s.stats) - else: - assert len(s.get_stats_profile().func_profiles) + assert len(s.get_stats_profile().func_profiles) finally: if os.path.isfile(name): os.unlink(name) diff --git a/pyproject.toml b/pyproject.toml index 892b4260..91f87738 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -44,13 +44,12 @@ classifiers = [ "Programming Language :: Python :: 3", "Topic :: Software Development :: Libraries :: Python Modules" ] -requires-python = ">=3.7" +requires-python = ">=3.9" dependencies = ["psutil>=5.9.0"] [project.optional-dependencies] dev = [ 'tox', - 'importlib-metadata; python_version < "3.8"' ] [project.scripts]