diff --git a/.cirrus.yml b/.cirrus.yml index f84e8079..5fd99293 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -8,7 +8,8 @@ test_template: &test - python3 --version - python3 -m venv env - . env/bin/activate - - python3 -m pip install .[test] + - python3 -m pip install -U pip + - python3 -m pip install . --group test - python3 -m pytest alpine-3_task: @@ -55,12 +56,12 @@ manylinux-python3.13t_task: PATH: "/opt/python/cp313-cp313t/bin/:${PATH}" << : *test -manylinux-python3.8_task: +manylinux-python3.9_task: container: dockerfile: ci/manylinux.docker cpu: 1 env: - PATH: "/opt/python/cp38-cp38/bin/:${PATH}" + PATH: "/opt/python/cp39-cp39/bin/:${PATH}" << : *test miniconda_task: diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 02070ea0..bc293c40 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -32,7 +32,7 @@ jobs: - uses: actions/checkout@v4 with: ref: ${{ github.event.inputs.tag || github.ref }} - - run: python -m pip install .[docs] + - run: python -m pip install --group docs - run: python -m sphinx -W docs/ build/docs/ - uses: actions/upload-pages-artifact@v3 with: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9dfd8188..d2209beb 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -50,8 +50,8 @@ jobs: - macos-13 - windows-latest python: - - '3.8' - - '3.13' + - '3.9' + - '3.14' meson: - dependencies: @@ -61,10 +61,6 @@ jobs: python: 'pypy-3.9' - os: ubuntu-latest python: 'pypy-3.11' - - os: ubuntu-latest - python: '3.8' - - os: ubuntu-latest - python: '3.9' - os: ubuntu-latest python: '3.10' # Test with older supported Meson version. Meson up to @@ -102,6 +98,9 @@ jobs: python: '3.12' meson: '~=1.7.0' dependencies: 'packaging==23.2' + - os: ubuntu-latest + python: '3.13' + meson: '~=1.8.0' # Test with Meson master branch. - os: ubuntu-latest python: '3.12' @@ -140,7 +139,7 @@ jobs: if: ${{ matrix.dependencies }} - name: Install - run: python -m pip install .[test] + run: python -m pip install . --group test - name: Run tests run: python -m pytest --showlocals -vv --cov --cov-report=xml @@ -183,7 +182,7 @@ jobs: if: ${{ matrix.meson }} - name: Install - run: python -m pip install .[test] + run: python -m pip install . --group test - name: Run tests run: python -m pytest --showlocals -vv @@ -256,7 +255,7 @@ jobs: pushd /usr/share/python-wheels/ python -m pip download setuptools pip popd - python -m pip install .[test] + python -m pip install . --group test shell: C:\cygwin\bin\env.exe CYGWIN_NOWINPATH=1 CHERE_INVOKING=1 C:\cygwin\bin\bash.exe -leo pipefail -o igncr {0} - name: Run tests @@ -295,7 +294,7 @@ jobs: if: ${{ matrix.meson }} - name: Install - run: python -m pip install .[test] + run: python -m pip install . --group test - name: Run tests run: python -m pytest --showlocals -vv diff --git a/mesonpy/__init__.py b/mesonpy/__init__.py index d4dd3bd0..61b69cef 100644 --- a/mesonpy/__init__.py +++ b/mesonpy/__init__.py @@ -36,6 +36,8 @@ import typing import warnings +from functools import cached_property + if sys.version_info < (3, 11): import tomli as tomllib @@ -46,13 +48,12 @@ import packaging.version import pyproject_metadata -import mesonpy._compat import mesonpy._rpath import mesonpy._tags import mesonpy._util import mesonpy._wheelfile -from mesonpy._compat import cached_property, read_binary +from mesonpy._compat import read_binary try: @@ -578,9 +579,7 @@ def _string_or_path(value: Any, name: str) -> str: 'meson': _string_or_path, 'limited-api': _bool, 'allow-windows-internal-shared-libs': _bool, - 'args': _table({ - name: _strings for name in _MESON_ARGS_KEYS - }), + 'args': _table(dict.fromkeys(_MESON_ARGS_KEYS, _strings)), }) table = pyproject.get('tool', {}).get('meson-python', {}) diff --git a/mesonpy/_compat.py b/mesonpy/_compat.py index 2b3d3431..8d22c166 100644 --- a/mesonpy/_compat.py +++ b/mesonpy/_compat.py @@ -6,7 +6,6 @@ from __future__ import annotations -import functools import importlib.resources import os import sys @@ -19,12 +18,6 @@ from typing import Collection, Iterable, Iterator, Mapping, Sequence -if sys.version_info >= (3, 8): - from functools import cached_property -else: - cached_property = lambda x: property(functools.lru_cache(maxsize=None)(x)) # noqa: E731 - - if sys.version_info >= (3, 9): def read_binary(package: str, resource: str) -> bytes: return importlib.resources.files(package).joinpath(resource).read_bytes() @@ -49,7 +42,6 @@ def read_binary(package: str, resource: str) -> bytes: __all__ = [ - 'cached_property', 'read_binary', 'Collection', 'Iterable', diff --git a/pyproject.toml b/pyproject.toml index 16deff42..da9caf8e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -19,7 +19,7 @@ name = 'meson-python' version = '0.19.0.dev0' description = 'Meson Python build backend (PEP 517)' readme = 'README.rst' -requires-python = '>= 3.8' +requires-python = '>= 3.9' license = 'MIT' license-files = ['LICENSES/MIT.txt'] keywords = ['meson', 'build', 'backend', 'pep517', 'package'] @@ -33,7 +33,6 @@ classifiers = [ 'Programming Language :: Python', 'Topic :: Software Development :: Build Tools', ] - dependencies = [ 'meson >= 0.64.0; python_version < "3.12"', 'meson >= 1.2.3; python_version >= "3.12"', @@ -43,7 +42,13 @@ dependencies = [ 'tomli >= 1.0.0; python_version < "3.11"', ] -[project.optional-dependencies] +[project.urls] +homepage = 'https://github.com/mesonbuild/meson-python' +repository = 'https://github.com/mesonbuild/meson-python' +documentation = 'https://mesonbuild.com/meson-python/' +changelog = 'https://mesonbuild.com/meson-python/changelog.html' + +[dependency-groups] test = [ 'build', 'pytest >= 6.0', @@ -61,12 +66,6 @@ docs = [ 'sphinxext-opengraph >= 0.7.0', ] -[project.urls] -homepage = 'https://github.com/mesonbuild/meson-python' -repository = 'https://github.com/mesonbuild/meson-python' -documentation = 'https://mesonbuild.com/meson-python/' -changelog = 'https://mesonbuild.com/meson-python/changelog.html' - [tool.mypy] show_error_codes = true diff --git a/tests/test_sdist.py b/tests/test_sdist.py index bc598d91..2c519895 100644 --- a/tests/test_sdist.py +++ b/tests/test_sdist.py @@ -217,6 +217,9 @@ def test_reproducible(package_pure, tmp_path): assert sdist_path_a == sdist_path_b assert tmp_path.joinpath('a', sdist_path_a).read_bytes() == tmp_path.joinpath('b', sdist_path_b).read_bytes() +# ``meson dist`` does not handle tarballs containing symbolic links to absolute +# paths on Python 3.14, see https://github.com/mesonbuild/meson/issues/15142 +@pytest.mark.skipif(sys.version_info >= (3, 14), reason='incompatible Python version') @pytest.mark.filterwarnings('ignore:symbolic link') def test_symlinks(tmp_path, sdist_symlinks): with tarfile.open(sdist_symlinks, 'r:gz') as sdist: