[Bug 2084040] Review Request: python-limits - Utilities to implement rate limiting using various strategies

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



https://bugzilla.redhat.com/show_bug.cgi?id=2084040

Ben Beasley <code@xxxxxxxxxxxxxxxxxx> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
              Flags|needinfo?(code@musicinmybra |
                   |in.net)                     |



--- Comment #1 from Ben Beasley <code@xxxxxxxxxxxxxxxxxx> ---
Package Review
==============

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


Issues:
=======
- Sources used to build the package match the upstream source, as provided
  in the spec URL.
  Note: Upstream MD5sum check error, diff is in
  /home/reviewer/2084040-python-limits/diff.txt
  See: https://docs.fedoraproject.org/en-US/packaging-guidelines/SourceURL/

  I think you accidentally included the PyPI sdist instead of the GitHub
archive
  in the SRPM.

- Version 2.6.2 is now available; please update.

- There are several “extras” that need to be packaged as metapackage
subpackages.

  https://fedoraproject.org/wiki/Changes/PythonExtras#Extras_metapackages

  setup.py has:

    EXTRA_REQUIREMENTS = {
        "redis": get_requirements("storage/redis.txt"),
        "rediscluster": get_requirements("storage/rediscluster.txt"),
        "memcached": get_requirements("storage/memcached.txt"),
        "mongodb": get_requirements("storage/mongodb.txt"),
        "async-redis": get_requirements("storage/async-redis.txt"),
        "async-memcached": get_requirements("storage/async-memcached.txt"),
        "async-mongodb": get_requirements("storage/async-mongodb.txt"),
    }
    EXTRA_REQUIREMENTS["all"] =
list(itertools.chain(*EXTRA_REQUIREMENTS.values()))

  You can’t package:

    [async-redis]: python-coredis (with python3-coredis+hiredis) not packaged
    [async-memcached]: python-emcache not packaged
    [async-mongodb]: python-motor not packaged

  so please add

    # Missing python3dist(coredis), python3dist(coredis[hiredis])
    %bcond_with async_redis
    # Missing python3dist(emcache)
    %bcond_with async_memcached
    # Missing python3dist(motor)
    %bcond_with async_mongodb

  and change

    %pyproject_buildrequires -r

  to

    %if %{with async_redis} && %{with async_memcached} && %{with async_mongodb}
    %pyproject_buildrequires -x all
    %else
    %{pyproject_buildrequires \
      %{?with_async_redis:-x async-redis} \
      %{?with_async_memcached:-x async-memcached} \
      %{?with_async_mongodb:-x async-mongodb} \
      -x redis \
      -x rediscluster \
      -x memcached \
      -x mongodb}
    %endif

  and add, probably either before %prep or before %package doc,

    %if %{with async_redis} && %{with async_memcached} && %{with async_mongodb}
    %pyproject_extras_subpkg -n python3-%{pypi_name} all
    %endif
    %if %{with async_redis}
    %pyproject_extras_subpkg -n python3-%{pypi_name} async-redis
    %endif
    %if %{with async_memcached}
    %pyproject_extras_subpkg -n python3-%{pypi_name} async-memcached
    %endif
    %if %{with async_mongodb}
    %pyproject_extras_subpkg -n python3-%{pypi_name} async-mongodb
    %endif
    %pyproject_extras_subpkg -n python3-%{pypi_name} redis rediscluster
memcached mongodb

- Rather than using manual BR’s for the tests, consider, in %prep:

    # We only need to generate the *additional* requirements for testing. 
Also, we
    # should patch out linting and coverage dependencies
    #
(https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_linters),
    # and we will not run integration tests with docker.
    sed -r -e '/^[[:blank:]]*(-r|coverage|pytest-cov|lovely-pytest-docker)\b/d'
\
        requirements/test.txt | tee requirements/test-filtered.txt
    sed -r -i '/^[[:blank:]]*(--cov|-K)\b/d' pytest.ini

  Then, add %{?with_tests:requirements/test-filtered.txt} to the
  %pyproject_buildrequires arguments, e.g.:

    %if %{with async_redis} && %{with async_memcached} && %{with async_mongodb}
    %pyproject_buildrequires -x all
%{?with_tests:requirements/test-filtered.txt}
    %else
    %{pyproject_buildrequires \
      %{?with_tests:requirements/test-filtered.txt} \
      %{?with_async_redis:-x async-redis} \
      %{?with_async_memcached:-x async-memcached} \
      %{?with_async_mongodb:-x async-mongodb} \
      -x redis \
      -x rediscluster \
      -x memcached \
      -x mongodb}
    %endif

  Then you can remove:

    %if %{with tests}
    BuildRequires:  %{py3_dist pytest}
    BuildRequires:  %{py3_dist flaky}
    BuildRequires:  %{py3_dist pytest-xdist}
    BuildRequires:  %{py3_dist codecov}
    BuildRequires:  %{py3_dist pytest-cov}
    BuildRequires:  %{py3_dist pytest-mock}
    BuildRequires:  %{py3_dist pytest-lazy-fixture}
    BuildRequires:  %{py3_dist pytest-asyncio}
    %endif

- The spec file says

    # no tests in official GitHub release
    # use smoke tests instead
    %check
    %if %{with tests}
    %pyproject_check_import
    %endif

  but that doesn’t appear to be true; I think you accidentally used a PyPI
  tarball in this submission.

  Using the actual tarball from Source0, you can change

    %bcond_with tests

  to

    # Missing dependencies: python3dist(hiro)
    %bcond_with tests

  and write

    %check
    %if %{with tests}
    %pytest
    %else
    %pyproject_check_import
    %endif

  so at least you will be running the import smoke tests.

  You could do even better by:

    %bcond_without tests
    %bcond_with hiro

  and

    %if %{with tests}
    %if %{without hiro}
    ignore="${ignore-} --ignore=tests/storage/test_memory.py"
    ignore="${ignore-} --ignore=tests/aio/storage/test_memory.py"
    %endif
    # The deselected tests generally require various servers and/or Docker.
    m='not integration'
    m="${m-}${m+ and }not redis"
    m="${m-}${m+ and }not redis_sentinel"
    m="${m-}${m+ and }not redis_cluster"
    m="${m-}${m+ and }not mongodb"
    m="${m-}${m+ and }not memcached"
    %pytest ${ignore-} -m "${m-}"
    %endif
    # Since quite a few upstream tests needed to be deselected, run the import 
                                          # “smoke tests” too.
    %pyproject_check_import

  This time I am running the smoke test unconditionally since quite a few tests
  are deselected, but we are running some of them, which is better than none of
  them.

- In this case, pyproject_files contains the properly-marked license file, so
  you may (but are not required to) omit

    %license LICENSE.txt

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

  Verify with:

    $ rpm -qL -p results/python3-limits-2.6.1-1.fc37.noarch.rpm 
    /usr/lib/python3.10/site-packages/limits-2.6.1.dist-info/LICENSE.txt

- You might want to add the following %doc files:

    %doc CONTRIBUTIONS.rst
    %doc HISTORY.rst

- Similar to the tests, you can simplify doc BRs by generating them. First
  you’ll need to tweak the upstream requirements file.

    %prep
    […]
    # Allow newer versions of doc dependencies.
    #
    # Drop unused and possibly unpackageable
    # (https://bugzilla.redhat.com/show_bug.cgi?id=1910798) HTML theme.
    #
    # Missing dependencies (but we can build documentation anyway):
    # - python3dist(sphinxext-opengraph)
    # - python3dist(sphinx-paramlinks)
    sed -r -e 's/==/>=/' \
        -e '/^[[:blank:]]*(furo|sphinxext-opengraph|sphinx-paramlinks)/d' \
        requirements/docs.txt | tee requirements/docs-filtered.txt
    sed -r -i '/(opengraph|paramlinks)/d' doc/source/conf.py

  Then, feed it to %pyproject_buildrequires:

    %{pyproject_buildrequires \
      %{?with_tests:requirements/test-filtered.txt} \
      %{?with_doc_pdf:requirements/docs-filtered.txt} \
      %{?with_async_redis:-x async-redis} \
      […]
      -x mongodb}

  and change

    %if %{with doc_pdf}
    BuildRequires:  make
    BuildRequires:  python3-sphinx-latex
    BuildRequires:  latexmk
    BuildRequires:  %{py3_dist sphinx}
    BuildRequires:  %{py3_dist sphinx-rtd-theme}
    BuildRequires:  %{py3_dist sphinxext-opengraph}
    BuildRequires:  %{py3_dist sphinx-copybutton}
    BuildRequires:  %{py3_dist sphinx-autobuild}
    BuildRequires:  %{py3_dist sphinx-panels}
    %endif

  to

    %if %{with doc_pdf}
    BuildRequires:  make
    BuildRequires:  python3-sphinx-latex
    BuildRequires:  latexmk
    %endif

  Now fix the build directory in

    %make_build -C doc latex SPHINXOPTS='%{?_smp_mflags}'
    %make_build -C doc/_build/latex LATEXMKOPTS='-quiet'

  and

    %doc doc/_build/latex/%{pypi_name}.pdf

  by changing it to

    %make_build -C doc latex SPHINXOPTS='%{?_smp_mflags}'
    %make_build -C doc/build/latex LATEXMKOPTS='-quiet'

  and

    %doc doc/build/latex/%{pypi_name}.pdf

  Finally, to reduce warning noise, consider in %prep:

    # Cannot use remote intersphinx inventories in offline build:
    echo 'intersphinx_mapping.clear()' >> doc/source/conf.py

  Now you should be able to actually enable the documentation.

===== 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: "*No copyright* MIT License", "Unknown or generated", "MIT
     License", "*No copyright* Public domain", "*No copyright* [generated
     file]". 66 files have unknown license. Detailed output of licensecheck
     in /home/reviewer/2084040-python-limits/licensecheck.txt

     While versioneer.py is Public Domain, it is not installed in the binary
     RPM.

[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.
[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]: 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.
     Note: No Requires: %{name}%{?_isa} = %{version}-%{release} in
     python3-limits
[?]: 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.
[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:
[!]: Spec file according to URL is the same as in SRPM.
     Note: Bad spec filename: /home/reviewer/2084040-python-limits/srpm-
     unpacked/python-limits.spec
     See: (this test has no URL)
[x]: Rpmlint is run on all installed packages.
     Note: There are rpmlint messages (see attachment).


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


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


Source checksums
----------------
https://github.com/alisaifee/limits/archive/2.6.1/limits-2.6.1.tar.gz :
  CHECKSUM(SHA256) this package     :
6238ca7aa9f87b8bc5a14a6f000e6e613e61f173491b6636bcc144e540de5656
  CHECKSUM(SHA256) upstream package :
3664d4271ad914590ab95e57dd66cb85f42afced0e79203d99614d3bca8d4caa
diff -r also reports differences


Requires
--------
python3-limits (rpmlib, GLIBC filtered):
    (python3.10dist(packaging) < 22~~ with python3.10dist(packaging) >= 21)
    python(abi)
    python3.10dist(deprecated)
    python3.10dist(setuptools)
    python3.10dist(typing-extensions)

python-limits-doc (rpmlib, GLIBC filtered):



Provides
--------
python3-limits:
    python-limits
    python3-limits
    python3.10-limits
    python3.10dist(limits)
    python3dist(limits)

python-limits-doc:
    python-limits-doc



Generated by fedora-review 0.8.0 (e988316) last change: 2022-04-07
Command line :/usr/bin/fedora-review -b 2084040
Buildroot used: fedora-rawhide-x86_64
Active plugins: Shell-api, Python, Generic
Disabled plugins: fonts, Haskell, PHP, Java, R, C/C++, Perl, Ocaml,
SugarActivity
Disabled flags: EPEL6, EPEL7, DISTTAG, BATCH, EXARCH
============================ rpmlint session starts
============================
rpmlint: 2.2.0
configuration:
    /usr/lib/python3.10/site-packages/rpmlint/configdefaults.toml
    /etc/xdg/rpmlint/fedora.toml
    /etc/xdg/rpmlint/licenses.toml
    /etc/xdg/rpmlint/scoring.toml
    /etc/xdg/rpmlint/users-groups.toml
    /etc/xdg/rpmlint/warn-on-functions.toml
checks: 32, packages: 3

python-limits-doc.noarch: W: no-documentation
python-limits-doc.noarch: W: description-shorter-than-summary
 3 packages and 0 specfiles checked; 0 errors, 2 warnings, 0 badness; has taken
0.5 s


-- 
You are receiving this mail because:
You are on the CC list for the bug.
You are always notified about changes to this product and component
https://bugzilla.redhat.com/show_bug.cgi?id=2084040
_______________________________________________
package-review mailing list -- package-review@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to package-review-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/package-review@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure




[Index of Archives]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite Conditions]     [KDE Users]

  Powered by Linux