[packages/python3-build] - remove obsolete and network tests

baggins baggins at pld-linux.org
Sun Apr 6 03:16:33 CEST 2025


commit 464d279d1a5a12dcdc6fd443158513d4c6c7596f
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Sun Apr 6 02:29:02 2025 +0200

    - remove obsolete and network tests

 non-py313-or-network-tests.patch | 278 +++++++++++++++++++++++++++++++++++++++
 python3-build.spec               |   4 +-
 2 files changed, 281 insertions(+), 1 deletion(-)
---
diff --git a/python3-build.spec b/python3-build.spec
index 0a87829..5adbfc3 100644
--- a/python3-build.spec
+++ b/python3-build.spec
@@ -35,6 +35,7 @@ Source3:	https://files.pythonhosted.org/packages/source/i/installer/installer-%{
 # Source3-md5:	d961d1105c9270049528b1167ed021bc
 Patch0:		flit-core-PEP639.patch
 Patch1:		post1.patch
+Patch2:		non-py313-or-network-tests.patch
 URL:		https://pypi.org/project/build/
 %if %{without bootstrap}
 BuildRequires:	python3-build
@@ -79,6 +80,7 @@ Dokumentacja API modułu Pythona %{module}.
 %setup -q %{?with_bootstrap:-a1 -a2 -a3} -n %{module}-%{version}
 %patch -P 0 -p1
 %patch -P 1 -p1
+%patch -P 2 -p1
 
 %build
 %if %{with bootstrap}
@@ -132,7 +134,7 @@ rm -rf $RPM_BUILD_ROOT
 %doc CHANGELOG.rst
 %attr(755,root,root) %{_bindir}/pyproject-build
 %{py3_sitescriptdir}/%{module}
-%{py3_sitescriptdir}/%{module}-%{version}.dist-info
+%{py3_sitescriptdir}/%{module}-%{version}*.dist-info
 %if %{with bootstrap}
 %{py3_sitescriptdir}/flit_core
 %{py3_sitescriptdir}/flit_core-%{flit_core_version}.dist-info
diff --git a/non-py313-or-network-tests.patch b/non-py313-or-network-tests.patch
new file mode 100644
index 0000000..989aef1
--- /dev/null
+++ b/non-py313-or-network-tests.patch
@@ -0,0 +1,278 @@
+--- build-1.2.2/tests/test_util.py~	2024-09-06 21:03:28.000000000 +0200
++++ build-1.2.2/tests/test_util.py	2025-04-06 01:42:48.239980608 +0200
+@@ -7,17 +7,6 @@
+ import build.util
+ 
+ 
+- at pytest.mark.pypy3323bug
+- at pytest.mark.parametrize('isolated', [False, pytest.param(True, marks=[pytest.mark.network, pytest.mark.isolated])])
+-def test_wheel_metadata(package_test_setuptools, isolated):
+-    metadata = build.util.project_wheel_metadata(package_test_setuptools, isolated)
+-
+-    # Setuptools < v69.0.3 (https://github.com/pypa/setuptools/pull/4159) normalized this to dashes
+-    assert metadata['name'].replace('-', '_') == 'test_setuptools'
+-    assert metadata['version'] == '1.0.0'
+-    assert isinstance(metadata.json, dict)
+-
+-
+ @pytest.mark.network
+ @pytest.mark.pypy3323bug
+ def test_wheel_metadata_isolation(package_test_flit):
+@@ -35,15 +24,3 @@
+         match="Backend 'flit_core.buildapi' is not available.",
+     ):
+         build.util.project_wheel_metadata(package_test_flit, isolated=False)
+-
+-
+- at pytest.mark.network
+- at pytest.mark.pypy3323bug
+-def test_with_get_requires(package_test_metadata):
+-    metadata = build.util.project_wheel_metadata(package_test_metadata)
+-
+-    # Setuptools < v69.0.3 (https://github.com/pypa/setuptools/pull/4159) normalized this to dashes
+-    assert metadata['name'].replace('-', '_') == 'test_metadata'
+-    assert str(metadata['version']) == '1.0.0'
+-    assert metadata['summary'] == 'hello!'
+-    assert isinstance(metadata.json, dict)
+--- build-1.2.2/tests/test_env.py~	2024-09-06 21:03:28.000000000 +0200
++++ build-1.2.2/tests/test_env.py	2025-04-06 01:52:19.193313911 +0200
+@@ -258,32 +258,6 @@
+         assert env._env_backend.display_name == env_backend_display_name
+ 
+ 
+- at pytest.mark.network
+- at pytest.mark.usefixtures('local_pip')
+- at pytest.mark.parametrize(
+-    'installer',
+-    [
+-        'pip',
+-        pytest.param(
+-            'uv',
+-            marks=[
+-                pytest.mark.xfail(
+-                    IS_PYPY and IS_WINDOWS and sys.version_info < (3, 9),
+-                    reason='uv cannot find PyPy 3.8 executable on Windows',
+-                ),
+-                pytest.mark.skipif(MISSING_UV, reason='uv executable not found'),
+-            ],
+-        ),
+-    ],
+-)
+-def test_requirement_installation(
+-    package_test_flit: str,
+-    installer: build.env.Installer,
+-):
+-    with build.env.DefaultIsolatedEnv(installer=installer) as env:
+-        env.install([f'test-flit @ {Path(package_test_flit).as_uri()}'])
+-
+-
+ @pytest.mark.skipif(MISSING_UV, reason='uv executable not found')
+ def test_external_uv_detection_success(
+     caplog: pytest.LogCaptureFixture,
+--- build-1.2.2/tests/test_self_packaging.py~	2025-04-06 01:29:19.000000000 +0200
++++ build-1.2.2/tests/test_self_packaging.py	2025-04-06 01:55:51.093313866 +0200
+@@ -65,55 +65,3 @@
+     'dist-info/WHEEL',
+     'dist-info/entry_points.txt',
+ }
+-
+-
+- at pytest.mark.network
+-def test_build_sdist(monkeypatch, tmpdir):
+-    monkeypatch.chdir(MAIN_DIR)
+-
+-    subprocess.run(
+-        [
+-            sys.executable,
+-            '-m',
+-            'build',
+-            '--sdist',
+-            '--outdir',
+-            str(tmpdir),
+-        ],
+-        check=True,
+-    )
+-
+-    (sdist,) = tmpdir.visit('*.tar.gz')
+-
+-    with tarfile.open(str(sdist), 'r:gz') as tar:
+-        simpler = {n.split('/', 1)[-1] for n in tar.getnames()}
+-
+-    assert simpler == sdist_files
+-
+-
+- at pytest.mark.network
+- at pytest.mark.parametrize('args', ((), ('--wheel',)), ids=('from_sdist', 'direct'))
+-def test_build_wheel(monkeypatch, tmpdir, args):
+-    monkeypatch.chdir(MAIN_DIR)
+-
+-    subprocess.run(
+-        [
+-            sys.executable,
+-            '-m',
+-            'build',
+-            *args,
+-            '--outdir',
+-            str(tmpdir),
+-        ],
+-        check=True,
+-    )
+-
+-    (wheel,) = tmpdir.visit('*.whl')
+-
+-    with zipfile.ZipFile(str(wheel)) as z:
+-        names = z.namelist()
+-
+-    trimmed = {n for n in names if 'dist-info' not in n}
+-    trimmed |= {f"dist-info/{n.split('/', 1)[-1]}" for n in names if 'dist-info' in n}
+-
+-    assert trimmed == wheel_files
+--- build-1.2.2/tests/test_main.py.orig	2025-04-06 02:15:37.713313740 +0200
++++ build-1.2.2/tests/test_main.py	2025-04-06 02:22:43.503313694 +0200
+@@ -196,28 +196,6 @@
+         build.__main__.build_package(package_test_flit, '.', ['sdist'])
+ 
+ 
+- at pytest.mark.network
+- at pytest.mark.pypy3323bug
+-def test_build_package(tmp_dir, package_test_setuptools):
+-    build.__main__.build_package(package_test_setuptools, tmp_dir, ['sdist', 'wheel'])
+-
+-    assert sorted(os.listdir(tmp_dir)) == [
+-        'test_setuptools-1.0.0-py2.py3-none-any.whl',
+-        'test_setuptools-1.0.0.tar.gz',
+-    ]
+-
+-
+- at pytest.mark.network
+- at pytest.mark.pypy3323bug
+-def test_build_package_via_sdist(tmp_dir, package_test_setuptools):
+-    build.__main__.build_package_via_sdist(package_test_setuptools, tmp_dir, ['wheel'])
+-
+-    assert sorted(os.listdir(tmp_dir)) == [
+-        'test_setuptools-1.0.0-py2.py3-none-any.whl',
+-        'test_setuptools-1.0.0.tar.gz',
+-    ]
+-
+-
+ @pytest.mark.pypy3323bug
+ def test_build_package_via_sdist_cant_build(tmp_dir, package_test_cant_build_via_sdist):
+     with pytest.raises(build.BuildBackendException):
+@@ -231,92 +209,6 @@
+ 
+ @pytest.mark.pypy3323bug
+ @pytest.mark.parametrize(
+-    ('args', 'output'),
+-    [
+-        pytest.param(
+-            [],
+-            [
+-                '* Creating isolated environment: venv+pip...',
+-                '* Installing packages in isolated environment:',
+-                '  - setuptools >= 42.0.0',
+-                '* Getting build dependencies for sdist...',
+-                '* Building sdist...',
+-                '* Building wheel from sdist',
+-                '* Creating isolated environment: venv+pip...',
+-                '* Installing packages in isolated environment:',
+-                '  - setuptools >= 42.0.0',
+-                '* Getting build dependencies for wheel...',
+-                '* Building wheel...',
+-                'Successfully built test_setuptools-1.0.0.tar.gz and test_setuptools-1.0.0-py2.py3-none-any.whl',
+-            ],
+-            id='via-sdist-isolation',
+-            marks=[pytest.mark.network, pytest.mark.isolated],
+-        ),
+-        pytest.param(
+-            ['--no-isolation'],
+-            [
+-                '* Getting build dependencies for sdist...',
+-                '* Building sdist...',
+-                '* Building wheel from sdist',
+-                '* Getting build dependencies for wheel...',
+-                '* Building wheel...',
+-                'Successfully built test_setuptools-1.0.0.tar.gz and test_setuptools-1.0.0-py2.py3-none-any.whl',
+-            ],
+-            id='via-sdist-no-isolation',
+-        ),
+-        pytest.param(
+-            ['--wheel'],
+-            [
+-                '* Creating isolated environment: venv+pip...',
+-                '* Installing packages in isolated environment:',
+-                '  - setuptools >= 42.0.0',
+-                '* Getting build dependencies for wheel...',
+-                '* Building wheel...',
+-                'Successfully built test_setuptools-1.0.0-py2.py3-none-any.whl',
+-            ],
+-            id='wheel-direct-isolation',
+-            marks=[pytest.mark.network, pytest.mark.isolated],
+-        ),
+-        pytest.param(
+-            ['--wheel', '--no-isolation'],
+-            [
+-                '* Getting build dependencies for wheel...',
+-                '* Building wheel...',
+-                'Successfully built test_setuptools-1.0.0-py2.py3-none-any.whl',
+-            ],
+-            id='wheel-direct-no-isolation',
+-        ),
+-        pytest.param(
+-            ['--sdist', '--no-isolation'],
+-            [
+-                '* Getting build dependencies for sdist...',
+-                '* Building sdist...',
+-                'Successfully built test_setuptools-1.0.0.tar.gz',
+-            ],
+-            id='sdist-direct-no-isolation',
+-        ),
+-        pytest.param(
+-            ['--sdist', '--wheel', '--no-isolation'],
+-            [
+-                '* Getting build dependencies for sdist...',
+-                '* Building sdist...',
+-                '* Getting build dependencies for wheel...',
+-                '* Building wheel...',
+-                'Successfully built test_setuptools-1.0.0.tar.gz and test_setuptools-1.0.0-py2.py3-none-any.whl',
+-            ],
+-            id='sdist-and-wheel-direct-no-isolation',
+-        ),
+-    ],
+-)
+- at pytest.mark.flaky(reruns=5)
+-def test_output(package_test_setuptools, tmp_dir, capsys, args, output):
+-    build.__main__.main([package_test_setuptools, '-o', tmp_dir, *args])
+-    stdout, stderr = capsys.readouterr()
+-    assert set(stdout.splitlines()) <= set(output)
+-
+-
+- at pytest.mark.pypy3323bug
+- at pytest.mark.parametrize(
+     ('color', 'stdout_error', 'stdout_body'),
+     [
+         (
+@@ -437,24 +329,3 @@
+ < stderror
+ """
+     )
+-
+-
+- at pytest.mark.network
+- at pytest.mark.parametrize('verbosity', [0, 1])
+-def test_verbose_output(
+-    capsys: pytest.CaptureFixture,
+-    monkeypatch,
+-    tmp_dir,
+-    package_test_flit,
+-    verbosity: int,
+-):
+-    monkeypatch.setenv('NO_COLOR', '')
+-
+-    cmd = [package_test_flit, '-w', '-o', tmp_dir]
+-    if verbosity:
+-        cmd.insert(0, f'-{"v" * verbosity}')
+-
+-    build.__main__.main(cmd)
+-
+-    stdout = capsys.readouterr().out.splitlines()
+-    assert sum(1 for o in stdout if o.startswith('> ')) == verbosity
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/python3-build.git/commitdiff/464d279d1a5a12dcdc6fd443158513d4c6c7596f



More information about the pld-cvs-commit mailing list