From 84cdbc39a13f54af166b7fad64bfbb85f8d81daf Mon Sep 17 00:00:00 2001 From: rdobuilder Date: Sep 07 2022 09:25:56 +0000 Subject: Update to 0.7.0 Apply patch to avoid using missing dep - hypothesmith. Related-to: https://review.rdoproject.org/r/q/Ia43ee76a87edc2120b6a6e065ed20b43558bfff0 --- diff --git a/.python-mccabe.metadata b/.python-mccabe.metadata new file mode 100644 index 0000000..ff3b400 --- /dev/null +++ b/.python-mccabe.metadata @@ -0,0 +1 @@ +f2d1a06b8cd25616e858dee590c5032d89f72694 SOURCES/mccabe-0.7.0.tar.gz diff --git a/SOURCES/.gitignore b/SOURCES/.gitignore new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/SOURCES/.gitignore diff --git a/SOURCES/0001-skip-hypothesmith-test.patch b/SOURCES/0001-skip-hypothesmith-test.patch new file mode 100644 index 0000000..747f249 --- /dev/null +++ b/SOURCES/0001-skip-hypothesmith-test.patch @@ -0,0 +1,28 @@ +diff --git a/test_mccabe.py b/test_mccabe.py +index fe6e8d3..fb4c2e9 100644 +--- a/test_mccabe.py ++++ b/test_mccabe.py +@@ -239,21 +239,6 @@ class RegressionTests(unittest.TestCase): + self.assertEqual(0, mccabe.get_module_complexity("mccabe.py")) + + +-# This test uses the Hypothesis and Hypothesmith libraries to generate random +-# syntatically-valid Python source code and applies McCabe on it. +-@settings( +- max_examples=1000, # roughly 1k tests/minute, or half that under coverage +- derandomize=False, # deterministic mode to avoid CI flakiness +- deadline=None, # ignore Hypothesis' health checks; we already know that +- suppress_health_check=HealthCheck.all(), # this is slow and filter-heavy. +-) +-@given( +- # Note that while Hypothesmith might generate code unlike that written by +- # humans, it's a general test that should pass for any *valid* source code. +- # (so e.g. running it against code scraped of the internet might also help) +- src_contents=hypothesmith.from_grammar() | hypothesmith.from_node(), +- max_complexity=st.integers(min_value=1), +-) + @pytest.mark.skipif(not hypothesmith, reason="hypothesmith could not be imported") + def test_idempotent_any_syntatically_valid_python( + src_contents: str, max_complexity: int + + diff --git a/SPECS/python-mccabe.spec b/SPECS/python-mccabe.spec new file mode 100644 index 0000000..97275a6 --- /dev/null +++ b/SPECS/python-mccabe.spec @@ -0,0 +1,186 @@ +Name: python-mccabe +Version: 0.7.0 +Release: 1%{?dist} +Summary: McCabe complexity checker +License: MIT +URL: http://pypi.python.org/pypi/mccabe +Source: %{pypi_source mccabe} + +Patch1: 0001-skip-hypothesmith-test.patch + +BuildArch: noarch +BuildRequires: python%{python3_pkgversion}-devel +BuildRequires: python%{python3_pkgversion}-pytest +BuildRequires: pyproject-rpm-macros + +%global _description %{expand: +Ned's script to check McCabe complexity. + +This module provides a plugin for flake8, the Python code +checker.} + +%description %_description + + +%package -n python%{python3_pkgversion}-mccabe +Summary: %{summary} + +%description -n python%{python3_pkgversion}-mccabe %_description + + +%prep +%autosetup -p1 -n mccabe-%{version} + + +%generate_buildrequires +%pyproject_buildrequires + + +%build +%pyproject_wheel + + +%install +%pyproject_install +%pyproject_save_files mccabe + + +%check +%pytest -v + + +%files -n python%{python3_pkgversion}-mccabe -f %{pyproject_files} +%doc README.rst + + +%changelog +* Tue Aug 02 2022 Ali Erdinc Koroglu - 0.7.0-1 +- Update to 0.7.0 (RHBZ #2044115) + +* Fri Jul 22 2022 Fedora Release Engineering - 0.6.1-23 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Mon Jun 13 2022 Python Maint - 0.6.1-22 +- Rebuilt for Python 3.11 + +* Fri Jan 21 2022 Fedora Release Engineering - 0.6.1-21 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Fri Jul 23 2021 Fedora Release Engineering - 0.6.1-20 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Fri Jun 04 2021 Python Maint - 0.6.1-19 +- Rebuilt for Python 3.10 + +* Wed Jan 27 2021 Fedora Release Engineering - 0.6.1-18 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Wed Jul 29 2020 Fedora Release Engineering - 0.6.1-17 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Sun May 24 2020 Miro Hrončok - 0.6.1-16 +- Rebuilt for Python 3.9 + +* Thu Jan 30 2020 Fedora Release Engineering - 0.6.1-15 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Thu Oct 03 2019 Miro Hrončok - 0.6.1-14 +- Rebuilt for Python 3.8.0rc1 (#1748018) + +* Sat Aug 17 2019 Miro Hrončok - 0.6.1-13 +- Rebuilt for Python 3.8 + +* Fri Jul 26 2019 Fedora Release Engineering - 0.6.1-12 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Wed Feb 27 2019 Miro Hrončok - 0.6.1-11 +- Remove Python 2 subpackage + +* Sat Feb 02 2019 Fedora Release Engineering - 0.6.1-10 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Sat Jul 14 2018 Fedora Release Engineering - 0.6.1-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Mon Jun 18 2018 Miro Hrončok - 0.6.1-8 +- Rebuilt for Python 3.7 + +* Fri Feb 09 2018 Fedora Release Engineering - 0.6.1-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Wed Oct 25 2017 Matěj Cepl - 0.6.1-6 +- Fix wrong conditional + +* Tue Oct 24 2017 Matěj Cepl - 0.6.1-5 +- Apply fix for building on EPEL7, thanks to mvadkert. + +* Thu Jul 27 2017 Fedora Release Engineering - 0.6.1-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Sun Jun 25 2017 Ville Skyttä - 0.6.1-3 +- Use explicit python2-* dependencies where available +- Build Python 3 version by default on EL7 + +* Sat Feb 11 2017 Fedora Release Engineering - 0.6.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Fri Jan 27 2017 Ville Skyttä - 0.6.1-1 +- Update to 0.6.1 + +* Tue Jan 24 2017 Ville Skyttä - 0.6.0-1 +- Update to 0.6.0 + +* Thu Jan 12 2017 Ville Skyttä - 0.5.3-1 +- Update to 0.5.3 +- Drop pytest-runner avoidance patch + +* Tue Dec 13 2016 Stratakis Charalampos - 0.5.2-3 +- Rebuild for Python 3.6 + +* Mon Oct 24 2016 Orion Poplawski - 0.5.2-2 +- Enable python3 for EPEL +- Ship python2-mccabe +- Ship LICENSE +- Modernize spec + +* Sun Aug 14 2016 Ville Skyttä - 0.5.2-1 +- Update to 0.5.2 + +* Sat Aug 13 2016 Ville Skyttä - 0.5.0-3 +- Add python3-pytest build dep, patch to build/test without pytest-runner + +* Tue Jul 19 2016 Fedora Release Engineering - 0.5.0-2 +- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages + +* Wed Jun 01 2016 Matěj Cepl - 0.5.0-1 +- Upstream upgrade + +* Thu Feb 04 2016 Fedora Release Engineering - 0.4.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Thu Jan 28 2016 Matěj Cepl - 0.4.0-1 +- Upstream upgrade + +* Fri Nov 06 2015 Robert Kuska - 0.2.1-8 +- Rebuilt for Python3.5 rebuild + +* Thu Jun 18 2015 Fedora Release Engineering - 0.2.1-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Sat Jun 07 2014 Fedora Release Engineering - 0.2.1-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Wed May 14 2014 Bohuslav Kabrda - 0.2.1-5 +- Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4 + +* Tue Apr 29 2014 Matěj Cepl - 0.2.1-4 +- Fix building on RHEL-7 (we really don’t have Python3) + +* Sun Aug 04 2013 Fedora Release Engineering - 0.2.1-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Mon Apr 15 2013 Matěj Cepl 0.2.1-2 +- Fix %%changelog. + +* Sun Apr 14 2013 Matěj Cepl 0.2.1-1 +- initial package for Fedora