From 44995f59f4f9ffaa21d7b80b5b930dfa278d5246 Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Tue, 7 Oct 2025 02:45:04 +0200 Subject: [PATCH 01/12] migrate tox.ini configuration to pyproject.toml --- pyproject.toml | 16 ++++++++++++++++ tox.ini | 12 ------------ 2 files changed, 16 insertions(+), 12 deletions(-) delete mode 100644 tox.ini diff --git a/pyproject.toml b/pyproject.toml index 779dcb1..e92c380 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,3 +22,19 @@ python = "^3.9.0" [tool.poetry.dev-dependencies] pytest = "^3.8.2" + +[tool.tox] +legacy_tox_ini = """ +[tox] +# test on all supported Python versions, see also: +# - pyproject.toml: tool.poetry.dependencies +# - .github/workflows/ci.yml +# - README.rst +envlist = py{39,310,311,312} + +[testenv] +deps = + pytest + setuptools +commands= pytest -v -rs +""" diff --git a/tox.ini b/tox.ini deleted file mode 100644 index 35e0fa9..0000000 --- a/tox.ini +++ /dev/null @@ -1,12 +0,0 @@ -[tox] -# test on all supported Python versions, see also: -# - pyproject.toml: tool.poetry.dependencies -# - .github/workflows/ci.yml -# - README.rst -envlist = py{39,310,311,312} - -[testenv] -deps = - pytest - setuptools -commands= pytest -v -rs From 4cce2e237d50a5b512fc5c6ba245f6042999dfb0 Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Tue, 7 Oct 2025 02:47:01 +0200 Subject: [PATCH 02/12] CI: test on Python 3.13 --- .github/workflows/ci.yml | 3 +++ README.rst | 2 +- pyproject.toml | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2a7f003..f95fa5e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,6 +41,9 @@ jobs: - os: ubuntu-24.04 python-version: '3.12' toxenv: py312 + - os: ubuntu-24.04 + python-version: '3.13' + toxenv: py313 env: TOXENV: ${{ matrix.toxenv }} diff --git a/README.rst b/README.rst index db9b404..29e9a16 100644 --- a/README.rst +++ b/README.rst @@ -68,7 +68,7 @@ Changelog Version 1.6.0 ~~~~~~~~~~~~~ -- Drop support for Python < 3.9, support 3.9, 3.10, 3.11, 3.12. +- Drop support for Python < 3.9, support 3.9, 3.10, 3.11, 3.12, 3.13. - Switch CI from travis to github actions, test on all supported Python versions. - Use src/ layout for project, fixes #36. Also move tests and test data to tests/. - Replace deprecated distutils by setuptools to make tests work on py312, fixes #64. diff --git a/pyproject.toml b/pyproject.toml index e92c380..fb075a6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -30,7 +30,7 @@ legacy_tox_ini = """ # - pyproject.toml: tool.poetry.dependencies # - .github/workflows/ci.yml # - README.rst -envlist = py{39,310,311,312} +envlist = py{39,310,311,312,313} [testenv] deps = From dcb93747a5e0b1ca86b0b35f383f21417f77c39d Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Tue, 7 Oct 2025 03:28:00 +0200 Subject: [PATCH 03/12] CI: run the Python 3.9 testing on Ubuntu 22.04 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f95fa5e..fdbda76 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,7 +29,7 @@ jobs: fail-fast: true matrix: include: - - os: ubuntu-20.04 + - os: ubuntu-22.04 python-version: '3.9' toxenv: py39 - os: ubuntu-22.04 From 9ccff12646c92e39bf79afeef7c6f6fc268c8091 Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Tue, 7 Oct 2025 03:11:28 +0200 Subject: [PATCH 04/12] require tox<4.30 due to setup.cfg bug --- .github/workflows/ci.yml | 2 -- pyproject.toml | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fdbda76..5f9ef1e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -63,7 +63,6 @@ jobs: - name: Install Python requirements run: | python -m pip install --upgrade pip - pip install tox - name: Install pkgconfig run: pip install -ve . - name: run tox env @@ -97,7 +96,6 @@ jobs: - name: Install Python requirements run: | python -m pip install --upgrade pip - pip install tox - name: Install pkgconfig run: pip install -ve . - name: run tox env diff --git a/pyproject.toml b/pyproject.toml index fb075a6..8ada201 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,6 +22,7 @@ python = "^3.9.0" [tool.poetry.dev-dependencies] pytest = "^3.8.2" +tox = "<4.30" [tool.tox] legacy_tox_ini = """ From a6db41e8daf5ebdf3f1220f77d2b10dfa8a3120b Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Tue, 7 Oct 2025 03:44:59 +0200 Subject: [PATCH 05/12] upgrade to current pytest 8.4.2 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 8ada201..c2e0b7d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,7 +21,7 @@ classifiers = [ python = "^3.9.0" [tool.poetry.dev-dependencies] -pytest = "^3.8.2" +pytest = "^8.4.2" tox = "<4.30" [tool.tox] From 9bb26315e95b190f74853e427b8d4b6fc9151052 Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Tue, 7 Oct 2025 03:18:26 +0200 Subject: [PATCH 06/12] CI: use poetry to install and run tox --- .github/workflows/ci.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5f9ef1e..8a230eb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -63,10 +63,11 @@ jobs: - name: Install Python requirements run: | python -m pip install --upgrade pip - - name: Install pkgconfig - run: pip install -ve . + python -m pip install poetry + poetry --version + poetry install - name: run tox env - run: tox --skip-missing-interpreters + run: poetry run tox --skip-missing-interpreters macOS: @@ -96,7 +97,8 @@ jobs: - name: Install Python requirements run: | python -m pip install --upgrade pip - - name: Install pkgconfig - run: pip install -ve . + python -m pip install poetry + poetry --version + poetry install - name: run tox env - run: tox --skip-missing-interpreters + run: poetry run tox --skip-missing-interpreters From 91cf23ab05881a847997cde613faab6fe1be8016 Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Tue, 7 Oct 2025 03:20:48 +0200 Subject: [PATCH 07/12] pyproject.toml: use tool.poetry.group.dev.dependencies --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index c2e0b7d..9e03bdf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,7 +20,7 @@ classifiers = [ [tool.poetry.dependencies] python = "^3.9.0" -[tool.poetry.dev-dependencies] +[tool.poetry.group.dev.dependencies] pytest = "^8.4.2" tox = "<4.30" From 2356792436edba5bd53ab3989674571a3b21aaaf Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Tue, 7 Oct 2025 03:02:32 +0200 Subject: [PATCH 08/12] add "not released yet" to 1.6.0 changelog section --- README.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index 29e9a16..ccaf2f2 100644 --- a/README.rst +++ b/README.rst @@ -65,8 +65,8 @@ The ``pkgconfig`` module is licensed under the MIT license. Changelog --------- -Version 1.6.0 -~~~~~~~~~~~~~ +Version 1.6.0 (not released yet) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Drop support for Python < 3.9, support 3.9, 3.10, 3.11, 3.12, 3.13. - Switch CI from travis to github actions, test on all supported Python versions. From 0ca0ffea33ef9f976c953cc5c26baf70e8974ecf Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Tue, 7 Oct 2025 03:38:33 +0200 Subject: [PATCH 09/12] README: typos and grammar fix Done by Junie AI, proofread by me. --- README.rst | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/README.rst b/README.rst index ccaf2f2..c80c3c9 100644 --- a/README.rst +++ b/README.rst @@ -5,7 +5,7 @@ pkgconfig :target: https://github.com/matze/pkgconfig/actions/workflows/ci.yml ``pkgconfig`` is a Python module to interface with the ``pkg-config`` -command line tool for Python 3.9+. +command-line tool for Python 3.9+. It can be used to @@ -53,11 +53,11 @@ It can be used to >>> # sets extension attributes as needed >>> pkgconfig.configure_extension(ext, 'glib-2.0 gtk+-2.0') - The ``pkgconfig.parse`` function returns a dictonary of lists. + The ``pkgconfig.parse`` function returns a dictionary of lists. The lists returned are accurate representations of the equivalent - ``pkg-config`` call's result, both in content and order. + ``pkg-config`` call's results, both in content and order. -If ``pkg-config`` is not on the path, raises ``EnvironmentError``. +If ``pkg-config`` is not on the PATH, an ``EnvironmentError`` is raised. The ``pkgconfig`` module is licensed under the MIT license. @@ -69,15 +69,15 @@ Version 1.6.0 (not released yet) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Drop support for Python < 3.9, support 3.9, 3.10, 3.11, 3.12, 3.13. -- Switch CI from travis to github actions, test on all supported Python versions. +- Switch CI from Travis to GitHub Actions; test on all supported Python versions. - Use src/ layout for project, fixes #36. Also move tests and test data to tests/. -- Replace deprecated distutils by setuptools to make tests work on py312, fixes #64. +- Replace deprecated distutils with setuptools to make tests work on Python 3.12; fixes #64. - Fix configure_extension for empty cflags or libs. Version 1.5.5 ~~~~~~~~~~~~~ -- Make tests more robust by sorting +- Make tests more robust by sorting. Version 1.5.4 ~~~~~~~~~~~~~ @@ -92,7 +92,7 @@ Version 1.5.3 Version 1.5.2 ~~~~~~~~~~~~~ -- Update poetry dep +- Update poetry dependency - Improve CI Version 1.5.0 @@ -125,7 +125,7 @@ Version 1.3.0 Version 1.2.1 and 1.2.2 ~~~~~~~~~~~~~~~~~~~~~~~ -Bug fix releases released on December 1st and 2nd 2016. +Bugfix releases on December 1 and 2, 2016. - Include the ``data`` folder in the distribution in order to run tests - Improve the tests @@ -134,17 +134,17 @@ Bug fix releases released on December 1st and 2nd 2016. Version 1.2.0 ~~~~~~~~~~~~~ -Released on November 30th 2016. +Released on November 30th, 2016. - Potential break: switch from result set to list -- Expose --list-all query -- Added support for PKG_CONFIG environment variable +- Expose the --list-all query +- Added support for the PKG_CONFIG environment variable Version 1.1.0 ~~~~~~~~~~~~~ -Released on November 6th 2013. +Released on November 6th, 2013. - Multiple packages can now be parsed with a single call to ``.parse``. @@ -152,4 +152,4 @@ Released on November 6th 2013. Version 1.0.0 ~~~~~~~~~~~~~ -First release on September 8th 2013. +First release on September 8th, 2013. From 76ce1ca1c5b4bbd4a39edbed2f3893995287afbc Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Tue, 7 Oct 2025 03:48:39 +0200 Subject: [PATCH 10/12] code: fix typos and grammar --- src/pkgconfig/pkgconfig.py | 24 ++++++++++++------------ tests/test_pkgconfig.py | 10 +++++----- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/pkgconfig/pkgconfig.py b/src/pkgconfig/pkgconfig.py index 30ad4ba..c7d3e69 100644 --- a/src/pkgconfig/pkgconfig.py +++ b/src/pkgconfig/pkgconfig.py @@ -19,7 +19,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -"""pkgconfig is a Python module to interface with the pkg-config command line +"""pkgconfig is a Python module to interface with the pkg-config command-line tool.""" import os @@ -118,7 +118,7 @@ def exists(package): """ Return True if package information is available. - If ``pkg-config`` not on path, raises ``EnvironmentError``. + If ``pkg-config`` is not on the PATH, an ``EnvironmentError`` is raised. """ pkg_config_exe = os.environ.get('PKG_CONFIG', None) or 'pkg-config' cmd = '{0} --exists {1}'.format(pkg_config_exe, package).split() @@ -128,9 +128,9 @@ def exists(package): @_convert_error def requires(package): """ - Return a list of package names that is required by the package. + Return a list of package names that are required by the package. - If ``pkg-config`` not on path, raises ``EnvironmentError``. + If ``pkg-config`` is not on the PATH, an ``EnvironmentError`` is raised. """ return _query(package, '--print-requires').split('\n') @@ -139,7 +139,7 @@ def cflags(package): """ Return the CFLAGS string returned by pkg-config. - If ``pkg-config`` is not on path, raises ``EnvironmentError``. + If ``pkg-config`` is not on the PATH, an ``EnvironmentError`` is raised. """ _raise_if_not_exists(package) return _query(package, '--cflags') @@ -149,7 +149,7 @@ def modversion(package): """ Return the version returned by pkg-config. - If `pkg-config` is not in the path, raises ``EnvironmentError``. + If ``pkg-config`` is not on the PATH, an ``EnvironmentError`` is raised. """ _raise_if_not_exists(package) return _query(package, '--modversion') @@ -169,7 +169,7 @@ def libs(package, static=False): def variables(package): """ Return a dictionary of all the variables defined in the .pc pkg-config file - of 'package'. + of the package. """ _raise_if_not_exists(package) result = _query(package, '--print-variables') @@ -182,8 +182,8 @@ def installed(package, version): Check if the package meets the required version. The version specifier consists of an optional comparator (one of =, ==, >, - <, >=, <=) and an arbitrarily long version number separated by dots. The - should be as you would expect, e.g. for an installed version '0.1.2' of + <, >=, <=) and an arbitrarily long version number separated by dots. The comparisons + behave as you would expect. For example, for an installed version '0.1.2' of package 'foo': >>> installed('foo', '==0.1.2') @@ -193,7 +193,7 @@ def installed(package, version): >>> installed('foo', '>= 0.0.4') True - If ``pkg-config`` not on path, raises ``EnvironmentError``. + If ``pkg-config`` is not on the PATH, an ``EnvironmentError`` is raised. """ if not exists(package): return False @@ -237,12 +237,12 @@ def parse(packages, static=False): Builds a dictionary containing the 'libraries', the 'library_dirs', the 'include_dirs', and the 'define_macros' that are presented by pkg-config. - *package* is a string with space-delimited package names. + *packages* is a string with space-delimited package names. The static specifier will also include libraries for static linking (i.e., includes any private libraries). - If ``pkg-config`` is not on path, raises ``EnvironmentError``. + If ``pkg-config`` is not on the PATH, an ``EnvironmentError`` is raised. """ for package in packages.split(): _raise_if_not_exists(package) diff --git a/tests/test_pkgconfig.py b/tests/test_pkgconfig.py index 10a1b3a..d5ede33 100644 --- a/tests/test_pkgconfig.py +++ b/tests/test_pkgconfig.py @@ -58,18 +58,18 @@ def test_openssl(version, expected): # PLEASE NOTE: # sadly, when looking at all (esp. non-python) libraries out there, there # is no agreement on the semantics of letters appended to version numbers. - # e.g. for a release candidate, some might use "c", but other also might - # use "rc" or whatever. stuff like openssl does not use the letters to + # e.g. for a release candidate, some might use "c", but others also might + # use "rc" or whatever. Software like OpenSSL does not use the letters to # represent release status, but rather minor updates using a-z. # so, as there is no real standard / agreement, we can NOT assume any # advanced semantics here (like we could for python packages). # thus we do NOT implement any special semantics for the letters, - # except string ordering - # thus, comparing a version with a letter-digits appendix to one without + # except string ordering. + # thus, comparing a version with a letter–digits suffix to one without # may or may not give the desired result. # e.g. python packages use a1 for alpha 1, b2 for beta 2, c3 for release # candidate 3 and for release. - # we do not implement this semantics, "1.2.3" > "1.2.3b1" does not work. + # we do not implement these semantics; "1.2.3" > "1.2.3b1" does not work. ]) def test_dld_pkg(version, expected): assert pkgconfig.installed('fake-dld-pkg', version) == expected From 7f9545db9ede6989fb53983d81117241441dd4f3 Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Tue, 13 Jan 2026 04:01:16 +0100 Subject: [PATCH 11/12] CI: test on Python 3.14 --- .github/workflows/ci.yml | 6 ++++++ README.rst | 2 +- pyproject.toml | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8a230eb..61c03fc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,6 +44,12 @@ jobs: - os: ubuntu-24.04 python-version: '3.13' toxenv: py313 + - os: ubuntu-24.04 + python-version: '3.13' + toxenv: py313 + - os: ubuntu-24.04 + python-version: '3.14' + toxenv: py314 env: TOXENV: ${{ matrix.toxenv }} diff --git a/README.rst b/README.rst index c80c3c9..93c6410 100644 --- a/README.rst +++ b/README.rst @@ -68,7 +68,7 @@ Changelog Version 1.6.0 (not released yet) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- Drop support for Python < 3.9, support 3.9, 3.10, 3.11, 3.12, 3.13. +- Drop support for Python < 3.9, support 3.9 .. 3.14. - Switch CI from Travis to GitHub Actions; test on all supported Python versions. - Use src/ layout for project, fixes #36. Also move tests and test data to tests/. - Replace deprecated distutils with setuptools to make tests work on Python 3.12; fixes #64. diff --git a/pyproject.toml b/pyproject.toml index 9e03bdf..9fb362f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -31,7 +31,7 @@ legacy_tox_ini = """ # - pyproject.toml: tool.poetry.dependencies # - .github/workflows/ci.yml # - README.rst -envlist = py{39,310,311,312,313} +envlist = py{39,310,311,312,313,314} [testenv] deps = From 5d16c48978d76dbbaa4dd65749ddd59e92d9c541 Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Tue, 13 Jan 2026 04:29:51 +0100 Subject: [PATCH 12/12] work around tox setup.cfg bug when giving -c pyproject.toml option, it does not stumble over missing tox configuration in setup.cfg (because it now is in pyproject.toml). that bug is in tox >= 4.30. by using the workaround, it should now work with any recent tox version. https://github.com/tox-dev/tox/issues/3602 --- .github/workflows/ci.yml | 4 ++-- pyproject.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 61c03fc..e8f8001 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -73,7 +73,7 @@ jobs: poetry --version poetry install - name: run tox env - run: poetry run tox --skip-missing-interpreters + run: poetry run tox -c pyproject.toml --skip-missing-interpreters macOS: @@ -107,4 +107,4 @@ jobs: poetry --version poetry install - name: run tox env - run: poetry run tox --skip-missing-interpreters + run: poetry run tox -c pyproject.toml --skip-missing-interpreters diff --git a/pyproject.toml b/pyproject.toml index 9fb362f..ba9a64f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,7 +22,7 @@ python = "^3.9.0" [tool.poetry.group.dev.dependencies] pytest = "^8.4.2" -tox = "<4.30" +tox = "^4.29.0" [tool.tox] legacy_tox_ini = """