Bug 2095005 - Review Request: python-rfc3339-validator - Pure python RFC3339 validator
Summary: Review Request: python-rfc3339-validator - Pure python RFC3339 validator
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: Package Review
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Maxwell G
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 2106174 (view as bug list)
Depends On:
Blocks: 2095974 2101857
TreeView+ depends on / blocked
 
Reported: 2022-06-08 19:36 UTC by Ben Beasley
Modified: 2022-07-21 17:09 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-07-07 00:45:06 UTC
Type: ---
Embargoed:
maxwell: fedora-review+


Attachments (Terms of Use)

Comment 1 Maxwell G 2022-06-29 02:42:02 UTC
This looks prety good. I have a couple minor, nitpicky comments:

> BuildRequires:  python3dist(pytest-runner)
> BuildRequires:  [...]

As we discussed in #fedora-python, this should be removed and patched out of the setup.py if the later is necessary. This is probably worthwhile to bring up upstream. There's a tox env that pulls in testing dependencies, but it's not particularly useful due to pinning and extra stuff like coverage or twine.

Also, I prefer the %{py3_dist X} dependency format over python3dist. It's less typing and it respects the value of %python3_pkgversion, which occasionally needs to be changed, such as when packaging for alternative Python stacks in EPEL. It also has some logic to ensure that canonical project names are used[0]. Feel free to leave it as is if you'd like.

[0]: https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_canonical_project_name

> %global common_description %{expand: \
> A pure python RFC3339 validator.}

If you're trying to escape the newline here, this doesn't work as expected. Compare the value of rpm -qp --qf="%{description}\n https://music.fedorapeople.org/python-rfc3339-validator-0.1.4-1.fc36.src.rpm" to any other RPM and you'll notice an extra leading newline.

You should use the standard `%description -n python3-rfc3339-validator %{common_description}`. Another option is to put `%wordwrap -v common_description` on a new line below `%description`. The is a lesser known and not very well documented macro that[1]:

> -- Reformat a text intended to be used used in a package description, removing
> -- rpm macro generation artefacts.
> -- – remove leading and ending empty lines
> -- – trim intermediary empty lines to a single line
> -- – fold on spaces

Am I being overly pedantic? Probably. Anyways...

[1]: https://src.fedoraproject.org/rpms/redhat-rpm-config/blob/rawhide/f/common.lua#_163

It looks like the unit tests are being installed to `%{python3_sitelib}`. Is that something we want?

Comment 2 Maxwell G 2022-06-29 02:43:35 UTC
Here is a filled fedora-review template. Everything passes.

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

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



===== 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.
     Note: Checking patched sources after %prep for licenses. Licenses
     found: "Unknown or generated", "MIT License", "*No copyright* MIT
     License". 14 files have unknown license. Detailed output of
     licensecheck in /home/gotmax/Sync/git-
     repos/packaging/fedora_rpms/review.repos/2095005-python-
     rfc3339-validator/licensecheck.txt
[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
     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 4 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.
     Note: There are rpmlint messages (see attachment).
[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).
[?]: 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.
[x]: Package should compile and build into binary rpms on all supported
     architectures.
[x]: %check is present and all tests pass.
There are some deprecation warnings.
[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: There are rpmlint messages (see attachment).
[x]: Spec file according to URL is the same as in SRPM.


Rpmlint
-------
Cannot parse rpmlint output:


Rpmlint (installed packages)
----------------------------
Cannot parse rpmlint output:


Source checksums
----------------
https://files.pythonhosted.org/packages/source/r/rfc3339_validator/rfc3339_validator-0.1.4.tar.gz :
  CHECKSUM(SHA256) this package     : 138a2abdf93304ad60530167e51d2dfb9549521a836871b88d7f4695d0022f6b
  CHECKSUM(SHA256) upstream package : 138a2abdf93304ad60530167e51d2dfb9549521a836871b88d7f4695d0022f6b


Requires
--------
python3-rfc3339-validator (rpmlib, GLIBC filtered):
    python(abi)
    python3.11dist(six)



Provides
--------
python3-rfc3339-validator:
    python-rfc3339-validator
    python3-rfc3339-validator
    python3.11-rfc3339-validator
    python3.11dist(rfc3339-validator)
    python3dist(rfc3339-validator)



Generated by fedora-review 0.8.0 (e988316) last change: 2022-04-07
Command line :/usr/bin/fedora-review -b 2095005
Buildroot used: fedora-rawhide-x86_64
Active plugins: Python, Shell-api, Generic
Disabled plugins: PHP, SugarActivity, C/C++, fonts, Java, Haskell, R, Perl, Ocaml
Disabled flags: EPEL6, EPEL7, DISTTAG, BATCH, EXARCH

Comment 3 Maxwell G 2022-06-29 02:46:16 UTC
> rpm -qp --qf="%{description}\n https://music.fedorapeople.org/python-rfc3339-validator-0.1.4-1.fc36.src.rpm"

This command is misformatted. It should be rpm -qp --qf="%{description}\n" https://music.fedorapeople.org/python-rfc3339-validator-0.1.4-1.fc36.src.rpm

Comment 4 Ben Beasley 2022-06-29 13:25:37 UTC
Thank you for the detailed review!

-----

> As we discussed in #fedora-python, this should be removed and patched out of the setup.py if the later is necessary. This is probably worthwhile to bring up upstream.

Upstream issue filed:

Consider dropping the pytest-runner test dependency
https://github.com/naimetti/rfc3339-validator/issues/6

Upstream PRs filed:

Drop the pytest-runner test dependency and “setup.py test” support
https://github.com/naimetti/rfc3339-validator/pull/7

Include files for tox testing in the sdist
https://github.com/naimetti/rfc3339-validator/pull/8

The spec file is modified with a patch derived from upstream PR#7, and the manual BR on python3dist(pytest-runner) is removed.

As you noted, the tox configuration is more trouble that it is worth; it is easy enough to unpin versions with sed, but most of the dependencies in requirements_dev.txt are things like coverage, flake8, etc. that I would have to patch back out. Therefore the spec file continues to rely on manual BR’s for testing and invokes the tests with the %pytest macro rather than %tox.

-----

> Also, I prefer the %{py3_dist X} dependency format over python3dist. It's less typing and it respects the value of %python3_pkgversion, which occasionally needs to be changed, such as when packaging for alternative Python stacks in EPEL. It also has some logic to ensure that canonical project names are used[0]. Feel free to leave it as is if you'd like.

I appreciate how the %{py3_dist …} macro helps form canonical project names, which makes it easier to do manual BR’s. On the other hand, it seems to be confusing to some packagers, and I have even seen people asking for %{py3_dist …} to be switched to python3dist(…) in package reviews.

I am grateful for the information on support for %{python3_pkgversion}, in case that is ever something other than “3” on an EPEL newer than EPEL7. That’s good to know.

Still, in the absence of an official Fedora-wide preferred form or obvious community consensus, I’ll opt to keep the python3dist(…) form here for consistency with my other packages.

-----

> If you're trying to escape the newline here, this doesn't work as expected.

You know, I picked up that habit a long time ago after I saw it somewhere, and I could have sworn I tried it. But you’re right, so I’ve fixed it, and I’ll make a project of fixing it in other packages that use the same pattern. At least the extra newline is only a trivial annoyance rather than a serious defect.

-----

> It looks like the unit tests are being installed to `%{python3_sitelib}`. Is that something we want?

This doesn’t seem to be the case. Check files.dir in the fedora-review output, or:

> $ rpm -q -p --filesbypkg /var/lib/mock/fedora-rawhide-x86_64/result/python3-rfc3339-validator-0.1.4-1.fc37.noarch.rpm
> python3-rfc3339-validator /usr/lib/python3.11/site-packages/__pycache__/rfc3339_validator.cpython-311.opt-1.pyc
> python3-rfc3339-validator /usr/lib/python3.11/site-packages/__pycache__/rfc3339_validator.cpython-311.pyc
> python3-rfc3339-validator /usr/lib/python3.11/site-packages/rfc3339_validator-0.1.4.dist-info
> python3-rfc3339-validator /usr/lib/python3.11/site-packages/rfc3339_validator-0.1.4.dist-info/AUTHORS.rst
> python3-rfc3339-validator /usr/lib/python3.11/site-packages/rfc3339_validator-0.1.4.dist-info/INSTALLER
> python3-rfc3339-validator /usr/lib/python3.11/site-packages/rfc3339_validator-0.1.4.dist-info/LICENSE
> python3-rfc3339-validator /usr/lib/python3.11/site-packages/rfc3339_validator-0.1.4.dist-info/METADATA
> python3-rfc3339-validator /usr/lib/python3.11/site-packages/rfc3339_validator-0.1.4.dist-info/WHEEL
> python3-rfc3339-validator /usr/lib/python3.11/site-packages/rfc3339_validator-0.1.4.dist-info/top_level.txt
> python3-rfc3339-validator /usr/lib/python3.11/site-packages/rfc3339_validator.py
> python3-rfc3339-validator /usr/share/doc/python3-rfc3339-validator
> python3-rfc3339-validator /usr/share/doc/python3-rfc3339-validator/AUTHORS.rst
> python3-rfc3339-validator /usr/share/doc/python3-rfc3339-validator/CONTRIBUTING.rst
> python3-rfc3339-validator /usr/share/doc/python3-rfc3339-validator/HISTORY.rst
> python3-rfc3339-validator /usr/share/doc/python3-rfc3339-validator/README.md

-----

New Spec URL: https://music.fedorapeople.org/20220629/python-rfc3339-validator.spec
New SRPM URL: https://music.fedorapeople.org/20220629/python-rfc3339-validator-0.1.4-1.fc36.src.rpm

Comment 5 Maxwell G 2022-06-29 17:49:25 UTC
Thanks for fixing the pytest-runner thing and submitting it upstream!

> I am grateful for the information on support for %{python3_pkgversion}, in case that is ever something other than “3” on an EPEL newer than EPEL7. That’s good to know.

RHEL 8 has python38 and python39. 

Side note: I already maintain ansible for python38 in EPEL 8, because ansible-core is packaged for that version in RHEL 8 due to upstream requirements. I am working on getting a stripped down version of pyproject-rpm-macros for python38 and python39 which have new enough versions of pip to be compatible. It's stripped down, because %tox (I haven't packaged it yet, but I may) and %pyproject_buildrequires (RHEL 8's rpm is too old) are removed. I am working on it in this[1] COPR. In terms of alternative buildsystems, I've packaged flit and I'm working towards poetry-core. I'm not sure if this is something you're interested in, but I figured I'd let you know.

[1]: https://copr.fedorainfracloud.org/coprs/gotmax23/python38-epel8_2/

> You know, I picked up that habit a long time ago after I saw it somewhere, and I could have sworn I tried it. But you’re right, so I’ve fixed it, and I’ll make a project of fixing it in other packages that use the same pattern. At least the extra newline is only a trivial annoyance rather than a serious defect.

Yeah, you're right. It's a pretty minor issue, but thank you for fixing it!

>> It looks like the unit tests are being installed to `%{python3_sitelib}`. Is that something we want?
> 
> This doesn’t seem to be the case. Check files.dir in the fedora-review output, or:

You're right. I have no idea why I thought that was the case, as I looked at files.dir. I was working with another package that does this yesterday, so maybe my brain was seeing things...

In any case, you're package is approved. I didn't see the need to re-run Fedora review, but I did successfully rebuild your package and inspected the specfile diff. Re the removed pytest constraint, is that because of the versioned dependencies guideline in https://docs.fedoraproject.org/en-US/packaging-guidelines/#_package_dependencies ?

Comment 6 Ben Beasley 2022-06-29 18:32:29 UTC
> Re the removed pytest constraint, is that because of the versioned dependencies guideline in https://docs.fedoraproject.org/en-US/packaging-guidelines/#_package_dependencies ?

I’m aware of that guideline, and typically follow it in the general case, but for manual dependencies in Python packages I tend to preserve dependency versions because this is what generated BR’s would do, and I’d rather follow that precedent than the general “SHOULD” guideline. I acknowledge that the best approach in this case is debatable.

Instead, I removed the version constraint because it comes from the upstream test_requires keyword argument to setuptools.setup(), which is removed by the PR that I offered upstream, and I wanted the spec file to reflect the patched sources.

Comment 7 Ben Beasley 2022-07-06 12:59:03 UTC
Thank you for the careful review!

Repository requested: https://pagure.io/releng/fedora-scm-requests/issue/45524

Comment 8 Gwyn Ciesla 2022-07-06 20:58:00 UTC
(fedscm-admin):  The Pagure repository was created at https://src.fedoraproject.org/rpms/python-rfc3339-validator

Comment 9 Fedora Update System 2022-07-07 00:43:27 UTC
FEDORA-2022-62f2e4c7a6 has been submitted as an update to Fedora 37. https://bodhi.fedoraproject.org/updates/FEDORA-2022-62f2e4c7a6

Comment 10 Fedora Update System 2022-07-07 00:45:06 UTC
FEDORA-2022-62f2e4c7a6 has been pushed to the Fedora 37 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 11 Maxwell G 2022-07-12 01:31:34 UTC
*** Bug 2106174 has been marked as a duplicate of this bug. ***

Comment 12 Fedora Update System 2022-07-12 12:46:03 UTC
FEDORA-2022-a93360355b has been submitted as an update to Fedora 36. https://bodhi.fedoraproject.org/updates/FEDORA-2022-a93360355b

Comment 13 Fedora Update System 2022-07-12 12:56:41 UTC
FEDORA-2022-7b934a61f4 has been submitted as an update to Fedora 35. https://bodhi.fedoraproject.org/updates/FEDORA-2022-7b934a61f4

Comment 14 Fedora Update System 2022-07-13 01:28:33 UTC
FEDORA-2022-a93360355b has been pushed to the Fedora 36 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf install --enablerepo=updates-testing --refresh --advisory=FEDORA-2022-a93360355b \*`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-a93360355b

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 15 Fedora Update System 2022-07-13 01:34:01 UTC
FEDORA-2022-7b934a61f4 has been pushed to the Fedora 35 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf install --enablerepo=updates-testing --refresh --advisory=FEDORA-2022-7b934a61f4 \*`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-7b934a61f4

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 16 Fedora Update System 2022-07-21 16:39:01 UTC
FEDORA-2022-a93360355b has been pushed to the Fedora 36 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 17 Fedora Update System 2022-07-21 17:09:47 UTC
FEDORA-2022-7b934a61f4 has been pushed to the Fedora 35 stable repository.
If problem still persists, please make note of it in this bug report.


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