| |
@@ -45,6 +45,29 @@
|
| |
BuildRequires: python3-rpm-generators
|
| |
%endif # without bootstrap
|
| |
|
| |
+ # Virtual provides for the packages bundled by setuptools.
|
| |
+ # You can find the versions in setuptools/setuptools/_vendor/vendored.txt
|
| |
+ # We cannot read them at this point, but we can assert their validity in %%check
|
| |
+ %{lua:
|
| |
+ bundled = {
|
| |
+ packaging="16.8",
|
| |
+ pyparsing="2.2.1",
|
| |
+ six="1.10.0",
|
| |
+ appdirs="1.4.3",
|
| |
+ }
|
| |
+ }
|
| |
+ %global bundled_file pkg_resources/_vendor/vendored.txt
|
| |
+ %global bundled %{lua:
|
| |
+ for name in pairs(bundled) do
|
| |
+ print("Provides: bundled(python3dist(" .. name .. ")) = " .. bundled[name] .. "\\n")
|
| |
+ end
|
| |
+ }
|
| |
+ %global bundled_file_expected %{lua:
|
| |
+ for name in pairs(bundled) do
|
| |
+ print(name .. "==" .. bundled[name] .. "\\\\n")
|
| |
+ end
|
| |
+ }
|
| |
+
|
| |
%description
|
| |
Setuptools is a collection of enhancements to the Python distutils that allow
|
| |
you to more easily build and distribute Python packages, especially ones that
|
| |
@@ -53,15 +76,6 @@
|
| |
This package also contains the runtime components of setuptools, necessary to
|
| |
execute the software that requires pkg_resources.
|
| |
|
| |
- # Virtual provides for the packages bundled by setuptools.
|
| |
- # You can find the versions in setuptools/setuptools/_vendor/vendored.txt
|
| |
- %global bundled %{expand:
|
| |
- Provides: bundled(python3dist(packaging)) = 16.8
|
| |
- Provides: bundled(python3dist(pyparsing)) = 2.2.1
|
| |
- Provides: bundled(python3dist(six)) = 1.10.0
|
| |
- Provides: bundled(python3dist(appdirs)) = 1.4.3
|
| |
- }
|
| |
-
|
| |
%package -n python3-setuptools
|
| |
Summary: Easily build and distribute Python 3 packages
|
| |
Conflicts: python-setuptools < %{version}-%{release}
|
| |
@@ -142,8 +156,14 @@
|
| |
%endif
|
| |
|
| |
|
| |
- %if %{with tests}
|
| |
%check
|
| |
+ # Assert our bundling info is correct
|
| |
+ # NB: this is not bash, so <(sort ...) doesn't work
|
| |
+ sort %{bundled_file} > upstream_info
|
| |
+ echo -ne '%{bundled_file_expected}' | sort > downstream_info
|
| |
+ diff -Bbu upstream_info downstream_info
|
| |
+
|
| |
+ %if %{with tests}
|
| |
# --ignore=pavement.py:
|
| |
# pavement.py is only used by upstream to do releases and vendoring, we don't ship it
|
| |
PYTHONDONTWRITEBYTECODE=1 PYTHONPATH=$(pwd) pytest-%{python3_version} \
|
| |
We repeatadly forget to update the list of bndled provides.
This is a proof of concept of validating the provides in %check.
It is not very elegant, but if we like the idea, I can macronize most of this, so the usage would only be:
And we could reuse it in setuptools, pip, pipenv...