From 4bdae41154b6b7f2ce09de086214d841ad129870 Mon Sep 17 00:00:00 2001 From: Samuel FORESTIER Date: Sat, 1 Nov 2025 11:39:40 +0100 Subject: [PATCH 1/3] Drop support for Python 3.6 (EOL since 2022) --- .github/workflows/ci.yaml | 11 ++++------- .pre-commit-config.yaml | 2 +- README.md | 2 +- docs/index.rst | 4 ++-- setup.cfg | 3 +-- tox.ini | 2 +- 6 files changed, 10 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index c2da761f..9df3e037 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -32,21 +32,18 @@ jobs: os: - "ubuntu-latest" python: - - "3.7" - "3.8" - "3.9" - "3.10" - "3.11" - "3.12" include: - - os: "ubuntu-20.04" - python: "3.6" - - os: "ubuntu-20.04" - python: "pypy-3.6" + - os: "ubuntu-22.04" + python: "3.7" - os: "ubuntu-22.04" python: "pypy-3.10" - - os: "macos-12" - python: 3.12 + - os: "macos-latest" + python: "3.12" steps: - uses: actions/checkout@v4 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 95cbb415..6944e436 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,7 +3,7 @@ repos: rev: 22.3.0 hooks: - id: black - args: ["--target-version", "py36"] + args: ["--target-version", "py37"] - repo: https://github.com/PyCQA/flake8 rev: 6.1.0 hooks: diff --git a/README.md b/README.md index 6f39d373..83ee3db5 100644 --- a/README.md +++ b/README.md @@ -109,7 +109,7 @@ namely from these data sources (from high to low precedence): ## Python and Distribution Support -`distro` is supported and tested on Python 3.6+ and PyPy and on any +`distro` is supported and tested on Python 3.7+ and PyPy and on any distribution that provides one or more of the data sources covered. This package is tested with test data that mimics the exact behavior of the data sources of [a number of Linux distributions](https://github.com/python-distro/distro/tree/master/tests/resources/distros). diff --git a/docs/index.rst b/docs/index.rst index d320e668..fcf64312 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -19,11 +19,11 @@ If you want to jump into the API description right away, read about the Compatibility ============= -The ``distro`` package is supported on Python 3.6+ and PyPy, and on any Linux +The ``distro`` package is supported on Python 3.7+ and PyPy, and on any Linux or BSD distribution that provides one or more of the `data sources`_ used by this package. -This package is tested on Python 3.6+ and PyPy, with test data that mimics the +This package is tested on Python 3.7+ and PyPy, with test data that mimics the exact behavior of the data sources of `a number of Linux distributions `_. diff --git a/setup.cfg b/setup.cfg index 6f694f0c..877af10f 100644 --- a/setup.cfg +++ b/setup.cfg @@ -21,7 +21,6 @@ classifiers = Operating System :: POSIX :: BSD :: OpenBSD Programming Language :: Python :: 3 Programming Language :: Python :: 3 :: Only - Programming Language :: Python :: 3.6 Programming Language :: Python :: 3.7 Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 @@ -35,7 +34,7 @@ classifiers = package_dir = = src packages = distro -python_requires = >=3.6 +python_requires = >=3.7 [options.package_data] * = py.typed diff --git a/tox.ini b/tox.ini index bc1e8d68..9848233d 100644 --- a/tox.ini +++ b/tox.ini @@ -14,7 +14,7 @@ [tox] minversion = 1.9 -envlist = lint, py{36,37,38,39,310,311,312,py3} +envlist = lint, py{37,38,39,310,311,312,py3} isolated_build = true skip_missing_interpreters = true From 09ec373379dd23b525f909fa0ad238bed32f4972 Mon Sep 17 00:00:00 2001 From: Samuel FORESTIER Date: Sat, 1 Nov 2025 11:47:21 +0100 Subject: [PATCH 2/3] Bumps black to v25.9.0 and mypy to v1.18.2 --- .pre-commit-config.yaml | 4 ++-- src/distro/distro.py | 2 +- tests/test_distro.py | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6944e436..e2f1dcf0 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/psf/black - rev: 22.3.0 + rev: 25.9.0 hooks: - id: black args: ["--target-version", "py37"] @@ -13,7 +13,7 @@ repos: hooks: - id: isort - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.910 + rev: v1.18.2 hooks: - id: mypy args: ["--strict"] diff --git a/src/distro/distro.py b/src/distro/distro.py index 8c1e9d5d..14b8a075 100755 --- a/src/distro/distro.py +++ b/src/distro/distro.py @@ -53,7 +53,7 @@ from typing import TypedDict except ImportError: # Python 3.7 - TypedDict = dict + TypedDict = dict # type: ignore[assignment] __version__ = "1.9.0" diff --git a/tests/test_distro.py b/tests/test_distro.py index c08badc4..a886c7eb 100644 --- a/tests/test_distro.py +++ b/tests/test_distro.py @@ -2241,16 +2241,16 @@ def test_kv_21_single_quoted_word_with_double_quote(self) -> None: def test_kv_22_quoted_unicode_wordchar(self) -> None: # "wordchar" means it is in the shlex.wordchars variable. - props = self._get_props('KEY="wordchar: \u00CA (E accent grave)"\n') - assert props.get("key", None) == "wordchar: \u00CA (E accent grave)" + props = self._get_props('KEY="wordchar: \u00ca (E accent grave)"\n') + assert props.get("key", None) == "wordchar: \u00ca (E accent grave)" def test_kv_23_quoted_unicode_non_wordchar(self) -> None: # "non-wordchar" means it is not in the shlex.wordchars variable. props = self._get_props( - 'KEY="non-wordchar: \u00A1 (inverted exclamation mark)"\n' + 'KEY="non-wordchar: \u00a1 (inverted exclamation mark)"\n' ) assert ( - props.get("key", None) == "non-wordchar: \u00A1 (inverted exclamation mark)" + props.get("key", None) == "non-wordchar: \u00a1 (inverted exclamation mark)" ) def test_kv_24_double_quoted_entire_single_quoted_word(self) -> None: From 0c0689ee7cfeca33ec5b8bbdcbce9db4c7088c5b Mon Sep 17 00:00:00 2001 From: Samuel FORESTIER Date: Sat, 1 Nov 2025 11:39:07 +0100 Subject: [PATCH 3/3] Actions(deps): Bump "actions/*" to latest revisions --- .github/workflows/ci.yaml | 12 ++++++------ .github/workflows/deploy.yml | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 9df3e037..35ac9671 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -10,10 +10,10 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Set up Python - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: 3.x @@ -46,10 +46,10 @@ jobs: python: "3.12" steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Set up Python ${{ matrix.python }} - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: ${{ matrix.python }} @@ -69,12 +69,12 @@ jobs: runs-on: windows-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - uses: codecov/codecov-action@v3 - name: Set up Python - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: 3.x diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 120db2f8..efcfa6de 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -12,10 +12,10 @@ jobs: runs-on: ubuntu-latest environment: Deploy steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 with: ref: ${{ github.event.inputs.tag }} - - uses: actions/setup-python@v5 + - uses: actions/setup-python@v6 with: python-version: 3.x - shell: bash