%bcond_without check
%global pypi_name pre-commit
Name: %{pypi_name}
Version: 2.13.0
Release: 1%{?dist}
Summary: Framework for managing and maintaining multi-language pre-commit hooks
License: MIT
URL: https://pre-commit.com
Source0: https://github.com/%{name}/%{name}/archive/v%{version}/%{name}-%{version}.tar.gz
Patch0: 0001-disable-tests-with-network-install.patch
BuildArch: noarch
BuildRequires: python3-devel
BuildRequires: python3dist(setuptools)
%if %{with check}
BuildRequires: git-core
BuildRequires: python3dist(aspy.yaml)
BuildRequires: python3dist(cfgv) >= 2.0.0
BuildRequires: python3dist(flake8)
BuildRequires: python3dist(identify) >= 1.0.0
BuildRequires: npm
BuildRequires: nodejs
BuildRequires: rubygems
BuildRequires: python3dist(mock)
BuildRequires: python3dist(re-assert)
BuildRequires: python3dist(nodeenv) >= 0.11.1
BuildRequires: python3dist(pytest)
BuildRequires: python3dist(pyyaml)
BuildRequires: python3dist(six)
BuildRequires: python3dist(toml)
BuildRequires: python3dist(virtualenv) >= 20
%endif
%description
A framework for managing and maintaining multi-language pre-commit hooks.
%prep
%autosetup -p1
# Remove bundled egg-info
rm -rf %{pypi_name}.egg-info
%build
%py3_build
%install
%py3_install
%if %{with check}
%check
git init
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
export PYTHONPATH=%{buildroot}%{python3_sitelib}
# Disable few tests
# * 'make_archives_test' and 'repository_test' need a network connection, hence disabled.
# * 'install_uninstall_test' needs pytest-env (currently not packaged)
%pytest -v \
--deselect tests/make_archives_test.py \
--deselect tests/repository_test.py \
--deselect tests/commands/install_uninstall_test.py
%endif
%files
%license LICENSE
%doc README.md CHANGELOG.md CONTRIBUTING.md
%{_bindir}/%{pypi_name}
%{_bindir}/%{pypi_name}-validate-config
%{_bindir}/%{pypi_name}-validate-manifest
%{python3_sitelib}/pre_commit/
%{python3_sitelib}/pre_commit-%{version}-py%{python3_version}.egg-info/
%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
* Sun Mar 21 2021 Chedi Toueiti <chedi.toueiti@gmail.com> - 2.11.1-1
- Update to version 2.11.1
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.5.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.5.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Mon Jun 22 2020 Lumír Balhar <lbalhar@redhat.com> - 2.5.1-1
- Update to 2.5.1
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 2.4.0-2
- Rebuilt for Python 3.9
* Wed May 13 2020 Artem Polishchuk <ego.cordatus@gmail.com> - 2.4.0-1
- Update to 2.4.0
* Thu Apr 23 2020 Artem Polishchuk <ego.cordatus@gmail.com> - 2.3.0-1
- Update to 2.3.0
* Thu Mar 12 2020 Artem Polishchuk <ego.cordatus@gmail.com> - 2.2.0-1
- Update to 2.2.0
* Mon Feb 24 2020 Artem Polishchuk <ego.cordatus@gmail.com> - 2.1.1-1
- Update to 2.1.1
* Mon Feb 24 2020 Artem Polishchuk <ego.cordatus@gmail.com> - 2.1.0-1
- Update to 2.1.0
* Mon Jan 20 2020 Artem Polishchuk <ego.cordatus@gmail.com> - 1.21.0-1
- Update to 1.21.0
- Thanks Aniket Pradhan <major AT fedoraproject DOT org> for help with packaging
- Thanks Miro Hrončok <mhroncok@redhat.com> for help with packaging
* Sun Dec 08 2019 Artem Polishchuk <ego.cordatus@gmail.com> - 1.20.0-1
- Update to 1.20.0
* Thu Oct 24 2019 Artem Polishchuk <ego.cordatus@gmail.com> - 1.18.3-8
- Update to 1.18.3
* Sat Mar 30 2019 Artem Polishchuk <ego.cordatus@gmail.com> - 1.14.4-1
- Initial package