Hello community, here is the log from the commit of package python-rpm-macros for openSUSE:Leap:15.2 checked in at 2020-02-16 18:25:47 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Leap:15.2/python-rpm-macros (Old) and /work/SRC/openSUSE:Leap:15.2/.python-rpm-macros.new.26092 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-rpm-macros" Sun Feb 16 18:25:47 2020 rev:23 rq:770828 version:20200117.8e39013 Changes: -------- --- /work/SRC/openSUSE:Leap:15.2/python-rpm-macros/python-rpm-macros.changes 2020-01-15 15:52:43.295573081 +0100 +++ /work/SRC/openSUSE:Leap:15.2/.python-rpm-macros.new.26092/python-rpm-macros.changes 2020-02-16 18:25:48.294638982 +0100 @@ -1,0 +2,53 @@ +Mon Jan 20 18:35:19 UTC 2020 - Neal Gompa <[email protected]> + +- Add python-rpm-generators to express setuptools dependency for generator + +------------------------------------------------------------------- +Fri Jan 17 13:09:29 UTC 2020 - Neal Gompa <[email protected]> + +- Update to version 20200117.8e39013 bsc#1161770: + * Add macros related to the Python dist metadata dependency generator + +------------------------------------------------------------------- +Mon Nov 04 10:10:58 UTC 2019 - [email protected] + +- Update to version 20191104.08e6493: + * %pyproject_install macro should include --no-compile. + * Recognise the _ for the macro arguments too + +------------------------------------------------------------------- +Mon Jun 10 11:34:32 UTC 2019 - [email protected] + +- Update to version 20190610.2ee3233: + * Fix typo, missing opening brace. + * Add the first draft of pyproject_wheel and pyproject_install macros. + * Yet another attempt to preserve $PYTHONPATH set in the environment. + * Document also %pytest_arch + * Document %pytest in README.md + * Multiline macros don't work correctly on older RPMs. + * Add missing $ expansion on the pytest call + * Rewrite pytest and pytest_arch into Lua macros with multiple arguments. + * We should preserve existing PYTHONPATH. + * Add --ignore to pytest calls to ignore build directories. + +------------------------------------------------------------------- +Mon Jun 10 11:27:22 UTC 2019 - [email protected] + +- Update to version 20190610.2ee3233: + * Fix typo, missing opening brace. + +------------------------------------------------------------------- +Mon May 20 12:38:10 UTC 2019 - [email protected] + +- Update to version 20190511.2ed22b6: + * Add the first draft of pyproject_wheel and pyproject_install macros. + +------------------------------------------------------------------- +Thu May 02 06:10:17 UTC 2019 - [email protected] + +- Update to version 20190430.5260267: + * Yet another attempt to preserve $PYTHONPATH set in the environment. + * Document also %pytest_arch + * Document %pytest in README.md + +------------------------------------------------------------------- Old: ---- python-rpm-macros-20190408.32abece.tar.bz2 New: ---- python-rpm-macros-20200117.8e39013.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-rpm-macros.spec ++++++ --- /var/tmp/diff_new_pack.mEQCz1/_old 2020-02-16 18:25:48.598639142 +0100 +++ /var/tmp/diff_new_pack.mEQCz1/_new 2020-02-16 18:25:48.598639142 +0100 @@ -1,7 +1,7 @@ # # spec file for package python-rpm-macros # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2020 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,16 +17,17 @@ Name: python-rpm-macros -Version: 20190408.32abece +Version: 20200117.8e39013 Release: 0 Summary: RPM macros for building of Python modules License: WTFPL -Group: Development/Tools/Other URL: https://github.com/opensuse/python-rpm-macros Source: python-rpm-macros-%{version}.tar.bz2 # Fedora compatibility Provides: python2-rpm-macros Provides: python3-rpm-macros +# To keep user expectations reasonably sane +Recommends: python-rpm-generators BuildArch: noarch %description @@ -34,6 +35,18 @@ You should BuildRequire this package unless you are sure that you are only building for distros newer than Leap 42.2 +%package -n python-rpm-generators +Summary: Dependency generator dependencies for Python RPMs +Requires: %{name} = %{version}-%{release} +# Fedora compatibility +Provides: python3-rpm-generators +# For the dep generator macros +Requires: python3-setuptools + +%description -n python-rpm-generators +This package contains the dependencies for Python RPMs to generate +dependencies automatically. + %prep %setup -q %if 0%{?suse_version} < 1330 @@ -52,4 +65,7 @@ %doc README.md %{_rpmconfigdir}/macros.d/macros.python_all +%files -n python-rpm-generators +# Nothing here for now... + %changelog ++++++ _servicedata ++++++ --- /var/tmp/diff_new_pack.mEQCz1/_old 2020-02-16 18:25:48.634639161 +0100 +++ /var/tmp/diff_new_pack.mEQCz1/_new 2020-02-16 18:25:48.634639161 +0100 @@ -1,4 +1,4 @@ <servicedata> <service name="tar_scm"> <param name="url">git://github.com/openSUSE/python-rpm-macros.git</param> - <param name="changesrevision">32abece840d9845803d519996ecf2e87c41ed317</param></service></servicedata> \ No newline at end of file + <param name="changesrevision">8e390130273e5c31158c8c829970d378d62e74ae</param></service></servicedata> \ No newline at end of file ++++++ python-rpm-macros-20190408.32abece.tar.bz2 -> python-rpm-macros-20200117.8e39013.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-rpm-macros-20190408.32abece/README.md new/python-rpm-macros-20200117.8e39013/README.md --- old/python-rpm-macros-20190408.32abece/README.md 2019-04-08 14:39:33.000000000 +0200 +++ new/python-rpm-macros-20200117.8e39013/README.md 2020-01-17 13:31:41.000000000 +0100 @@ -77,6 +77,17 @@ * __`%{python_module modname [= version]}`__ expands to `$flavor-modname [= version]` for every flavor. Intended as: `BuildRequires: %{python_module foo}`. +* __`%{python_dist_name modname}`__. Given a standardized name (i.e. dist name, name on PyPI) of `modname`, +it will convert it to a canonical format. + +* __`%{python2_dist modname}`__. Given a standardized name (i.e. dist name, name on PyPI) of `modname`, +it will convert it to a canonical format, and evaluates to python2.Ydist(CANONICAL_NAME), which is useful +when listing dependencies. Intended as `(Build)Requires: %{python2_dist foo}`. + +* __`%{python3_dist modname}`__. Given a standardized name (i.e. dist name, name on PyPI) of `modname`, +it will convert it to a canonical format, and evaluates to python3.Ydist(CANONICAL_NAME), which is useful +when listing dependencies. Intended as `(Build)Requires: %{python3_dist foo}`. + * __`%python_flavor`__ expands to the `%pythons` entry that is currently being processed. Does not apply in `%prep`, `%build`, `%install` and `%check` sections, except when evaluated as `%{$python_flavor}` in `%python_expand`. @@ -111,6 +122,13 @@ `python3 generatefile.py %python3_bin_suffix` etc. +* __`%pytest`__ runs `pytest` in all flavors with appropriate environmental variables +(namely, it sets `$PYTHONPATH` to ``%{python_sitelib}``). All paramteres to this macro are +passed without change to the pytest command. Explicit `BuildRequires` on `%{python_module pytest}` +is still required. + +* __`%pytest_arch`__ the same as the above, except it sets ``$PYTHONPATH`` to ``%{$python_sitearch}`` + * __`%python_clone filename`__ creates a copy of `filename` under a flavor-specific name for every flavor. This is useful for packages that install unversioned executables: `/usr/bin/foo` is copied to `/usr/bin/foo-%{python_bin_suffix}` for all flavors, and the shebang is modified accordingly. @@ -126,6 +144,12 @@ * __`%python_subpackages`__ expands to the autogenerated subpackages. This should go at the end of the main headers section. +* __`%python_enable_dependency_generator`__ expands to a define to enable automatic requires generation +of Python module dependencies using egg-info/dist-info metadata. This should go above the +`%python_subpackages` macro, preferably closer to the top of the spec. Intended usage: +`%{?python_enable_dependency_generator}`. This macro will eventually be removed when the generator +is configured to automatically run, hence the `?` at the beginning of the macro invocation. + Alternative-related, general: * __`%prepare_alternative [-t <targetfile> ] <name>`__ replaces `<targetfile>` with a symlink to diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-rpm-macros-20190408.32abece/macros/010-common-defs new/python-rpm-macros-20200117.8e39013/macros/010-common-defs --- old/python-rpm-macros-20190408.32abece/macros/010-common-defs 2019-04-08 14:39:33.000000000 +0200 +++ new/python-rpm-macros-20200117.8e39013/macros/010-common-defs 2020-01-17 13:31:41.000000000 +0100 @@ -49,7 +49,73 @@ %py_ver %python_version -##### testing commands ##### +##### Python dependency generator macros ##### -%pytest_arch(+abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-=) %{lua: local args = rpm.expand("%**") print(rpm.expand("%{python_expand PYTHONPATH=%{buildroot}%{$python_sitearch} py.test-%{$python_bin_suffix} --ignore=_build.python2 --ignore=_build.python3 --ignore=_build.pypy3 -v " .. args .. "}")) } -%pytest(+abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-=) %{lua: local args = rpm.expand("%**") print(rpm.expand("%{python_expand PYTHONPATH=%{buildroot}%{$python_sitelib} py.test-%{$python_bin_suffix} --ignore=_build.python2 --ignore=_build.python3 --ignore=_build.pypy3 -v " .. args .. "}")) } +# === Macros for Build/Requires tags using Python dist tags === +# - https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages + +# Converts Python dist name to a canonical format +%python_dist_name() %{lua:\ + name = rpm.expand("%{?1:%{1}}");\ + canonical = string.gsub(string.lower(name), "[^%w%.]+", "-");\ + print(canonical);\ +} + +# Creates Python 2 dist tag(s) after converting names to canonical format +# Needs to first put all arguments into a list, because invoking a different +# macro (%python_dist_name) overwrites them +%python2_dist() %{lua:\ + args = {}\ + arg = 1\ + while (true) do\ + name = rpm.expand("%{?" .. arg .. ":%{" .. arg .. "}}");\ + if (name == nil or name == '') then\ + break\ + end\ + args[arg] = name\ + arg = arg + 1\ + end\ + for arg, name in ipairs(args) do\ + canonical = rpm.expand("%python_dist_name " .. name);\ + print("python" .. rpm.expand("%python2_version") .. "dist(" .. canonical .. ") ");\ + end\ +} + +# Creates Python 3 dist tag(s) after converting names to canonical format +# Needs to first put all arguments into a list, because invoking a different +# macro (%python_dist_name) overwrites them +%python3_dist() %{lua:\ + args = {}\ + arg = 1\ + while (true) do\ + name = rpm.expand("%{?" .. arg .. ":%{" .. arg .. "}}");\ + if (name == nil or name == '') then\ + break\ + end\ + args[arg] = name\ + arg = arg + 1\ + end\ + for arg, name in ipairs(args) do\ + canonical = rpm.expand("%python_dist_name " .. name);\ + print("python" .. rpm.expand("%python3_version") .. "dist(" .. canonical .. ") ");\ + end\ +} + +# === Macros to control dependency generator === +# - https://fedoraproject.org/wiki/Changes/EnablingPythonGenerators +%python_enable_dependency_generator() \ +%global __pythondist_requires %{_rpmconfigdir}/pythondistdeps.py --requires \ +%{nil} + +##### Pytest macros ##### + +%pytest_arch(+abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-=) %{lua: local args = rpm.expand("%**") print(rpm.expand("%{python_expand PYTHONPATH=$PYTHONPATH:%{buildroot}%{$python_sitearch} py.test-%{$python_bin_suffix} --ignore=_build.python2 --ignore=_build.python3 --ignore=_build.pypy3 -v " .. args .. "}")) } +%pytest(+abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-=) %{lua: local args = rpm.expand("%**") print(rpm.expand("%{python_expand PYTHONPATH=$PYTHONPATH:%{buildroot}%{$python_sitelib} py.test-%{$python_bin_suffix} --ignore=_build.python2 --ignore=_build.python3 --ignore=_build.pypy3 -v " .. args .. "}")) } + +##### PEP-518 macros ##### +%pyproject_wheel(+abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-=) %{lua: local args = rpm.expand("%**") print(rpm.expand("%{python_expand $python -mpip wheel --no-deps %{?py_setup_args:--build-option %{py_setup_args}} --use-pep517 --no-build-isolation --progress-bar off --verbose . " .. args .. "}")) } + +# No such option: --strip-file-prefix %%{buildroot} +%pyproject_install(+abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-=) %{lua: local args = rpm.expand("%**") print(rpm.expand("%{python_expand $python -mpip install --root %{buildroot} --no-compile --no-deps --progress-bar off *.whl " .. args .. "}")) } + +#vi:tw=0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-rpm-macros-20190408.32abece/macros/030-fallbacks new/python-rpm-macros-20200117.8e39013/macros/030-fallbacks --- old/python-rpm-macros-20190408.32abece/macros/030-fallbacks 2019-04-08 14:39:33.000000000 +0200 +++ new/python-rpm-macros-20200117.8e39013/macros/030-fallbacks 2020-01-17 13:31:41.000000000 +0100 @@ -16,4 +16,8 @@ %py2_ver %python2_version %py3_ver %python3_version +%py_dist_name() %{python_dist_name %{?**}} +%py2_dist() %{python2_dist %{?**}} +%py3_dist() %{python3_dist %{?**}} + %python2_prefix %{?python2_package_prefix}%{?!python2_package_prefix:python}
