Bug 2001684 - Review Request: python-keyrings-alt - Alternate keyring implementations
Summary: Review Request: python-keyrings-alt - Alternate keyring implementations
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: Package Review
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Miro Hrončok
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: fedora-neuro, NeuroFedora 1931183
TreeView+ depends on / blocked
 
Reported: 2021-09-06 18:51 UTC by Ankur Sinha (FranciscoD)
Modified: 2021-09-24 20:18 UTC (History)
3 users (show)

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


Attachments (Terms of Use)

Description Ankur Sinha (FranciscoD) 2021-09-06 18:51:41 UTC
Spec URL: https://ankursinha.fedorapeople.org/python-keyrings-alt/python-keyrings-alt.spec
SRPM URL: https://ankursinha.fedorapeople.org/python-keyrings-alt/python-keyrings-alt-4.1.0-1.fc34.src.rpm

Description:
Alternate keyring backend implementations for use with the keyring package.

Keyrings in this package may have security risks or other implications. These
backends were extracted from the main keyring project to make them available
for those who wish to employ them, but are discouraged for general production
use. Include this module and use its backends at your own risk.

For example, the PlaintextKeyring stores passwords in plain text on the file
system, defeating the intended purpose of this library to encourage best
practices for security.


Fedora Account System Username: ankursinha

(required for datalad which is required for spikeextractors)

Comment 1 Miro Hrončok 2021-09-08 09:57:18 UTC
I don't understand why is the component named python-keyrings-alt but the built package python3-keyrings.alt -- I'd stick to one naming. Honestly, the %{pypi_name}/%{pretty_name} macros only makes the package harder to read.

------------

> BuildRequires:  %{py3_dist pytest}

This should not be needed.


> %pyproject_buildrequires -t

Since you don't use %tox, you can probably use:

  %pyproject_buildrequires -x testing

To avoid a superfluous dependency on tox.

------------

You can use `%pyproject_save_files keyrings` if your intention is to own the entire %{python3_sitelib}/keyrings directory.

Comment 2 Miro Hrončok 2021-09-08 09:59:17 UTC
"The Fedora package’s name SHOULD contain the Canonical project name." https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_library_naming

Hence, the package name SHOULD be python-keyrings-alt/python3-keyrings-alt.

Comment 3 Ankur Sinha (FranciscoD) 2021-09-08 10:49:07 UTC
(In reply to Miro Hrončok from comment #1)
> I don't understand why is the component named python-keyrings-alt but the
> built package python3-keyrings.alt -- I'd stick to one naming. Honestly, the
> %{pypi_name}/%{pretty_name} macros only makes the package harder to read.

Eh, sorry about that. I forgot to update the macro.

What is the suggested way of dealing with this without using pretty_name etc. type macros? Use the names in each place? %pypi_source uses %srcname, then %pypi_name, and then %name, so I tend to use pypi_name in specs at least. In this case that differs from what the package name should be so we have another pretty_name macro. 

If there's a better/suggested way of handling such cases, I'm all ears.

> 
> ------------
> 
> > BuildRequires:  %{py3_dist pytest}
> 
> This should not be needed.

Removed

> 
> 
> > %pyproject_buildrequires -t
> 
> Since you don't use %tox, you can probably use:
> 
>   %pyproject_buildrequires -x testing

Used: %pyproject_buildrequires %{?with_tests:-x testing}

> 
> To avoid a superfluous dependency on tox.
> 
> ------------
> 
> You can use `%pyproject_save_files keyrings` if your intention is to own the
> entire %{python3_sitelib}/keyrings directory.

Ah, right. I thought it wouldn't include the keyrings.alt.*dist-info directory, but it does. I've used that now.

Updated spec/srpm:

Spec URL: https://ankursinha.fedorapeople.org/python-keyrings-alt/python-keyrings-alt.spec
SRPM URL: https://ankursinha.fedorapeople.org/python-keyrings-alt/python-keyrings-alt-4.1.0-1.fc34.src.rpm

Cheers,

Comment 4 Miro Hrončok 2021-09-08 11:05:48 UTC
My personal opinion: Do not define %{pypi_name}, %{pretty_name}, %{srcname}, etc. at all: it just makes the specfile hard to read. Use explicit value everywhere. E.g. use %{pypi_source keyrings.alt}.


The Python guidelines don't really explicitly mention this, but they do the same thing in examples. The %{pypi_source} documentation even says the automatic name is deprecated:

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

Relevant discussion:

https://lists.fedoraproject.org/archives/list/python-devel@lists.fedoraproject.org/message/RDNMKJHCLOL57W37EY2GQQ2Y5MAJ43MK/


--------


About %pyproject_save_files: it always includes the one .dist-info directory + it takes a list of module names globs to include. If there are multiple .dist-info directories found, it will fail.

Comment 5 Miro Hrončok 2021-09-08 11:30:35 UTC
Package Review
==============

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


Package APPROVED.


Nitpicks:

LICENSE is packaged twice:

$ rpm -ql --licensefiles -p python3-keyrings-alt-4.1.0-1.fc36.noarch.rpm 
/usr/lib/python3.10/site-packages/keyrings.alt-4.1.0.dist-info/LICENSE
/usr/share/licenses/python3-keyrings-alt/LICENSE


What does this comment relate to?

# pyfilesystem is not yet packaged
# gdata, keyczar are deprecated


Be careful if you ever package anything else that owns /usr/lib/python3.10/site-packages/keyrings/__init__.py



===== 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", "Expat License", "*No copyright* Expat
     License".
[x]: License file installed when any subpackage combination is installed.
[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 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.
     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]: 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).
[-]: Fully versioned dependency in subpackages if applicable.
[?]: Package functions as described.
[?]: 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.
[?]: Package should compile and build into binary rpms on all supported
     architectures.
[x]: %check is present and all tests pass.
[?]: 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
-------
Checking: python3-keyrings-alt-4.1.0-1.fc36.noarch.rpm
          python-keyrings-alt-doc-4.1.0-1.fc36.noarch.rpm
          python-keyrings-alt-4.1.0-1.fc36.src.rpm
python-keyrings-alt.src:92: W: macro-in-%changelog %autochangelog
3 packages and 0 specfiles checked; 0 errors, 1 warnings.


Source checksums
----------------
https://files.pythonhosted.org/packages/source/k/keyrings.alt/keyrings.alt-4.1.0.tar.gz :
  CHECKSUM(SHA256) this package     : 52ccb61d6f16c10f32f30d38cceef7811ed48e086d73e3bae86f0854352c4ab2
  CHECKSUM(SHA256) upstream package : 52ccb61d6f16c10f32f30d38cceef7811ed48e086d73e3bae86f0854352c4ab2


Requires
--------
python3-keyrings-alt (rpmlib, GLIBC filtered):
    python(abi)
    python3dist(keyring)

python-keyrings-alt-doc (rpmlib, GLIBC filtered):



Provides
--------
python3-keyrings-alt:
    python-keyrings-alt
    python3-keyrings-alt
    python3.10-keyrings-alt
    python3.10dist(keyrings-alt)
    python3.10dist(keyrings.alt)
    python3dist(keyrings-alt)
    python3dist(keyrings.alt)

python-keyrings-alt-doc:
    python-keyrings-alt-doc



Generated by fedora-review 0.7.0 (fed5495) last change: 2019-03-17
Command line :try-fedora-review -b 2001684 -m fedora-rawhide-x86_64 --mock-options=--enablerepo=local
Buildroot used: fedora-rawhide-x86_64
Active plugins: Python, Shell-api, Generic
Disabled plugins: Haskell, Ruby, fonts, C/C++, Ocaml, R, Java, PHP, SugarActivity, Perl
Disabled flags: EPEL6, EPEL7, DISTTAG, BATCH, EXARCH

Comment 6 Ankur Sinha (FranciscoD) 2021-09-08 12:47:10 UTC
(In reply to Miro Hrončok from comment #4)
> My personal opinion: Do not define %{pypi_name}, %{pretty_name}, %{srcname},
> etc. at all: it just makes the specfile hard to read. Use explicit value
> everywhere. E.g. use %{pypi_source keyrings.alt}.
> 
> 
> The Python guidelines don't really explicitly mention this, but they do the
> same thing in examples. The %{pypi_source} documentation even says the
> automatic name is deprecated:
> 
> https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#pypi_source
> 
> Relevant discussion:
> 
> https://lists.fedoraproject.org/archives/list/python-devel@lists.
> fedoraproject.org/message/RDNMKJHCLOL57W37EY2GQQ2Y5MAJ43MK/
> 
> 
> --------

Thanks for that. That makes sense. I'll stop using these name related macros from now onwards and use the names directly instead.

> About %pyproject_save_files: it always includes the one .dist-info directory
> + it takes a list of module names globs to include. If there are multiple
> .dist-info directories found, it will fail.

Oh, OK. good to know.

(In reply to Miro Hrončok from comment #5)
> Package Review
> ==============
> 
> Legend:
> [x] = Pass, [!] = Fail, [-] = Not applicable, [?] = Not evaluated
> 
> 
> Package APPROVED.

Awesome, thanks for the review!

> Nitpicks:
> 
> LICENSE is packaged twice:
> 
> $ rpm -ql --licensefiles -p python3-keyrings-alt-4.1.0-1.fc36.noarch.rpm 
> /usr/lib/python3.10/site-packages/keyrings.alt-4.1.0.dist-info/LICENSE
> /usr/share/licenses/python3-keyrings-alt/LICENSE

Removed the duplicate entry. I forget that distinfo includes it already.

> What does this comment relate to?
> 
> # pyfilesystem is not yet packaged
> # gdata, keyczar are deprecated

These are additional bits needed for particular tests---gdata and keyczar are
only available on Python 2, so their tests are skipped. I thought pyfilesystem
wasn't in Fedora, but I found it included as python-fs. The pyfs tests are
still skipped in the build though---but they are also skipped in upstream's CI,
so not sure what needs to be done to get them to run:
https://github.com/jaraco/keyrings.alt/runs/3082737541?check_suite_focus=true

I've improved the comment in the spec.

> Be careful if you ever package anything else that owns
> /usr/lib/python3.10/site-packages/keyrings/__init__.py

+1, I've made a note of this in the spec too.


Thanks again, requesting SCM now.


Updated spec/srpm:
Spec URL: https://ankursinha.fedorapeople.org/python-keyrings-alt/python-keyrings-alt.spec
SRPM URL: https://ankursinha.fedorapeople.org/python-keyrings-alt/python-keyrings-alt-4.1.0-1.fc34.src.rpm

Comment 7 Gwyn Ciesla 2021-09-08 13:37:18 UTC
(fedscm-admin):  The Pagure repository was created at https://src.fedoraproject.org/rpms/python-keyrings-alt

Comment 8 Fedora Update System 2021-09-08 14:42:28 UTC
FEDORA-2021-af01a78e37 has been submitted as an update to Fedora 34. https://bodhi.fedoraproject.org/updates/FEDORA-2021-af01a78e37

Comment 9 Fedora Update System 2021-09-08 14:42:30 UTC
FEDORA-2021-4b28bc1a2c has been submitted as an update to Fedora 35. https://bodhi.fedoraproject.org/updates/FEDORA-2021-4b28bc1a2c

Comment 10 Fedora Update System 2021-09-08 18:47:09 UTC
FEDORA-2021-4b28bc1a2c 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 --advisory=FEDORA-2021-4b28bc1a2c \*`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-4b28bc1a2c

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

Comment 11 Fedora Update System 2021-09-09 17:38:31 UTC
FEDORA-2021-af01a78e37 has been pushed to the Fedora 34 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf install --enablerepo=updates-testing --advisory=FEDORA-2021-af01a78e37 \*`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-af01a78e37

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

Comment 12 Fedora Update System 2021-09-16 19:13:59 UTC
FEDORA-2021-af01a78e37 has been pushed to the Fedora 34 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 13 Fedora Update System 2021-09-24 20:18:36 UTC
FEDORA-2021-4b28bc1a2c 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.