Bug 1739787 - Review Request: python-decopatch - A helper to write python decorators
Summary: Review Request: python-decopatch - A helper to write python decorators
Alias: None
Product: Fedora
Classification: Fedora
Component: Package Review
Version: rawhide
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
Assignee: Robert-André Mauchin 🐧
QA Contact: Fedora Extras Quality Assurance
Depends On: python-makefun
Blocks: 1739793
TreeView+ depends on / blocked
Reported: 2019-08-10 13:59 UTC by Zbigniew Jędrzejewski-Szmek
Modified: 2019-10-04 09:34 UTC (History)
2 users (show)

Fixed In Version: python-decopatch-1.4.6-1.fc32
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2019-09-14 13:29:01 UTC
Type: ---
zebob.m: fedora-review+

Attachments (Terms of Use)

Description Zbigniew Jędrzejewski-Szmek 2019-08-10 13:59:15 UTC
Spec URL: https://in.waw.pl/~zbyszek/fedora/python-decopatch.spec
SRPM URL: https://in.waw.pl/~zbyszek/fedora/python-decopatch-1.4.5-1.fc31.src.rpm
Because of a tiny oddity in the python language, writing decorators
without help can be a pain because you have to handle the
no-parenthesis usage explicitly. decopatch provides a simple way to
solve this issue so that writing decorators is simple and

Fedora Account System Username: zbyszek

Comment 1 Robert-André Mauchin 🐧 2019-08-22 16:55:56 UTC
 - Not familiar with Pyproject, shouldn't you also include the Python provide macro?

%package -n python3-decopatch
Summary: %{summary}
%{?python_provide:%python_provide python3-decopatch}

%description -n python3-decopatch %_description

 - Build fails:

+ cd decopatch-1.4.5
+ CFLAGS='-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection'
+ LDFLAGS='-Wl,-z,relro -Wl,--as-needed  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld'
+ /usr/bin/python3 -m pip wheel --no-deps --use-pep517 --no-build-isolation --disable-pip-version-check --progress-bar off --verbose .
BUILDSTDERR:     Running command /usr/bin/python3 /usr/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py prepare_metadata_for_build_wheel /tmp/tmpq7dztlbs
BUILDSTDERR:     Traceback (most recent call last):
BUILDSTDERR:       File "setup.py", line 22, in <module>
BUILDSTDERR:         from setuptools_scm import get_version
BUILDSTDERR:     ModuleNotFoundError: No module named 'setuptools_scm'

Seems the %generate_buildrequires part is broken:

Executing(%generate_buildrequires): /bin/sh -e /var/tmp/rpm-tmp.LdbKYs
+ umask 022
+ cd /builddir/build/BUILD
+ cd decopatch-1.4.5
+ echo python3-devel
+ echo 'python3dist(packaging)'
+ echo 'python3dist(pip) >= 19'
+ echo 'python3dist(pytoml)'
+ rm -rfv '*.dist-info/'
+ '[' -f /usr/bin/python3 ']'

The above packages are installed.

+ /usr/bin/python3 -I /usr/lib/rpm/redhat/pyproject_buildrequires.py
BUILDSTDERR: Handling pytest-runner from build-system.requires
BUILDSTDERR: Handling setuptools_scm from build-system.requires
BUILDSTDERR: Handling pypandoc from build-system.requires
BUILDSTDERR: Handling six from build-system.requires
BUILDSTDERR: Requirement satisfied: six
BUILDSTDERR:    (installed: six 1.12.0)
BUILDSTDERR: Exiting dependency generation pass: build backend
+ RPM_EC=0
BUILDSTDERR: ++ jobs -p
+ exit 0
python3dist(pip) >= 19

The ones detected above are not.

See scratch: https://koji.fedoraproject.org/koji/taskinfo?taskID=37225926

The current macros seems broken: in order to run pyproject_buildrequires.py, you need packaging, pip and pytoml. They are included in the %generate_buildrequires macro, but are installed after the call to pyproject_buildrequires.py

%pyproject_buildrequires(rxte:) %{expand:\\\
%{-e:%{expand:%global toxenv %{-e*}}}
echo 'python3-devel'
echo 'python3dist(packaging)'
echo 'python3dist(pip) >= 19'
echo 'python3dist(pytoml)'
# setuptools assumes no pre-existing dist-info
rm -rfv *.dist-info/
if [ -f %{__python3} ]; then
  RPM_TOXENV="%{toxenv}" %{__python3} -I %{_rpmconfigdir}/redhat/pyproject_buildrequires.py %{?**}

Hence the pyproject_buildrequires.py script fails to run. It seems it only work on a warm chroot with packaging, pip and pytoml already installed.

Comment 2 Robert-André Mauchin 🐧 2019-08-22 17:09:33 UTC
According to Miro, it needs Mock 1.4.17 to do multiples passes of generate_buildrequires.

 - include the Python provide macro

%package -n python3-decopatch
Summary: %{summary}
%{?python_provide:%python_provide python3-decopatch}

%description -n python3-decopatch %_description

Package approved, please fix the aforementioned issue and wait for Mock 1.4.17 deployment.

Package Review

[x] = Pass, [!] = Fail, [-] = Not applicable, [?] = Not evaluated
[ ] = Manual review needed

===== MUST items =====

[x]: Package is licensed with an open-source compatible license and meets
     other legal requirements as defined in the legal section of Packaging
[x]: License field in the package spec file matches the actual license.
     Note: Checking patched sources after %prep for licenses. Licenses
     found: "Unknown or generated", "BSD 3-clause "New" or "Revised"
     License", "*No copyright* BSD (unspecified)". 40 files have unknown
     license. Detailed output of licensecheck in
[x]: Package contains no bundled libraries without FPC exception.
[x]: Changelog in prescribed format.
[x]: Sources contain only permissible code or content.
[-]: Package contains desktop file if it is a GUI application.
[-]: Development files must be in a -devel package
[x]: Package uses nothing in %doc for runtime.
[x]: Package consistently uses macros (instead of hard-coded directory
[x]: Package is named according to the Package Naming Guidelines.
[x]: Package does not generate any conflict.
[x]: Package obeys FHS, except libexecdir and /usr/target.
[-]: If the package is a rename of another package, proper Obsoletes and
     Provides are present.
[x]: Requires correct, justified where necessary.
[x]: Spec file is legible and written in American English.
[-]: Package contains systemd file(s) if in need.
[x]: Package is not known to require an ExcludeArch tag.
[-]: Large documentation must go in a -doc subpackage. Large could be size
     (~1MB) or number of files.
     Note: Documentation size is 10240 bytes in 1 files.
[x]: Package complies to the Packaging Guidelines
[x]: Package successfully compiles and builds into binary rpms on at least
     one supported primary architecture.
[x]: Rpmlint is run on all rpms the build produces.
     Note: No rpmlint messages.
[x]: If (and only if) the source package includes the text of the
     license(s) in its own file, then that file, containing the text of the
     license(s) for the package is included in %license.
[x]: Package requires other packages for directories it uses.
[x]: Package does not own files or directories owned by other packages.
[x]: Package uses either %{buildroot} or $RPM_BUILD_ROOT
[x]: Package does not run rm -rf %{buildroot} (or $RPM_BUILD_ROOT) at the
     beginning of %install.
[x]: Macros in Summary, %description expandable at SRPM build time.
[x]: Dist tag is present.
[x]: Package does not contain duplicates in %files.
[x]: Permissions on files are set properly.
[x]: Package use %makeinstall only when make install DESTDIR=... doesn't
[x]: Package is named using only allowed ASCII characters.
[x]: Package does not use a name that already exists.
[x]: Package is not relocatable.
[x]: Sources used to build the package match the upstream source, as
     provided in the spec URL.
[x]: Spec file name must match the spec package %{name}, in the format
[x]: File names are valid UTF-8.
[x]: Packages must not store files under /srv, /opt or /usr/local

[x]: Python eggs must not download any dependencies during the build
[x]: A package which is used by another package via an egg interface should
     provide egg info.
[!]: Package meets the Packaging Guidelines::Python
[x]: Packages MUST NOT have dependencies (either build-time or runtime) on
     packages named with the unversioned python- prefix unless no properly
     versioned package exists. Dependencies on Python packages instead MUST
     use names beginning with python2- or python3- as appropriate.
[x]: Python packages must not contain %{pythonX_site(lib|arch)}/* in %files
[x]: Binary eggs must be removed in %prep

===== SHOULD items =====

[-]: If the source package does not include license text(s) as a separate
     file from upstream, the packager SHOULD query upstream to include it.
[x]: Final provides and requires are sane (see attachments).
[?]: Package functions as described.
[x]: Latest version is packaged.
[x]: Package does not include license text files separate from upstream.
[-]: Description and summary sections in the package spec file contains
     translations for supported Non-English languages, if available.
[x]: Package should compile and build into binary rpms on all supported
[x]: %check is present and all tests pass.
[x]: Packages should try to preserve timestamps of original installed
[x]: Reviewer should test that the package builds in mock.
[x]: Buildroot is not present
[x]: Package has no %clean section with rm -rf %{buildroot} (or
[x]: No file requires outside of /etc, /bin, /sbin, /usr/bin, /usr/sbin.
[x]: Packager, Vendor, PreReq, Copyright tags should not be in spec file
[x]: Sources can be downloaded from URI in Source: tag
[x]: SourceX is a working URL.
[x]: Spec use %global instead of %define unless justified.

===== EXTRA items =====

[x]: Rpmlint is run on all installed packages.
[x]: Spec file according to URL is the same as in SRPM.

Checking: python3-decopatch-1.4.5-1.fc32.noarch.rpm
2 packages and 0 specfiles checked; 0 errors, 0 warnings.

Comment 3 Zbigniew Jędrzejewski-Szmek 2019-09-13 08:22:02 UTC

- new version
- add missing %python_provides

Spec URL: https://in.waw.pl/~zbyszek/fedora/python-decopatch.spec
SRPM URL: https://in.waw.pl/~zbyszek/fedora/python-decopatch-1.4.6-1.fc32.src.rpm

Comment 4 Gwyn Ciesla 2019-09-13 13:03:48 UTC
(fedscm-admin):  The Pagure repository was created at https://src.fedoraproject.org/rpms/python-decopatch

Comment 5 Zbigniew Jędrzejewski-Szmek 2019-09-14 13:29:01 UTC
Building in rawhide now.

Note You need to log in before you can comment on or make changes to this bug.