Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
19 changes: 9 additions & 10 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ jobs:
- macos-13
- windows-latest
python:
- '3.8'
- '3.13'
- '3.9'
- '3.14'
meson:
-
dependencies:
Expand All @@ -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
Expand Down Expand Up @@ -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'
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
9 changes: 4 additions & 5 deletions mesonpy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
import typing
import warnings

from functools import cached_property


if sys.version_info < (3, 11):
import tomli as tomllib
Expand All @@ -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:
Expand Down Expand Up @@ -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', {})
Expand Down
8 changes: 0 additions & 8 deletions mesonpy/_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

from __future__ import annotations

import functools
import importlib.resources
import os
import sys
Expand All @@ -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()
Expand All @@ -49,7 +42,6 @@ def read_binary(package: str, resource: str) -> bytes:


__all__ = [
'cached_property',
'read_binary',
'Collection',
'Iterable',
Expand Down
17 changes: 8 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand All @@ -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"',
Expand All @@ -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',
Expand All @@ -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
Expand Down
3 changes: 3 additions & 0 deletions tests/test_sdist.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Loading