From 41a29cf3919ab10513155984044e1c3026c86643 Mon Sep 17 00:00:00 2001 From: Ankur Sinha (Ankur Sinha Gmail) Date: Sep 24 2021 08:56:30 +0000 Subject: [PATCH 1/14] feat: whitespace fixes and add changelog section --- diff --git a/python-pyplane.spec b/python-pyplane.spec index 7eb2bd2..26203bd 100644 --- a/python-pyplane.spec +++ b/python-pyplane.spec @@ -2,7 +2,8 @@ %bcond_without tests %global _description %{expand: - PyPlane is a free software for phase plane analysis of second order dynamical systems written in PYTHON and PyQT5. Comparable to MATLAB's pplane.} +PyPlane is a free software for phase plane analysis of second order dynamical +systems written in PYTHON and PyQT5. Comparable to MATLAB's pplane.} %global forgeurl https://github.com/TUD-RST/pyplane %global commit e8b9b8d7bfb75aa9289c22f9ff180c1a17fb7868 @@ -25,7 +26,7 @@ BuildArch: noarch %package -n python3-pyplane Summary: %{summary} -BuildRequires: python3-devel python3-pytest +BuildRequires: python3-devel python3-pytest BuildRequires: python3-pytest BuildRequires: matplotlib @@ -79,4 +80,5 @@ export PYTHONPATH='%{buildroot}%{python3_sitelib}:%{buildroot}%{python3_sitelib} %license COPYING %doc doc/_build/html -Add%autochangelog +%changelog +%autochangelog From 85b25fd2b9622c5da35354fec6e431fb8c1fe643 Mon Sep 17 00:00:00 2001 From: Ankur Sinha (Ankur Sinha Gmail) Date: Sep 24 2021 08:59:05 +0000 Subject: [PATCH 2/14] fix: correct matplotlib BRs We use the standard form --- diff --git a/python-pyplane.spec b/python-pyplane.spec index 26203bd..6aa5357 100644 --- a/python-pyplane.spec +++ b/python-pyplane.spec @@ -1,4 +1,3 @@ - %bcond_without tests %global _description %{expand: @@ -26,15 +25,15 @@ BuildArch: noarch %package -n python3-pyplane Summary: %{summary} -BuildRequires: python3-devel python3-pytest -BuildRequires: python3-pytest -BuildRequires: matplotlib +BuildRequires: python3-devel +BuildRequires: %{py3_dist pytest} +BuildRequires: %{py3_dist matplotlib} %description -n python3-pyplane %_description %package doc Summary: Documentation for %{name} -BuildRequires: make matplotlib +BuildRequires: make BuildRequires: %{py3_dist sphinx} %description doc From 7ce00abf5e955683abcea2b11025e621e53e4b79 Mon Sep 17 00:00:00 2001 From: Ankur Sinha (Ankur Sinha Gmail) Date: Sep 24 2021 09:01:31 +0000 Subject: [PATCH 3/14] feat: use macro to include install_requires during the build --- diff --git a/python-pyplane.spec b/python-pyplane.spec index 6aa5357..ee5ff12 100644 --- a/python-pyplane.spec +++ b/python-pyplane.spec @@ -27,7 +27,6 @@ BuildArch: noarch Summary: %{summary} BuildRequires: python3-devel BuildRequires: %{py3_dist pytest} -BuildRequires: %{py3_dist matplotlib} %description -n python3-pyplane %_description @@ -44,10 +43,8 @@ This package provides documentation for %{name}. %forgesetup %generate_buildrequires -%pyproject_buildrequires - -# can also use something like this -# %%pyproject_buildrequires -r %%{?with_tests:-x test} +# the install requirements seem to be required for tests, so include them +%pyproject_buildrequires %{?with_tests:-r} %build From 3a9ec1e318aebe6cece23b9f12246eca39e4d40f Mon Sep 17 00:00:00 2001 From: Ankur Sinha (Ankur Sinha Gmail) Date: Sep 24 2021 09:02:00 +0000 Subject: [PATCH 4/14] feat: only install pytest if tests are enabled --- diff --git a/python-pyplane.spec b/python-pyplane.spec index ee5ff12..0a9be34 100644 --- a/python-pyplane.spec +++ b/python-pyplane.spec @@ -26,7 +26,9 @@ BuildArch: noarch %package -n python3-pyplane Summary: %{summary} BuildRequires: python3-devel +%if %{with tests} BuildRequires: %{py3_dist pytest} +%endif %description -n python3-pyplane %_description From 21d9215d06be778c2c629a42a042cd862d3f116e Mon Sep 17 00:00:00 2001 From: Ankur Sinha (Ankur Sinha Gmail) Date: Sep 24 2021 09:04:31 +0000 Subject: [PATCH 5/14] feat: add missing texlive BRs --- diff --git a/python-pyplane.spec b/python-pyplane.spec index 0a9be34..3d9aac0 100644 --- a/python-pyplane.spec +++ b/python-pyplane.spec @@ -28,6 +28,9 @@ Summary: %{summary} BuildRequires: python3-devel %if %{with tests} BuildRequires: %{py3_dist pytest} +# bits not mentioned in install_requires +BuildRequires: texlive-latex +BuildRequires: texlive-dvipng %endif %description -n python3-pyplane %_description From db93576779ca86fbe0532ecbeba883ae8f8794e8 Mon Sep 17 00:00:00 2001 From: Ankur Sinha (Ankur Sinha Gmail) Date: Sep 24 2021 09:04:54 +0000 Subject: [PATCH 6/14] feat: remove uneeded tox invocation --- diff --git a/python-pyplane.spec b/python-pyplane.spec index 3d9aac0..98ede2e 100644 --- a/python-pyplane.spec +++ b/python-pyplane.spec @@ -69,7 +69,6 @@ This package provides documentation for %{name}. export PYTHONPATH='%{buildroot}%{python3_sitelib}:%{buildroot}%{python3_sitelib}/pyplane' %if %{with tests} %{pytest} -%{tox} %endif # LICENSE/COPYING are included in the dist-info, so we do not need to From 1cff8d1a410772199596f4820667916836b8d04b Mon Sep 17 00:00:00 2001 From: Ankur Sinha (Ankur Sinha Gmail) Date: Sep 24 2021 09:08:34 +0000 Subject: [PATCH 7/14] fix: correct readme file suffix --- diff --git a/python-pyplane.spec b/python-pyplane.spec index 98ede2e..7ba59ae 100644 --- a/python-pyplane.spec +++ b/python-pyplane.spec @@ -71,13 +71,11 @@ export PYTHONPATH='%{buildroot}%{python3_sitelib}:%{buildroot}%{python3_sitelib} %{pytest} %endif -# LICENSE/COPYING are included in the dist-info, so we do not need to -# explicitly list them again %files -n python3-pyplane -f %{pyproject_files} -%doc README.rst +%doc README.md AUTHORS %files doc -%license COPYING +%license LICENSE %doc doc/_build/html %changelog From c7a7772b69a73d8783cde8e05a207de0f307f099 Mon Sep 17 00:00:00 2001 From: Ankur Sinha (Ankur Sinha Gmail) Date: Sep 24 2021 09:10:35 +0000 Subject: [PATCH 8/14] feat: remove unneeded docs sub-package src has no docs --- diff --git a/python-pyplane.spec b/python-pyplane.spec index 7ba59ae..a81975d 100644 --- a/python-pyplane.spec +++ b/python-pyplane.spec @@ -35,15 +35,6 @@ BuildRequires: texlive-dvipng %description -n python3-pyplane %_description -%package doc -Summary: Documentation for %{name} -BuildRequires: make -BuildRequires: %{py3_dist sphinx} - -%description doc -This package provides documentation for %{name}. - - %prep %forgesetup @@ -55,12 +46,6 @@ This package provides documentation for %{name}. %build %pyproject_wheel -# Sometimes needed so sphinx can import the module -#PYTHONPATH=".:.." make -C doc SPHINXBUILD=sphinx-build-3 html - - -#rm -rf doc/_build/html/{.doctrees,.buildinfo} -vf - %install %pyproject_install %pyproject_save_files pyplane @@ -74,9 +59,5 @@ export PYTHONPATH='%{buildroot}%{python3_sitelib}:%{buildroot}%{python3_sitelib} %files -n python3-pyplane -f %{pyproject_files} %doc README.md AUTHORS -%files doc -%license LICENSE -%doc doc/_build/html - %changelog %autochangelog From 348297d7394c74d68185f3ddc9a9cad035c944ef Mon Sep 17 00:00:00 2001 From: Ankur Sinha (Ankur Sinha Gmail) Date: Sep 24 2021 09:11:14 +0000 Subject: [PATCH 9/14] feat: list runner file --- diff --git a/python-pyplane.spec b/python-pyplane.spec index a81975d..26271e7 100644 --- a/python-pyplane.spec +++ b/python-pyplane.spec @@ -58,6 +58,7 @@ export PYTHONPATH='%{buildroot}%{python3_sitelib}:%{buildroot}%{python3_sitelib} %files -n python3-pyplane -f %{pyproject_files} %doc README.md AUTHORS +%{_bindir}/pyplane %changelog %autochangelog From 72df66d79fef4e764d80e2dcfb8bdac97edad572 Mon Sep 17 00:00:00 2001 From: Ankur Sinha (Ankur Sinha Gmail) Date: Sep 24 2021 09:12:48 +0000 Subject: [PATCH 10/14] feat: add latex and dvipng as weak deps --- diff --git a/python-pyplane.spec b/python-pyplane.spec index 26271e7..e012012 100644 --- a/python-pyplane.spec +++ b/python-pyplane.spec @@ -33,6 +33,11 @@ BuildRequires: texlive-latex BuildRequires: texlive-dvipng %endif +# Optional but readme says they improve the graphs etc., so add them as weak +# dependencies +Recommends: texlive-latex +Recommends: texlive-dvipng + %description -n python3-pyplane %_description %prep From c08aa89807ce22d274a39b7188b073091e84e594 Mon Sep 17 00:00:00 2001 From: Ankur Sinha (Ankur Sinha Gmail) Date: Sep 24 2021 09:18:47 +0000 Subject: [PATCH 11/14] feat: use latest release (released 3 days ago) --- diff --git a/python-pyplane.spec b/python-pyplane.spec index e012012..f34c4ba 100644 --- a/python-pyplane.spec +++ b/python-pyplane.spec @@ -5,14 +5,15 @@ PyPlane is a free software for phase plane analysis of second order dynamical systems written in PYTHON and PyQT5. Comparable to MATLAB's pplane.} %global forgeurl https://github.com/TUD-RST/pyplane -%global commit e8b9b8d7bfb75aa9289c22f9ff180c1a17fb7868 -%forgemeta Name: python-pyplane -Version: 1.2.0 -Release: 0.1 +Version: 2.0.0 Summary: Phase plane analysis of nonlinear systems +%global tag PyPlane_v%{version} +%forgemeta + +Release: %autorelease # https://fedoraproject.org/wiki/Licensing:Main?rd=Licensing#Good_Licenses License: GPLv3 URL: %{forgeurl} From d9f262261ac17527ef938516cf5d672298f01763 Mon Sep 17 00:00:00 2001 From: Ankur Sinha (Ankur Sinha Gmail) Date: Sep 24 2021 09:19:17 +0000 Subject: [PATCH 12/14] feat: update license to GPLv3+ --- diff --git a/python-pyplane.spec b/python-pyplane.spec index f34c4ba..23f9e18 100644 --- a/python-pyplane.spec +++ b/python-pyplane.spec @@ -14,8 +14,7 @@ Summary: Phase plane analysis of nonlinear systems %forgemeta Release: %autorelease -# https://fedoraproject.org/wiki/Licensing:Main?rd=Licensing#Good_Licenses -License: GPLv3 +License: GPLv3+ URL: %{forgeurl} Source0: %{forgesource} From 9e810ea4143aab26d9cf54b7873ce936b34f6bae Mon Sep 17 00:00:00 2001 From: Ankur Sinha (Ankur Sinha Gmail) Date: Sep 24 2021 09:25:49 +0000 Subject: [PATCH 13/14] feat: rename to pyplane Since it's an app and not meant to be an importable module, we don't need to call it python-pyplane etc. https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_application_naming --- diff --git a/pyplane.spec b/pyplane.spec new file mode 100644 index 0000000..27cd56a --- /dev/null +++ b/pyplane.spec @@ -0,0 +1,67 @@ +%bcond_without tests + +%global _description %{expand: +PyPlane is a free software for phase plane analysis of second order dynamical +systems written in PYTHON and PyQT5. Comparable to MATLAB's pplane.} + +%global forgeurl https://github.com/TUD-RST/pyplane + +Name: pyplane +Version: 2.0.0 +Summary: Phase plane analysis of nonlinear systems + +%global tag PyPlane_v%{version} +%forgemeta + +Release: %autorelease +License: GPLv3+ +URL: %{forgeurl} +Source0: %{forgesource} + +BuildArch: noarch + +BuildRequires: python3-devel +%if %{with tests} +BuildRequires: %{py3_dist pytest} +# bits not mentioned in install_requires +BuildRequires: texlive-latex +BuildRequires: texlive-dvipng +%endif + +# Optional but readme says they improve the graphs etc., so add them as weak +# dependencies +Recommends: texlive-latex +Recommends: texlive-dvipng + +# Add virtual provides to help users find it +Provides: python3-pyplane + +%description %_description + +%prep +%forgesetup + +%generate_buildrequires +# the install requirements seem to be required for tests, so include them +%pyproject_buildrequires %{?with_tests:-r} + + +%build +%pyproject_wheel + +%install +%pyproject_install +%pyproject_save_files pyplane + +%check +export PYTHONPATH='%{buildroot}%{python3_sitelib}:%{buildroot}%{python3_sitelib}/pyplane' +%if %{with tests} +%{pytest} +%endif + +%files -f %{pyproject_files} +%doc README.md AUTHORS +%{_bindir}/pyplane + +%changelog +%autochangelog diff --git a/python-pyplane.spec b/python-pyplane.spec deleted file mode 100644 index 23f9e18..0000000 --- a/python-pyplane.spec +++ /dev/null @@ -1,69 +0,0 @@ -%bcond_without tests - -%global _description %{expand: -PyPlane is a free software for phase plane analysis of second order dynamical -systems written in PYTHON and PyQT5. Comparable to MATLAB's pplane.} - -%global forgeurl https://github.com/TUD-RST/pyplane - -Name: python-pyplane -Version: 2.0.0 -Summary: Phase plane analysis of nonlinear systems - -%global tag PyPlane_v%{version} -%forgemeta - -Release: %autorelease -License: GPLv3+ -URL: %{forgeurl} -Source0: %{forgesource} - -BuildArch: noarch - - -%description %_description - -%package -n python3-pyplane -Summary: %{summary} -BuildRequires: python3-devel -%if %{with tests} -BuildRequires: %{py3_dist pytest} -# bits not mentioned in install_requires -BuildRequires: texlive-latex -BuildRequires: texlive-dvipng -%endif - -# Optional but readme says they improve the graphs etc., so add them as weak -# dependencies -Recommends: texlive-latex -Recommends: texlive-dvipng - -%description -n python3-pyplane %_description - -%prep -%forgesetup - -%generate_buildrequires -# the install requirements seem to be required for tests, so include them -%pyproject_buildrequires %{?with_tests:-r} - - -%build -%pyproject_wheel - -%install -%pyproject_install -%pyproject_save_files pyplane - -%check -export PYTHONPATH='%{buildroot}%{python3_sitelib}:%{buildroot}%{python3_sitelib}/pyplane' -%if %{with tests} -%{pytest} -%endif - -%files -n python3-pyplane -f %{pyproject_files} -%doc README.md AUTHORS -%{_bindir}/pyplane - -%changelog -%autochangelog From 5810c07bfdff37ed65eee197718dfb9be36130fd Mon Sep 17 00:00:00 2001 From: Ankur Sinha (Ankur Sinha Gmail) Date: Sep 24 2021 09:41:25 +0000 Subject: [PATCH 14/14] fix: correct test script --- diff --git a/pyplane.spec b/pyplane.spec index 27cd56a..e268622 100644 --- a/pyplane.spec +++ b/pyplane.spec @@ -45,6 +45,8 @@ Provides: python3-pyplane # the install requirements seem to be required for tests, so include them %pyproject_buildrequires %{?with_tests:-r} +# correct import in test script +sed -i -e '/sys.path.append/ d' -e 's/import core./import pyplane.core./' tests/test_core.py %build %pyproject_wheel @@ -54,7 +56,6 @@ Provides: python3-pyplane %pyproject_save_files pyplane %check -export PYTHONPATH='%{buildroot}%{python3_sitelib}:%{buildroot}%{python3_sitelib}/pyplane' %if %{with tests} %{pytest} %endif