Bug 1733508 - Review Request: python-deprecated - Python decorator to deprecate old python classes, functions or methods
Summary: Review Request: python-deprecated - Python decorator to deprecate old python ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: Package Review
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Tomas Tomecek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-07-26 10:19 UTC by Petr Hracek
Modified: 2019-08-03 04:06 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-07-29 15:41:29 UTC
Type: ---
Embargoed:
ttomecek: fedora-review+


Attachments (Terms of Use)

Description Petr Hracek 2019-07-26 10:19:22 UTC
Spec URL: https://phracek.fedorapeople.org/python3-Deprecated.spec
SRPM URL: https://phracek.fedorapeople.org/python3-Deprecated-1.2.6-1.fc29.src.rpm
Description: Python @deprecated decorator to deprecate old python classes, functions or methods.
Fedora Account System Username: phracek

Comment 1 Petr Hracek 2019-07-26 10:32:30 UTC
Output from rpmlint.
$ rpmlint python3-Deprecated.spec
0 packages and 1 specfiles checked; 0 errors, 0 warnings.
$
$ rpmlint /home/vagrant/rpmbuild/SRPMS/python3-Deprecated-1.2.6-1.fc30.src.rpm
1 packages and 0 specfiles checked; 0 errors, 0 warnings.
$

Comment 2 Tomas Tomecek 2019-07-26 12:14:35 UTC
Package Review
==============

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


Issues:
=======
- Python packages must not contain %{pythonX_site(lib|arch)}/* in %files
  Note: Package contains %{pythonX_site(lib|arch)}/* in %files
  See: https://pagure.io/packaging-committee/issue/782

// please fix this ^

===== 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". 59 files have unknown
     license. Detailed output of licensecheck in
     /home/tt/t/1733508-python3-Deprecated/licensecheck.txt
[x]: Package contains no bundled libraries without FPC exception.
[x]: Changelog in prescribed format.
[x]: Sources contain only permissible code or content.
[x]: Package contains desktop file if it is a GUI application.
[x]: 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.
[x]: 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.
[x]: Package contains systemd file(s) if in need.
[x]: Package is not known to require an ExcludeArch tag.
[x]: 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]: 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]: Binary eggs must be removed in %prep

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

Generic:
[x]: 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.
[x]: 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.
[x]: %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: There are rpmlint messages (see attachment).
[x]: Spec file according to URL is the same as in SRPM.


Rpmlint
-------
Checking: python3-Deprecated-1.2.6-1.fc31.noarch.rpm
          python3-Deprecated-1.2.6-1.fc31.src.rpm
python3-Deprecated.src: W: strange-permission Deprecated-1.2.6.tar.gz 770
python3-Deprecated.src: W: strange-permission python3-Deprecated.spec 770
2 packages and 0 specfiles checked; 0 errors, 2 warnings.

// please make sure that you commit the spec to dist-git with the correct mode (644 ideally)


Source checksums
----------------
https://files.pythonhosted.org/packages/source/D/Deprecated/Deprecated-1.2.6.tar.gz :
  CHECKSUM(SHA256) this package     : a515c4cf75061552e0284d123c3066fbbe398952c87333a92b8fc3dd8e4f9cc1
  CHECKSUM(SHA256) upstream package : a515c4cf75061552e0284d123c3066fbbe398952c87333a92b8fc3dd8e4f9cc1


Requires
--------
python3-Deprecated (rpmlib, GLIBC filtered):
    python(abi)
    python3-wrapt
    python3.7dist(wrapt)

// you could use '%?python_enable_dependency_generator' and then you don't need to specify any deps in the spec
// also the BR on wrapt in the spec is not needed since you're not running any tests


Provides
--------
python3-Deprecated:
    python3-Deprecated
    python3.7dist(deprecated)
    python3dist(deprecated)



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


// I'm sure that a more experienced python packager would be more strict but for me this is good enough
// Before committing to dist-git, make sure you fix the issue with sitelib
// review+

Comment 3 Tomas Tomecek 2019-07-26 12:18:34 UTC
Here's the docs for the %files section: https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_byte_compiling

Comment 4 Gwyn Ciesla 2019-07-26 13:09:18 UTC
(fedscm-admin):  The Pagure repository was created at https://src.fedoraproject.org/rpms/python3-Deprecated

Comment 5 Carl George 2019-07-26 21:28:35 UTC
I know I'm late to the game here, but since the spec file hasn't been imported to the distgit repo yet, I have some naming concerns.  I expected the source package name to be python-deprecated.  Using the name python3-Deprecated seems to go against two separate packaging guidelines.

* Case sensitivity SHOULD only be used where necessary.
  https://docs.fedoraproject.org/en-US/packaging-guidelines/Naming/#_case_sensitivity

* Python source packages MUST be named with the `python-` prefix.
  https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_naming

This isn't a major issue, but this seemed like the best time to bring it up, rather than after the package is created.

Comment 6 Tomas Tomecek 2019-07-29 07:21:46 UTC
Carl, very good points. I discussed that with Petr offline. The thing is that the package is named Deprecated on PyPI, so 1) do we want to be consistent with upstream's naming decision? 2) will the auto-dependency generators work when requirements.txt would say 'Deprecated' and we would have python[3]-deprecated?

And this is my bad, I haven't noticed the package itself is proposed to be named 'python3-', that's an obvious mistake, it should be 'python-'.

Comment 7 Jiri Popelka 2019-07-29 07:48:00 UTC
Looking at the spec:

> # what it's called on pypi
> %global srcname deprecated

I think the comment is wrong, because on PyPI it's called Deprecated (https://pypi.org/project/Deprecated), not deprecated.
And you use the variable in "https://github.com/tantale/%{srcname}" which is not a PyPI url.

> # what it's imported as
> %global libname github

defined, but unused

> # name of egg info directory
> %global eggname %{srcname}

defined, but unused

Comment 8 Petr Hracek 2019-07-29 10:10:11 UTC
New spec file was uploaded
SPEC file: https://phracek.fedorapeople.org/python3-Deprecated.spec

Comment 9 Petr Hracek 2019-07-29 10:20:43 UTC
Hi Carl,

looking at the similar spec file 
https://src.fedoraproject.org/rpms/python-PyGithub/blob/master/f/python-PyGithub.spec

In our case, the main package could be python-Deprecated
and the rest would be python3-deprecated

Comment 10 Jiri Popelka 2019-07-29 10:30:36 UTC
> SPEC file: https://phracek.fedorapeople.org/python3-Deprecated.spec

Shouldn't it be called python-Deprecated.spec?

> In our case, the main package could be python-Deprecated
> and the rest would be python3-deprecated

What do you mean with 'main package' and 'rest'?

Looking at spec: 
> %global srcname deprecated
> %global pkgname Deprecated
> Name:       python-%{pkgname}
> %package -n python3-%{pkgname}

Don't you actually want
%package -n python3-%{srcname}
?

Comment 11 Jiri Popelka 2019-07-29 10:32:43 UTC
Or even better (to have it in sync with python-PyGithub.spec)

%global srcname Deprecated
%global pkgname deprecated
Name:       python-%{srcname}
%package -n python3-%{pkgname}

Comment 12 Miro Hrončok 2019-07-29 12:03:06 UTC
My opinion here:

Whatever you do, be consistent. Don't create python-Deprecated source package with python3-deprecated subpackage or vice versa. Pick one (D/d) ad stick with it.

PyPI package names preserve case, but are case insensitive:

https://pypi.org/project/Deprecated/ == https://pypi.org/project/deprecated/

pip install deprecated == pip install DEPRECATED == pip install Deprecated

Such capital D in name is useless according to https://docs.fedoraproject.org/en-US/packaging-guidelines/Naming/#_case_sensitivity we don't call packages Firefox or GNOME-Boxes, but firefox or gnome-boxes.

Comment 13 Miro Hrončok 2019-07-29 12:05:17 UTC
And as seemed to be already agreed upon, but to be explicit here, the source name with python3- is a NO GO. Make it python-.

Comment 14 Miro Hrončok 2019-07-29 13:26:44 UTC
Don't forgot to retire python3-Deprecated.

Comment 15 Gwyn Ciesla 2019-07-29 14:01:32 UTC
(fedscm-admin):  The Pagure repository was created at https://src.fedoraproject.org/rpms/python-deprecated

Comment 16 Carl George 2019-07-29 14:19:22 UTC
> do we want to be consistent with upstream's naming decision?

My opinion is that consistency with upstream naming isn't necessary, and thus would fall outside the guideline of "only be used where necessary".

> will the auto-dependency generators work when requirements.txt would say 'Deprecated' and we would have python[3]-deprecated?

Yes, it will work.  The automatic provides will be python3dist(deprecated) and python3.Ydist(deprecated) regardless (forced to lower case).

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

> looking at the similar spec file 
> https://src.fedoraproject.org/rpms/python-PyGithub/blob/master/f/python-PyGithub.spec

I believe that package was created before the guidelines added the case sensitivity part, and no one has taken the time to rename the distgit repo yet.  To comply with that SHOULD guideline item, it should be renamed to python-pygithub.

Comment 17 Miro Hrončok 2019-07-29 14:22:46 UTC
I also very much suggest **not** to look at existing packages and automatically assume "this is how it is supposed to be", but rather look at the guidelines.

Comment 18 Fedora Update System 2019-07-29 15:34:58 UTC
FEDORA-2019-36125b005b has been submitted as an update to Fedora 30. https://bodhi.fedoraproject.org/updates/FEDORA-2019-36125b005b

Comment 20 Fedora Update System 2019-07-29 15:38:04 UTC
FEDORA-2019-1566111aa0 has been submitted as an update to Fedora 29. https://bodhi.fedoraproject.org/updates/FEDORA-2019-1566111aa0

Comment 21 Fedora Update System 2019-07-30 00:56:11 UTC
python-deprecated-1.2.6-2.fc30 has been pushed to the Fedora 30 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-36125b005b

Comment 22 Fedora Update System 2019-07-30 03:44:15 UTC
python-deprecated-1.2.6-2.fc29 has been pushed to the Fedora 29 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-1566111aa0

Comment 23 Fedora Update System 2019-08-01 09:33:24 UTC
FEDORA-2019-2d3543aae5 has been submitted as an update to Fedora 30. https://bodhi.fedoraproject.org/updates/FEDORA-2019-2d3543aae5

Comment 24 Fedora Update System 2019-08-01 10:49:46 UTC
FEDORA-2019-b8924602ed has been submitted as an update to Fedora 29. https://bodhi.fedoraproject.org/updates/FEDORA-2019-b8924602ed

Comment 25 Fedora Update System 2019-08-02 00:55:09 UTC
python-deprecated-1.2.6-3.fc30 has been pushed to the Fedora 30 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-2d3543aae5

Comment 26 Fedora Update System 2019-08-02 01:24:27 UTC
python-deprecated-1.2.6-3.fc29 has been pushed to the Fedora 29 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-b8924602ed

Comment 27 Fedora Update System 2019-08-03 01:17:09 UTC
python-deprecated-1.2.6-3.fc30 has been pushed to the Fedora 30 stable repository. If problems still persist, please make note of it in this bug report.

Comment 28 Fedora Update System 2019-08-03 04:06:11 UTC
python-deprecated-1.2.6-3.fc29 has been pushed to the Fedora 29 stable repository. If problems still persist, 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.