Initial package with version 0.10.0

This commit is contained in:
desert-sailor 2023-05-28 08:32:08 +08:00
parent 1b2aa68730
commit 281c7b5dae
3 changed files with 120 additions and 0 deletions

BIN
build-0.10.0.tar.gz Normal file

Binary file not shown.

84
python-build.spec Normal file
View File

@ -0,0 +1,84 @@
%global pypi_name build
Name: python-%{pypi_name}
Version: 0.10.0
Release: 1
Summary: A simple, correct PEP517 package builder
License: MIT
URL: https://github.com/pypa/build
Source0: %{url}/archive/%{version}/%{pypi_name}-%{version}.tar.gz
# Upstream patch for fixing tests with pip 23
Patch1: strip-formatting-from-stderr.patch
BuildArch: noarch
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-pip
BuildRequires: python3-wheel
BuildRequires: python3-editables
BuildRequires: python3-hatch-vcs
BuildRequires: python3-hatchling
BuildRequires: python3-virtualenv
BuildRequires: python3-pytest-cov
BuildRequires: python3-pytest-mock
BuildRequires: python3-pytest-rerunfailures
BuildRequires: python3-pytest-xdist
BuildRequires: python3-flit-core
BuildRequires: python3-pyproject-hooks
BuildRequires: python3-tox-current-env
%description
A simple, correct PEP517 package builder.
%package -n python3-%{pypi_name}
Summary: %{summary}
%description -n python3-%{pypi_name}
A simple, correct PEP517 package builder.
%pyproject_extras_subpkg -n python3-%{pypi_name} virtualenv
%prep
%autosetup -p1 -n %{pypi_name}-%{version}
%build
%pyproject_build
%install
%pyproject_install
%check
# The skipped tests require internet
TOX_TESTENV_PASSENV="${TOX_TESTENV_PASSENV:-*}" \
CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}" \
PATH="%{buildroot}%{_bindir}:$PATH" \
PYTHONPATH="${PYTHONPATH:-%{buildroot}%{python3_sitearch}:%{buildroot}%{python3_sitelib}}" \
PYTHONDONTWRITEBYTECODE=1 \
%{?__pytest_addopts:PYTEST_ADDOPTS="${PYTEST_ADDOPTS:-} %{__pytest_addopts}"} \
PYTEST_XDIST_AUTO_NUM_WORKERS=%{_smp_build_ncpus} \
%{__python3} -m tox -e py%{python3_version_nodots} --current-env \
-- -k "not (test_build_package or \
test_build_package_via_sdist or \
test_output[via-sdist-isolation] or \
test_output[wheel-direct-isolation] or \
test_wheel_metadata[True] or \
test_wheel_metadata_isolation or \
test_with_get_requires or \
test_build_sdist or \
test_build_wheel[from_sdist] or \
test_build_wheel[direct])"
%files -n python3-%{pypi_name}
%doc README.md
%license LICENSE
%{_bindir}/pyproject-build
%{python3_sitelib}/%{pypi_name}
%{python3_sitelib}/%{pypi_name}*.dist-info/
%changelog
* Sun May 28 2023 Dongxing Wang <dxwangk@isoftstone.com> - 0.10.0-1
- Initial package 0.10.0

View File

@ -0,0 +1,36 @@
From 4f5362fccc908820574fdbac2f6b6871c0f371c5 Mon Sep 17 00:00:00 2001
From: Henry Schreiner <henryschreineriii@gmail.com>
Date: Wed, 15 Mar 2023 09:33:53 -0400
Subject: [PATCH] tests: strip formatting from stderr (pip 23)
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
---
tests/test_main.py | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/tests/test_main.py b/tests/test_main.py
index e924d8bd..456ff749 100644
--- a/tests/test_main.py
+++ b/tests/test_main.py
@@ -20,6 +20,8 @@
cwd = os.getcwd()
out = os.path.join(cwd, 'dist')
+ANSI_STRIP = re.compile(r'\x1B(?:[@-Z\\-_]|\[[0-?]*[ -/]*[@-~])')
+
@pytest.mark.parametrize(
('cli_args', 'build_args', 'hook'),
@@ -368,8 +370,10 @@ def test_output_env_subprocess_error(
assert stdout[:4] == stdout_body
assert stdout[-1].startswith(stdout_error)
- assert len(stderr) == 1
- assert stderr[0].startswith('ERROR: Invalid requirement: ')
+ # Newer versions of pip also color stderr - strip them if present
+ cleaned_stderr = ANSI_STRIP.sub('', '\n'.join(stderr)).strip()
+ assert len(cleaned_stderr.splitlines()) == 1
+ assert cleaned_stderr.startswith('ERROR: Invalid requirement: ')
@pytest.mark.parametrize(