#3 Update to v2.13.0
Merged 2 years ago by churchyard. Opened 2 years ago by major.
rpms/ major/pre-commit rawhide  into  rawhide

file modified
+1
@@ -7,3 +7,4 @@ 

  /pre-commit-2.5.1.tar.gz

  /pre_commit-2.11.1.tar.gz

  /pre-commit-2.11.1.tar.gz

+ /pre-commit-2.13.0.tar.gz

file modified
+13 -11
@@ -2,8 +2,8 @@ 

  %global pypi_name pre-commit

  

  Name:           %{pypi_name}

- Version:        2.11.1

- Release:        2%{?dist}

+ Version:        2.13.0

+ Release:        1%{?dist}

  Summary:        Framework for managing and maintaining multi-language pre-commit hooks

  

  License:        MIT
@@ -12,7 +12,7 @@ 

  Patch0:         0001-disable-tests-with-network-install.patch

  BuildArch:      noarch

  

- BuildRequires:  python3-devel >= 3.6.1

+ BuildRequires:  python3-devel

  BuildRequires:  python3dist(setuptools)

  

  %if %{with check}
@@ -21,9 +21,6 @@ 

  BuildRequires:  python3dist(cfgv) >= 2.0.0

  BuildRequires:  python3dist(flake8)

  BuildRequires:  python3dist(identify) >= 1.0.0

- %if 0%{?fedora} <= 31

- BuildRequires:  python3dist(importlib-metadata)

- %endif

  BuildRequires:  npm

  BuildRequires:  nodejs

  BuildRequires:  rubygems
@@ -37,8 +34,6 @@ 

  BuildRequires:  python3dist(virtualenv) >= 20

  %endif

  

- %?python_enable_dependency_generator

- 

  %description

  A framework for managing and maintaining multi-language pre-commit hooks.

  
@@ -68,9 +63,9 @@ 

  # Disable few tests

  # * 'make_archives_test' and 'repository_test' need a network connection, hence disabled.

  # * 'install_uninstall_test' needs pytest-env (currently not packaged)

- %{python3} -m pytest -v                                 \

-     --deselect tests/make_archives_test.py              \

-     --deselect tests/repository_test.py                 \

+ %pytest -v \

+     --deselect tests/make_archives_test.py \

+     --deselect tests/repository_test.py \

      --deselect tests/commands/install_uninstall_test.py

  %endif

  
@@ -86,6 +81,13 @@ 

  

  

  %changelog

+ * Sat Jul 03 2021 Aniket Pradhan <major AT fedoraproject DOT org> - 2.13.0-1

+ - Version update to 2.13.0

+ - Remove redundant dependency generator call

+ - Use pytest macro

+ - Remove unnecessary python-devel version requirement

+ - Removed the dependency for Fedora 31 or lower

+ 

  * Fri Jun 04 2021 Python Maint <python-maint@redhat.com> - 2.11.1-2

  - Rebuilt for Python 3.10

  

file modified
+1 -1
@@ -1,1 +1,1 @@ 

- SHA512 (pre-commit-2.11.1.tar.gz) = 92c6eb5e9af2ef5c9a3707ea0c168dca6f07981814685c552c7c239aa60664d07c0f6b8c9a648d7e5627e3536725dc3c8323d9fddae3a8fd607fb087e395bc15

+ SHA512 (pre-commit-2.13.0.tar.gz) = 5dfc297b3f900afef8f1c355b38ce086af7c836d1e577af8ec95ffb30e82df8b866131da4ff12933339bda63e4a90833c3852265d4f2d4a59bf92bce2b972a5e

Update to v2.13.0 + Some other small fixes

Juts curious, why was the %if %{with check} conditional moved?

Cosmetic nitpick: The macro is documented as %pytest and similarly to %py3_build or %py3_install (and unlike %{python3}), it expands to a complex command rather than simple "value". There is no rule, but I prefer %pytest over %{pytest}.

Hey,

Juts curious, why was the %if %{with check} conditional moved?

I think that the %check block should be present in the spec, but it shouldn't run the code in it if not running without check. If the former is preferred, let me know so I would update it.

Cosmetic nitpick: The macro is documented as %pytest and similarly to %py3_build or %py3_install (and unlike %{python3}), it expands to a complex command rather than simple "value". There is no rule, but I prefer %pytest over %{pytest}.

Of course, I'll change it to %pytest. I agree it looks more "cleaner" that way. Although I still don't understand what you mean by complex command rather than "value". Both macros seem to evaluate to the same expression.

$ rpm -E %pytest
\
  CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}"\
  PATH="/home/major/rpmbuild/BUILDROOT/%{NAME}-%{VERSION}-%{RELEASE}.x86_64/usr/bin:$PATH"\
  PYTHONPATH="${PYTHONPATH:-/home/major/rpmbuild/BUILDROOT/%{NAME}-%{VERSION}-%{RELEASE}.x86_64/usr/lib64/python3.9/site-packages:/home/major/rpmbuild/BUILDROOT/%{NAME}-%{VERSION}-%{RELEASE}.x86_64/usr/lib/python3.9/site-packages}"\
  PYTHONDONTWRITEBYTECODE=1\
  /usr/bin/pytest

$ rpm -E %{pytest}
\
  CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}"\
  PATH="/home/major/rpmbuild/BUILDROOT/%{NAME}-%{VERSION}-%{RELEASE}.x86_64/usr/bin:$PATH"\
  PYTHONPATH="${PYTHONPATH:-/home/major/rpmbuild/BUILDROOT/%{NAME}-%{VERSION}-%{RELEASE}.x86_64/usr/lib64/python3.9/site-packages:/home/major/rpmbuild/BUILDROOT/%{NAME}-%{VERSION}-%{RELEASE}.x86_64/usr/lib/python3.9/site-packages}"\
  PYTHONDONTWRITEBYTECODE=1\
  /usr/bin/pytest

1 new commit added

  • Use %pytest instead of %{pytest} macro
2 years ago

rebased onto 4cc9e70

2 years ago

I think that the %check block should be present in the spec, but it shouldn't run the code in it if not running without check...

I think that a %check block that does nothing is only confusing. That's why the %if was above.

...Both macros seem to evaluate to the same expression.

Yeas, they do. It is just a matter of how it is read by humans, not machines.

rebased onto 48dac7d

2 years ago

I think that a %check block that does nothing is only confusing. That's why the %if was above.

Well, that also makes sense. I have corrected the changes now as requested. I'll also keep an eye on existing packages I maintain for the same issue.

Thanks a lot for the review, Miro. I guess the PR should be safe to merge now. :smile:

Indeed looks perfect now, thank you!

Pull-Request has been merged by churchyard

2 years ago

Building pre-commit-2.13.0-1.fc35 for rawhide
Created task: 71304023
Task info: https://koji.fedoraproject.org/koji/taskinfo?taskID=71304023