Skip to content

Commit 57920bb

Browse files
authored
Merge branch 'main' into ios-support
2 parents becd4c9 + 965c472 commit 57920bb

File tree

13 files changed

+124
-5
lines changed

13 files changed

+124
-5
lines changed

CHANGELOG.rst

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,35 @@
1111
Changelog
1212
+++++++++
1313

14+
0.18.0
15+
======
16+
17+
- Drop Python 3.7 support.
18+
- Bump minimum required Meson version to 0.64.0.
19+
- Bump minimum required ``pyproject-metadata`` version to 0.9.0 to enable
20+
support for PEP 639.
21+
- Bump minimum required ``packaging`` version to 23.2. ``pyproject-metadata``
22+
version 0.9.1 requires this version of ``packaging`` but fails to record the
23+
version requirement in the package metadata. Enforcing the version
24+
requirement in ``meson-python`` allows fixing possible dependency problems
25+
without having ``meson-python`` depend on a very recent
26+
``pyproject-metadata`` release.
27+
- Add support for PEP 639 metadata fields. Canonicalization and validation of
28+
the license expression requires ``packaging`` version 24.2 or later.
29+
- Add support for declaring the ``licence`` and ``license-files`` as dynamic
30+
fields in ``pyproject.toml`` to extract the package license and license
31+
files from the ones declared via the ``project()`` call in
32+
``meson.build``. This requires Meson version 1.6.0 or later.
33+
- Add support for ``RPATH`` handling on SunOS.
34+
- Include shared libraries built as part of the Meson project in the Python
35+
wheels also on Windows, when explicitly enabled via the
36+
``tool.meson-python.allow-windows-internal-shared-libs`` project setting.
37+
- Add support for symbolic links that point to files within the source tree.
38+
They are now included as regular files in the sdist archive.
39+
40+
Daniele Nicolodi, Marcel Telka, Ralf Gommers --- 30-04-2025.
41+
42+
1443
0.17.1
1544
======
1645

@@ -19,6 +48,7 @@ Changelog
1948

2049
Daniele Nicolodi --- 23-10-2024.
2150

51+
2252
0.17.0
2353
======
2454

@@ -45,6 +75,7 @@ Daniele Nicolodi --- 23-10-2024.
4575
Christian Clauss, Daniele Nicolodi, Jonathan J. Helmus, Leo Singer, Loïc
4676
Estève, Michael Simacek, Ralf Gommers, Simon McVittie --- 19-10-2024.
4777

78+
4879
0.16.0
4980
======
5081

docs/reference/meson-compatibility.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,7 @@ versions.
5050
Meson 1.6.0 or later is required to support ``license`` and
5151
``license-files`` dynamic fields in ``pyproject.toml`` and to
5252
populate the package license and license files from the ones
53-
declared via the ``project()`` call in ``meson.build``. This also
54-
requires ``pyproject-metadata`` version 0.9.0 or later.
53+
declared via the ``project()`` call in ``meson.build``.
5554

5655
Build front-ends by default build packages in an isolated Python
5756
environment where build dependencies are installed. Most often, unless

mesonpy/__init__.py

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import argparse
1515
import collections
1616
import contextlib
17+
import copy
1718
import difflib
1819
import functools
1920
import importlib.machinery
@@ -23,6 +24,7 @@
2324
import os
2425
import pathlib
2526
import platform
27+
import posixpath
2628
import re
2729
import shutil
2830
import subprocess
@@ -79,7 +81,7 @@ class InvalidLicenseExpression(Exception): # type: ignore[no-redef]
7981
MesonArgs = Mapping[MesonArgsKeys, List[str]]
8082

8183

82-
__version__ = '0.18.0.dev0'
84+
__version__ = '0.18.0'
8385

8486

8587
_PYPROJECT_METADATA_VERSION = tuple(map(int, pyproject_metadata.__version__.split('.')[:2]))
@@ -961,6 +963,33 @@ def sdist(self, directory: Path) -> pathlib.Path:
961963

962964
with tarfile.open(meson_dist_path, 'r:gz') as meson_dist, mesonpy._util.create_targz(sdist_path) as sdist:
963965
for member in meson_dist.getmembers():
966+
# Recursively resolve symbolic links. The source distribution
967+
# archive format specification allows for symbolic links as
968+
# long as the target path does not include a '..' component.
969+
# This makes symbolic links support unusable in most cases,
970+
# therefore include the symbolic link targets as regular files
971+
# in all cases.
972+
while member.issym():
973+
name = member.name
974+
target = posixpath.normpath(posixpath.join(posixpath.dirname(member.name), member.linkname))
975+
try:
976+
# This can be implemented using the .replace() method
977+
# in Python 3.12 and later. The .replace() method was
978+
# added as part of PEP 706 and back-ported to Python
979+
# 3.9 and later in patch releases, thus it cannot be
980+
# relied upon until the minimum supported Python
981+
# version is 3.12.
982+
member = copy.copy(meson_dist.getmember(target))
983+
member.name = name
984+
except KeyError:
985+
warnings.warn(
986+
'symbolic link with absolute path target, pointing outside the '
987+
f'archive, or dangling ignored: {name}', stacklevel=1)
988+
break
989+
if member.isdir():
990+
warnings.warn(
991+
f'symbolic link pointing to a directory ignored: {name}', stacklevel=1)
992+
964993
if member.isfile():
965994
file = meson_dist.extractfile(member.name)
966995

@@ -995,6 +1024,10 @@ def sdist(self, directory: Path) -> pathlib.Path:
9951024

9961025
sdist.addfile(member, file)
9971026

1027+
elif not member.isdir() and not member.issym():
1028+
warnings.warn(
1029+
f'special file in the source archive ignored: {member.name}', stacklevel=1)
1030+
9981031
# Add 'PKG-INFO'.
9991032
member = tarfile.TarInfo(f'{dist_name}/PKG-INFO')
10001033
member.uid = member.gid = 0

pyproject.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,12 @@ requires = [
1616

1717
[project]
1818
name = 'meson-python'
19-
version = '0.18.0.dev0'
19+
version = '0.18.0'
2020
description = 'Meson Python build backend (PEP 517)'
2121
readme = 'README.rst'
2222
requires-python = '>= 3.8'
23-
license = { file = 'LICENSES/MIT.txt' }
23+
license = 'MIT'
24+
license-files = ['LICENSES/MIT.txt']
2425
keywords = ['meson', 'build', 'backend', 'pep517', 'package']
2526
maintainers = [
2627
{ name = 'Ralf Gommers', email = '[email protected]' },
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# SPDX-FileCopyrightText: 2025 The meson-python developers
2+
#
3+
# SPDX-License-Identifier: MIT

tests/packages/symlinks/baz.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/__init__.py
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# SPDX-FileCopyrightText: 2025 The meson-python developers
2+
#
3+
# SPDX-License-Identifier: MIT
4+
5+
project('symlinks', version: '1.0.0')
6+
7+
py = import('python').find_installation()
8+
9+
py.install_sources(
10+
'__init__.py',
11+
'submodule/__init__.py',
12+
'submodule/aaa.py',
13+
'submodule/bbb.py',
14+
subdir: 'symlinks',
15+
preserve_path: true,
16+
)
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# SPDX-FileCopyrightText: 2021 The meson-python developers
2+
#
3+
# SPDX-License-Identifier: MIT
4+
5+
[build-system]
6+
build-backend = 'mesonpy'
7+
requires = ['meson-python']

tests/packages/symlinks/qux.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../__init__.py
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../__init__.py

0 commit comments

Comments
 (0)