Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1929992 - Review Request: python-wcmatch - Wildcard/glob file name matcher
Summary: Review Request: python-wcmatch - Wildcard/glob file name matcher
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: Package Review
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Miro Hrončok
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On: 1929990 1929991
Blocks: 1913796 1930968
TreeView+ depends on / blocked
 
Reported: 2021-02-18 06:25 UTC by Parag Nemade
Modified: 2021-04-13 09:34 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-04-13 09:34:12 UTC
Type: ---
Embargoed:
mhroncok: fedora-review+


Attachments (Terms of Use)

Description Parag Nemade 2021-02-18 06:25:54 UTC
Spec URL: https://pnemade.fedorapeople.org/fedora-work/python-wcmatch.spec
SRPM URL: https://pnemade.fedorapeople.org/fedora-work/python-wcmatch-8.1.1-1.fc34.src.rpm

Description:
Wildcard Match provides an enhanced fnmatch, glob, and pathlib library in order
to provide file matching and globbing that more closely follows the features
found in Bash. In some ways these libraries are similar to Python's builtin
libraries as they provide a similar interface to match, filter, and glob the
file system. But they also include a number of features found in Bash's
globbing such as backslash escaping, brace expansion, extended glob pattern
groups, etc. They also add a number of new useful functions as well, such as
globmatch which functions like fnmatch, but for paths.

Fedora Account System Username: pnemade

Comment 2 Karolina Surma 2021-03-09 10:37:07 UTC
Hi Parag,

When using mock to build the package, one of the tests fails, resulting in failing the build.
The test will fail each time user name is different than their home directory, which is case both mock and koji. 
The problematic test: https://github.com/facelessuser/wcmatch/blob/master/tests/test_glob.py#L1475

The koji failed build: https://koji.fedoraproject.org/koji/taskinfo?taskID=63406570
See the %check traceback in build.log:

Executing(%check): /bin/sh -e /var/tmp/rpm-tmp.09HkyO
+ umask 022
+ cd /builddir/build/BUILD
+ cd wcmatch-8.1.1
+ /usr/bin/python3 setup.py test
/builddir/build/BUILD/wcmatch-8.1.1/setup.py:6: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
  import imp
running test
WARNING: Testing via this command is deprecated and will be removed in a future version. Users looking for a generic test entry point independent of test runner are encouraged to use tox.
running egg_info
writing wcmatch.egg-info/PKG-INFO
writing dependency_links to wcmatch.egg-info/dependency_links.txt
writing requirements to wcmatch.egg-info/requires.txt
writing top-level names to wcmatch.egg-info/top_level.txt
reading manifest file 'wcmatch.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching '*.png' under directory 'docs/src/markdown'
warning: no files found matching '*.gif' under directory 'docs/src/markdown'
warning: no files found matching '*.html' under directory 'docs/src/markdown'
warning: no files found matching '*.js' under directory 'docs/theme'
warning: no files found matching '*.css' under directory 'docs/theme'
warning: no previously-included files matching '*' found under directory 'site'
writing manifest file 'wcmatch.egg-info/SOURCES.txt'
running build_ext
test_limit_filter (tests.test_fnmatch.TestExpansionLimit)
Test expansion limit of `filter`. ... ok
test_limit_fnmatch (tests.test_fnmatch.TestExpansionLimit)
Test expansion limit of `fnmatch`. ... ok
test_limit_translate (tests.test_fnmatch.TestExpansionLimit)
Test expansion limit of `translate`. ... ok
test_escape (tests.test_fnmatch.TestFnMatchEscapes)
Test path escapes. ... ok
test_escape_forced_unix (tests.test_fnmatch.TestFnMatchEscapes)
Test forced windows Unix. ... ok
...
test_tilde_user (tests.test_glob.TestTilde)
Test tilde user cases. ... ERROR


======================================================================
ERROR: test_tilde_user (tests.test_glob.TestTilde)
Test tilde user cases.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/wcmatch-8.1.1/tests/test_glob.py", line 1449, in test_tilde_user
    files = os.listdir(os.path.expanduser('~{}'.format(user)))
FileNotFoundError: [Errno 2] No such file or directory: '~builddir'

----------------------------------------------------------------------
Ran 164 tests in 0.113s

FAILED (errors=1, skipped=6)
Test failed: <unittest.runner.TextTestResult run=164 errors=1 failures=0>
error: Test failed: <unittest.runner.TextTestResult run=164 errors=1 failures=0>


RPM build errors:
error: Bad exit status from /var/tmp/rpm-tmp.09HkyO (%check)
    Bad exit status from /var/tmp/rpm-tmp.09HkyO (%check)
Finish: rpmbuild python-wcmatch-8.1.1-3.fc34.src.rpm
Finish: build phase for python-wcmatch-8.1.1-3.fc34.src.rpm
ERROR: Exception(python-wcmatch-8.1.1-3.fc34.src.rpm) Config(fedora-rawhide-x86_64) 0 minutes 9 seconds
INFO: Results and/or logs in: /var/lib/mock/fedora-rawhide-x86_64/result
ERROR: Command failed: 
 # /usr/bin/systemd-nspawn -q -M b556ebe77fe3400796fae2e22b7041f1 -D /var/lib/mock/fedora-rawhide-x86_64/root -a -u mockbuild --capability=cap_ipc_lock --bind=/tmp/mock-resolv.clfu3yyk:/etc/resolv.conf --bind=/dev/btrfs-control --bind=/dev/loop-control --bind=/dev/loop0 --bind=/dev/loop1 --bind=/dev/loop2 --bind=/dev/loop3 --bind=/dev/loop4 --bind=/dev/loop5 --bind=/dev/loop6 --bind=/dev/loop7 --bind=/dev/loop8 --bind=/dev/loop9 --bind=/dev/loop10 --bind=/dev/loop11 --console=pipe --setenv=TERM=vt100 --setenv=SHELL=/bin/bash --setenv=HOME=/builddir --setenv=HOSTNAME=mock --setenv=PATH=/usr/bin:/bin:/usr/sbin:/sbin --setenv=PROMPT_COMMAND=printf "\033]0;<mock-chroot>\007" --setenv=PS1=<mock-chroot> \s-\v\$  --setenv=LANG=C.UTF-8 --resolv-conf=off bash --login -c /usr/bin/rpmbuild -bb --target x86_64 --nodeps /builddir/build/SPECS/python-wcmatch.spec

Comment 3 Lumír Balhar 2021-03-09 11:37:31 UTC
It seems to me that the tests in TestTilde class are not ready for kinda specific settings in mock.

>>> os.path.expanduser('~')
'/builddir'
>>> os.path.basename(os.path.expanduser('~'))
'builddir'
>>> os.path.expanduser('~{}'.format(user))
'~builddir'

I believe that this one failing test can be skipped.

Comment 4 Miro Hrončok 2021-03-09 11:56:38 UTC
This test has wrong assumptions (that username == basename(homedir)). It can be skipped temporarily, but it should be reported to upstream.

Comment 5 Miro Hrončok 2021-03-09 11:58:58 UTC
Replacing os.path.basename(os.path.expanduser('~')) with getpass.getuser() should fix the test.

Comment 7 Lumír Balhar 2021-03-10 10:14:53 UTC
Quick comment related to the failing test: Upstream uses pytest so you can use %pytest macro to run tests and then you should not ignore the results of the tests by ` ||:` - better would be to skip just the one failing test.

See https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_macros

But feel free to wait for a more complete review and fix all possible issues at once.

Comment 8 Karolina Surma 2021-03-11 08:47:09 UTC
As Lumir mentioned above, %check should not ignore all test results.

No other issues were found.


Package Review
==============

Legend:
[x] = Pass, [!] = Fail, [-] = Not applicable


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

Generic:
[x]: Package is licensed with an open-source compatible license and meets
     other legal requirements as defined in the legal section of Packaging
     Guidelines.
[x]: License field in the package spec file matches the actual license.
[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
[-]: Package uses nothing in %doc for runtime.
[x]: Package consistently uses macros (instead of hard-coded directory
     names).
[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]: Package installs properly.
[x]: Rpmlint is run on all rpms the build produces.
[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 must own all directories that it creates.
[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 must not depend on deprecated() packages.
[x]: Package use %makeinstall only when make install DESTDIR=... doesn't
     work.
[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
     %{name}.spec.
[x]: File names are valid UTF-8.
[x]: Packages must not store files under /srv, /opt or /usr/local

Python:
[x]: Python eggs must not download any dependencies during the build
     process.
[x]: A package which is used by another package via an egg interface should
     provide egg info.
[x]: Package meets the Packaging Guidelines::Python
[x]: Package contains BR: python2-devel or python3-devel
[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 =====

Generic:
[-]: 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).
[x]: Package functions as described.
[x]: Latest version is packaged.
[x]: Package does not include license text files separate from upstream.
[-]: Sources are verified with gpgverify first in %prep if upstream
     publishes signatures.
     Note: gpgverify is not used.
[-]: 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
     architectures.
[!]: %check is present and all tests pass.
[x]: Packages should try to preserve timestamps of original installed
     files.
[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
     $RPM_BUILD_ROOT)
[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 =====

Generic:
[x]: Rpmlint is run on all installed packages.
     Note: Rpmlint complains only about the names of packages - ignoring.
[x]: Spec file according to URL is the same as in SRPM.


Requires
--------
python3-wcmatch (rpmlib, GLIBC filtered):
    python(abi)
    python3.9dist(bracex)
    python3dist(bracex)


Provides
--------
python3-wcmatch:
    python-wcmatch
    python3-wcmatch
    python3.9-wcmatch
    python3.9dist(wcmatch)
    python3dist(wcmatch)

Comment 10 Karolina Surma 2021-03-11 12:20:36 UTC
The package can be approved.


Suggestions:
1) Explicit Requires is not necessary, it is generated automatically. You can remove the line:
Requires:       python3dist(bracex) >= 2.1.1

2) You can use %pytest macro (replace "%python3 -m pytest")
It is maintained and ensures that future updates will work as expected.
It also provides some additional features, eg. tests everything that is installed, while direct call tests current working directory. 

3) It is better to skip the one failing test instead of the whole test file.
Current results of check:

======================= 859 passed, 64 skipped in 2.77s ========================

If used command: %pytest -vv -k "not test_tilde_user"

=============== 1141 passed, 148 skipped, 1 deselected in 2.65s ================

Comment 11 Miro Hrončok 2021-03-11 13:17:11 UTC
> The package can be approved.

I'm doing that on behalf of Karolina.

I agree with all the 3 suggestions, but there are not blockers.

Comment 12 Parag Nemade 2021-03-12 08:54:49 UTC
Thank you all for your suggestions and approving this package.

Spec URL: https://pnemade.fedorapeople.org/fedora-work/SPECS/python-wcmatch.spec
SRPM URL: https://pnemade.fedorapeople.org/fedora-work/SRPMS/python-wcmatch-8.1.2-3.fc34.src.rpm

Comment 13 Miro Hrončok 2021-03-12 08:57:10 UTC
(In reply to Karolina Surma from comment #10)
> 1) Explicit Requires is not necessary, it is generated automatically. You
> can remove the line:
> Requires:       python3dist(bracex) >= 2.1.1

This one is still there ^

The other 2 suggestions have been fixed:

> 2) You can use %pytest macro (replace "%python3 -m pytest")
> ...
> 
> 3) It is better to skip the one failing test instead of the whole test file.
> ...

Comment 14 Parag Nemade 2021-03-12 09:12:41 UTC
I think I have fixed that as well. I can see SPEC is already fixed. I also downloaded SRPM, extracted still no "2.1.1" in spec file.

Can you please check again?

Comment 15 Miro Hrončok 2021-03-12 09:38:05 UTC
Oh. I haven't noticed this at first, but it appears that you have changed:

  Requires:       python3dist(bracex) >= 2.1.1

To:

  Requires:       python3dist(bracex)


But the suggestion was to *remove* the line entirely. The upstream metadata already generate the requirement instead.

Comment 16 Parag Nemade 2021-03-12 09:53:43 UTC
ah sorry. Missed that. Corrected in same release.

Spec URL: https://pnemade.fedorapeople.org/fedora-work/SPECS/python-wcmatch.spec
SRPM URL: https://pnemade.fedorapeople.org/fedora-work/SRPMS/python-wcmatch-8.1.2-3.fc34.src.rpm

Comment 17 Tomas Hrcka 2021-03-12 12:56:25 UTC
(fedscm-admin):  The Pagure repository was created at https://src.fedoraproject.org/rpms/python-wcmatch


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