music / rpms / pre-commit

Forked from rpms/pre-commit 2 years ago
Clone
2ee3794
%bcond_without check
2ee3794
432435f
Name:           pre-commit
71583b4
Version:        3.1.0
86891af
Release:        1%{?dist}
2ee3794
Summary:        Framework for managing and maintaining multi-language pre-commit hooks
2ee3794
06c31e7
# SPDX
2ee3794
License:        MIT
2ee3794
URL:            https://pre-commit.com
2ee3794
Source0:        https://github.com/%{name}/%{name}/archive/v%{version}/%{name}-%{version}.tar.gz
432435f
2ee3794
BuildArch:      noarch
2ee3794
48dac7d
BuildRequires:  python3-devel
2ee3794
2ee3794
%if %{with check}
1ad2c11
# All of the tests for the following require network access, so we can avoid
1ad2c11
# pulling in these dependencies for now.
1ad2c11
#
1ad2c11
# BuildRequires:  R-core
1ad2c11
# BuildRequires:  conda
1ad2c11
# BuildRequires:  dotnet-host
71583b4
# BuildRequires:  dotnet-hostfxr-7.0
71583b4
# BuildRequires:  dotnet-sdk-7.0
1ad2c11
# BuildRequires:  golang-bin
1ad2c11
1ad2c11
# These BR’s would enable a few extra tests, but are inconveniently
1ad2c11
# ExclusiveArch. If we wanted to conditionalize BR’s based on build
1ad2c11
# architecture, we would have to make *this* package arched.
1ad2c11
#
1ad2c11
# BuildRequires:  swift-lang
1ad2c11
1ad2c11
BuildRequires:  cargo
2ee3794
BuildRequires:  git-core
43be54f
BuildRequires:  lua-devel
43be54f
BuildRequires:  luarocks
1ad2c11
BuildRequires:  nodejs
86891af
BuildRequires:  npm
1ad2c11
BuildRequires:  perl-CPAN
eb33c72
BuildRequires:  ruby
1ad2c11
BuildRequires:  rubygems
83d8274
83d8274
# Manually added to speed up the %%check section
83d8274
BuildRequires:  python3dist(pytest-xdist)
2ee3794
%endif
2ee3794
2ee3794
%description
2ee3794
A framework for managing and maintaining multi-language pre-commit hooks.
2ee3794
2ee3794
2ee3794
%prep
2ee3794
%autosetup -p1
432435f
# Do not generate BR’s for coverage, linters, etc.:
432435f
sed -r '/^(covdefaults|coverage)\b/d' requirements-dev.txt |
432435f
  tee requirements-dev-filtered.txt
432435f
2ee3794
432435f
%generate_buildrequires
432435f
%pyproject_buildrequires -r %{?with_check:requirements-dev-filtered.txt}
2ee3794
2ee3794
2ee3794
%build
432435f
%pyproject_wheel
2ee3794
2ee3794
2ee3794
%install
432435f
%pyproject_install
432435f
%pyproject_save_files pre_commit
2ee3794
2ee3794
2ee3794
%if %{with check}
2ee3794
%check
2ee3794
git init
2ee3794
git config --global user.email "you@example.com"
2ee3794
git config --global user.name "Your Name"
1ad2c11
1ad2c11
# For general discusson on test failures building distribution packages, see:
1ad2c11
# https://github.com/pre-commit/pre-commit/issues/1183,
1ad2c11
# https://github.com/pre-commit/pre-commit/issues/1202
1ad2c11
#
1ad2c11
# Require network access:
1ad2c11
# See https://github.com/pre-commit/pre-commit/issues/1202
1ad2c11
k="${k-}${k+ and }not test_additional_dependencies_roll_forward"
1ad2c11
k="${k-}${k+ and }not test_additional_golang_dependencies_installed"
1ad2c11
k="${k-}${k+ and }not test_additional_node_dependencies_installed"
1ad2c11
k="${k-}${k+ and }not test_additional_ruby_dependencies_installed"
1ad2c11
k="${k-}${k+ and }not test_additional_rust_cli_dependencies_installed"
1ad2c11
k="${k-}${k+ and }not test_additional_rust_lib_dependencies_installed"
86891af
k="${k-}${k+ and }not test_conda_additional_deps"
1ad2c11
k="${k-}${k+ and }not test_conda_hook"
86891af
k="${k-}${k+ and }not test_conda_language"
1ad2c11
k="${k-}${k+ and }not test_conda_with_additional_dependencies_hook"
71583b4
k="${k-}${k+ and }not test_dotnet_combo_proj1"
71583b4
k="${k-}${k+ and }not test_dotnet_combo_proj2"
71583b4
k="${k-}${k+ and }not test_dotnet_csproj"
71583b4
k="${k-}${k+ and }not test_dotnet_csproj_prefix"
1ad2c11
k="${k-}${k+ and }not test_dotnet_hook"
71583b4
k="${k-}${k+ and }not test_dotnet_sln"
71583b4
k="${k-}${k+ and }not test_golang_default_version"
1ad2c11
k="${k-}${k+ and }not test_golang_hook"
1ad2c11
k="${k-}${k+ and }not test_golang_hook_still_works_when_gobin_is_set"
86891af
k="${k-}${k+ and }not test_golang_infer_go_version_default"
71583b4
k="${k-}${k+ and }not test_golang_system"
86891af
k="${k-}${k+ and }not test_golang_system_hook"
71583b4
k="${k-}${k+ and }not test_golang_versioned"
86891af
k="${k-}${k+ and }not test_golang_versioned_hook"
1ad2c11
k="${k-}${k+ and }not test_golang_with_recursive_submodule"
1ad2c11
k="${k-}${k+ and }not test_install_ruby_with_version"
86891af
k="${k-}${k+ and }not test_installs_rust_missing_rustup"
7a7c958
k="${k-}${k+ and }not test_installs_with_bootstrapped_rustup"
7a7c958
k="${k-}${k+ and }not test_installs_with_existing_rustup"
1ad2c11
k="${k-}${k+ and }not test_installs_without_links_outside_env"
1ad2c11
k="${k-}${k+ and }not test_local_conda_additional_dependencies"
1ad2c11
k="${k-}${k+ and }not test_local_golang_additional_dependencies"
71583b4
k="${k-}${k+ and }not test_local_golang_additional_deps"
43be54f
k="${k-}${k+ and }not test_local_lua_additional_dependencies"
1ad2c11
k="${k-}${k+ and }not test_local_perl_additional_dependencies"
1ad2c11
k="${k-}${k+ and }not test_local_rust_additional_dependencies"
86891af
k="${k-}${k+ and }not test_lua_additional_dependencies"
86891af
k="${k-}${k+ and }not test_node_additional_deps"
86891af
k="${k-}${k+ and }not test_node_hook_versions"
86891af
k="${k-}${k+ and }not test_perl_additional_dependencies"
1ad2c11
k="${k-}${k+ and }not test_r_hook"
86891af
k="${k-}${k+ and }not test_r_inline"
1ad2c11
k="${k-}${k+ and }not test_r_inline_hook"
1ad2c11
k="${k-}${k+ and }not test_r_local_with_additional_dependencies_hook"
1ad2c11
k="${k-}${k+ and }not test_r_with_additional_dependencies_hook"
86891af
k="${k-}${k+ and }not test_ruby_additional_deps"
86891af
k="${k-}${k+ and }not test_ruby_hook_language_version"
86891af
k="${k-}${k+ and }not test_ruby_with_bundle_disable_shared_gems"
1ad2c11
k="${k-}${k+ and }not test_run_a_node_hook_default_version"
86891af
k="${k-}${k+ and }not test_run_lib_additional_dependencies"
1ad2c11
k="${k-}${k+ and }not test_run_ruby_hook_with_disable_shared_gems"
1ad2c11
k="${k-}${k+ and }not test_run_versioned_node_hook"
1ad2c11
k="${k-}${k+ and }not test_run_versioned_ruby_hook"
86891af
k="${k-}${k+ and }not test_rust_cli_additional_dependencies"
86891af
# Fails in koji but not in mock (Executable `ruby_hook` not found)
86891af
k="${k-}${k+ and }not test_ruby_hook_system"
86891af
# Requires rustup (not packaged), and would require network access even if
86891af
# rustup were available:
86891af
k="${k-}${k+ and }not test_language_version_with_rustup"
86891af
# Requires coursier (not packaged):
86891af
k="${k-}${k+ and }not test_coursier_hook"
86891af
k="${k-}${k+ and }not test_coursier_hook_additional_dependencies"
86891af
k="${k-}${k+ and }not test_error_if_no_deps_or_channel"
1ad2c11
# Requires dart (not packaged):
86891af
k="${k-}${k+ and }not test_dart"
86891af
k="${k-}${k+ and }not test_dart_additional_deps"
86891af
k="${k-}${k+ and }not test_dart_additional_deps_versioned"
1ad2c11
k="${k-}${k+ and }not test_dart_hook"
1ad2c11
k="${k-}${k+ and }not test_local_dart_additional_dependencies"
1ad2c11
k="${k-}${k+ and }not test_local_dart_additional_dependencies_versioned"
86891af
# Requires swift-lang, which we have chosen not to BuildRequire; see comments
86891af
# earlier in the spec file:
86891af
k="${k-}${k+ and }not test_swift_language"
71583b4
# Requires docker (not packaged)
71583b4
k="${k-}${k+ and }not test_docker_hook"
71583b4
k="${k-}${k+ and }not test_docker_image_hook_via_args"
71583b4
k="${k-}${k+ and }not test_docker_image_hook_via_entrypoint"
1ad2c11
# Does not work under (i.e., respect) an “external” PYTHONPATH
1ad2c11
k="${k-}${k+ and }not test_installed_from_venv"
1ad2c11
# Fails in koji but not local mock (hook exits with code 1, no useful output)
1ad2c11
k="${k-}${k+ and }not test_run_a_ruby_hook"
83d8274
%pytest -v -k "${k-}" -n %{_smp_build_ncpus}
2ee3794
%endif
2ee3794
2ee3794
432435f
%files -f %{pyproject_files}
2ee3794
%doc README.md CHANGELOG.md CONTRIBUTING.md
432435f
%{_bindir}/pre-commit
2ee3794
2ee3794
2ee3794
%changelog
71583b4
* Thu Feb 23 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 3.1.0-1
71583b4
- Update to 3.1.0 (close RHBZ#2172751)
71583b4
86891af
* Fri Feb 03 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 3.0.4-1
86891af
- Update to 3.0.4 (close RHBZ#2163591)
86891af
7f763ca
* Mon Jan 23 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 2.21.0-2
7f763ca
- Use ruby, not rubypick
7f763ca
7a7c958
* Fri Jan 20 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 2.21.0-1
7a7c958
- Update to 2.21.0 (close RHBZ#2156253); fixes FTBFS with git ≥ 2.38.1
7a7c958
20eedf1
* Fri Jan 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 2.20.0-3
20eedf1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
20eedf1
48b8135
* Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 2.20.0-2
48b8135
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
48b8135
26c177b
* Tue Jul 12 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 2.20.0-1
26c177b
- Update to 2.20.0 (close RHBZ#2105849)
26c177b
9bb135b
* Mon Jun 13 2022 Python Maint <python-maint@redhat.com> - 2.19.0-2
9bb135b
- Rebuilt for Python 3.11
9bb135b
43be54f
* Sun May 15 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 2.19.0-1
43be54f
- Update to 2.19.0
43be54f
1ad2c11
* Thu Mar 24 2022 Benjamin A. Beasley <code@musicinmybrain.net> - 2.16.0-3
1ad2c11
- Use pytest-env, now that it is packaged
1ad2c11
- Skip tests more precisely/selectively
1ad2c11
- Drop unnecessary BR on deprecated python-mock
432435f
- Port to pyproject-rpm-macros
1ad2c11
c313941
* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 2.16.0-2
c313941
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
c313941
0bb129c
* Mon Dec 06 2021 Chedi Toueiti <chedi.toueiti@gmail.com> - 2.16.0-1
0bb129c
- Update to version 2.16.0 (#2027887)
0bb129c
5d15131
* Fri Oct 01 2021 Chedi Toueiti <chedi.toueiti@gmail.com> - 2.14.1-1
5d15131
- Update to version 2.15.0 (#2000799)
5d15131
915228e
* Wed Sep 01 2021 Chedi Toueiti <chedi.toueiti@gmail.com> - 2.14.1-1
915228e
- Upate to version 2.14.1 (#1990997)
915228e
aa6e571
* Tue Jul 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.13.0-2
aa6e571
- Second attempt - Rebuilt for
aa6e571
  https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
aa6e571
48dac7d
* Sat Jul 03 2021 Aniket Pradhan <major AT fedoraproject DOT org> - 2.13.0-1
48dac7d
- Version update to 2.13.0
48dac7d
- Remove redundant dependency generator call
48dac7d
- Use pytest macro
48dac7d
- Remove unnecessary python-devel version requirement
48dac7d
- Removed the dependency for Fedora 31 or lower
48dac7d
83f469b
* Fri Jun 04 2021 Python Maint <python-maint@redhat.com> - 2.11.1-2
83f469b
- Rebuilt for Python 3.10
83f469b
bb53b90
* Sun Mar 21 2021 Chedi Toueiti <chedi.toueiti@gmail.com> - 2.11.1-1
bb53b90
- Update to version 2.11.1
bb53b90
207591b
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.5.1-3
207591b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
207591b
da088d7
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.5.1-2
da088d7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
da088d7
6935c96
* Mon Jun 22 2020 Lumír Balhar <lbalhar@redhat.com> - 2.5.1-1
6935c96
- Update to 2.5.1
6935c96
1b0433c
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 2.4.0-2
1b0433c
- Rebuilt for Python 3.9
1b0433c
f7a8fe3
* Wed May 13 2020 Artem Polishchuk <ego.cordatus@gmail.com> - 2.4.0-1
f7a8fe3
- Update to 2.4.0
f7a8fe3
9cdca81
* Thu Apr 23 2020 Artem Polishchuk <ego.cordatus@gmail.com> - 2.3.0-1
9cdca81
- Update to 2.3.0
9cdca81
6d85319
* Thu Mar 12 2020 Artem Polishchuk <ego.cordatus@gmail.com> - 2.2.0-1
6d85319
- Update to 2.2.0
6d85319
6d9e79f
* Mon Feb 24 2020 Artem Polishchuk <ego.cordatus@gmail.com> - 2.1.1-1
6d9e79f
- Update to 2.1.1
6d9e79f
f3803fe
* Mon Feb 24 2020 Artem Polishchuk <ego.cordatus@gmail.com> - 2.1.0-1
f3803fe
- Update to 2.1.0
f3803fe
2ee3794
* Mon Jan 20 2020 Artem Polishchuk <ego.cordatus@gmail.com> - 1.21.0-1
2ee3794
- Update to 1.21.0
2ee3794
- Thanks Aniket Pradhan <major AT fedoraproject DOT org> for help with packaging
f3803fe
- Thanks Miro Hrončok <mhroncok@redhat.com> for help with packaging
2ee3794
2ee3794
* Sun Dec 08 2019 Artem Polishchuk <ego.cordatus@gmail.com> - 1.20.0-1
2ee3794
- Update to 1.20.0
2ee3794
2ee3794
* Thu Oct 24 2019 Artem Polishchuk <ego.cordatus@gmail.com> - 1.18.3-8
2ee3794
- Update to 1.18.3
2ee3794
2ee3794
* Sat Mar 30 2019 Artem Polishchuk <ego.cordatus@gmail.com> - 1.14.4-1
2ee3794
- Initial package