[packages/python-pymeeus] - new

qboosh qboosh at pld-linux.org
Mon Jul 14 19:24:09 CEST 2025


commit 36ac7acb8bd4949f2a7243157b6830d790467445
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Mon Jul 14 19:25:37 2025 +0200

    - new

 PyMeeus-pytest7.2.patch |  86 +++++++++++++++++++++++++++
 PyMeeus-sphinx8.patch   |  22 +++++++
 python-pymeeus.spec     | 151 ++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 259 insertions(+)
---
diff --git a/python-pymeeus.spec b/python-pymeeus.spec
new file mode 100644
index 0000000..97b79da
--- /dev/null
+++ b/python-pymeeus.spec
@@ -0,0 +1,151 @@
+#
+# Conditional build:
+%bcond_without	doc	# Sphinx documentation
+%bcond_without	tests	# unit tests
+%bcond_without	python2 # CPython 2.x module
+%bcond_without	python3 # CPython 3.x module
+
+Summary:	Python implementation of Jean Meeus astronomical routines
+Summary(pl.UTF-8):	Pythonowa implementacja procedur astronomicznych Jeana Meeusa
+Name:		python-pymeeus
+Version:	0.5.12
+Release:	1
+License:	LGPL v3
+Group:		Libraries/Python
+#Source0Download: https://pypi.org/simple/pymeeus/
+Source0:	https://files.pythonhosted.org/packages/source/p/pymeeus/PyMeeus-%{version}.tar.gz
+# Source0-md5:	747081f3b6809821b94ac832d9e30b10
+# https://github.com/architest/pymeeus/commit/f064abfda6b3cb48cb42a6827cd250413056f227
+Patch0:		PyMeeus-pytest7.2.patch
+# from Fedora
+Patch1:		PyMeeus-sphinx8.patch
+URL:		https://pypi.org/project/PyMeeus/
+%if %{with python2}
+BuildRequires:	python-modules >= 1:2.7
+BuildRequires:	python-setuptools
+%if %{with tests}
+BuildRequires:	python-pytest >= 3.0.1
+%endif
+%endif
+%if %{with python3}
+BuildRequires:	python3-modules >= 1:3.6
+BuildRequires:	python3-setuptools
+%if %{with tests}
+BuildRequires:	python3-pytest >= 3.0.1
+%endif
+%endif
+BuildRequires:	rpm-pythonprov
+BuildRequires:	rpmbuild(macros) >= 1.714
+%if %{with doc}
+BuildRequires:	python3-sphinx_rtd_theme
+BuildRequires:	sphinx-pdg-3
+%endif
+Requires:	python-modules >= 1:2.7
+BuildArch:	noarch
+BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+PyMeeus is a Python implementation of the astronomical algorithms
+described in the classical book 'Astronomical Algorithms, 2nd Edition,
+Willmann-Bell Inc. (1998)' by Jean Meeus.
+
+%description -l pl.UTF-8
+PyMeeus to pythonowa implementacja algorytmów astronomicznych
+opisanych w klasycznej książce "Astronomical Algorithms" (wydanie 2.,
+Willmann-Bell Inc. 1998) Jeana Meeusa.
+
+%package -n python3-pymeeus
+Summary:	Python implementation of Jean Meeus astronomical routines
+Summary(pl.UTF-8):	Pythonowa implementacja procedur astronomicznych Jeana Meeusa
+Group:		Libraries/Python
+Requires:	python3-modules >= 1:3.6
+
+%description -n python3-pymeeus
+PyMeeus is a Python implementation of the astronomical algorithms
+described in the classical book 'Astronomical Algorithms, 2nd Edition,
+Willmann-Bell Inc. (1998)' by Jean Meeus.
+
+%description -n python3-pymeeus -l pl.UTF-8
+PyMeeus to pythonowa implementacja algorytmów astronomicznych
+opisanych w klasycznej książce "Astronomical Algorithms" (wydanie 2.,
+Willmann-Bell Inc. 1998) Jeana Meeusa.
+
+%package apidocs
+Summary:	API documentation for Python pymeeus module
+Summary(pl.UTF-8):	Dokumentacja API modułu Pythona pymeeus
+Group:		Documentation
+
+%description apidocs
+API documentation for Python pymeeus module.
+
+%description apidocs -l pl.UTF-8
+Dokumentacja API modułu Pythona pymeeus.
+
+%prep
+%setup -q -n PyMeeus-%{version}
+%patch -P0 -p1
+%patch -P1 -p1
+
+%build
+%if %{with python2}
+%py_build
+
+%if %{with tests}
+PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
+PYTEST_PLUGINS= \
+%{__python} -m pytest tests
+%endif
+%endif
+
+%if %{with python3}
+%py3_build
+
+%if %{with tests}
+PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
+PYTEST_PLUGINS= \
+%{__python3} -m pytest tests
+%endif
+%endif
+
+%if %{with doc}
+%{__make} -C docs html \
+	SPHINXBUILD=sphinx-build-3
+%endif
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+%if %{with python2}
+%py_install
+
+%py_postclean
+%endif
+
+%if %{with python3}
+%py3_install
+%endif
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%if %{with python2}
+%files
+%defattr(644,root,root,755)
+%doc README.md
+%{py_sitescriptdir}/pymeeus
+%{py_sitescriptdir}/PyMeeus-%{version}-py*.egg-info
+%endif
+
+%if %{with python3}
+%files -n python3-pymeeus
+%defattr(644,root,root,755)
+%doc README.md
+%{py3_sitescriptdir}/pymeeus
+%{py3_sitescriptdir}/PyMeeus-%{version}-py*.egg-info
+%endif
+
+%if %{with doc}
+%files apidocs
+%defattr(644,root,root,755)
+%doc docs/build/html/{_modules,_static,bodies,core,examples,*.html,*.js}
+%endif
diff --git a/PyMeeus-pytest7.2.patch b/PyMeeus-pytest7.2.patch
new file mode 100644
index 0000000..51534a8
--- /dev/null
+++ b/PyMeeus-pytest7.2.patch
@@ -0,0 +1,86 @@
+From f064abfda6b3cb48cb42a6827cd250413056f227 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Antoine=20Beaupr=C3=A9?= <anarcat at debian.org>
+Date: Sat, 6 Apr 2024 22:22:52 -0400
+Subject: [PATCH] fix pytest 7.2 compatibility
+
+Pytest 7.2 deprecated plain top-level `setup()` and `teardown()`
+functions in favor of their own decorators:
+
+https://docs.pytest.org/en/latest/changelog.html#pytest-7-2-0-2022-10-23
+https://docs.pytest.org/en/latest/deprecations.html#setup-teardown
+
+Now we need to use module-level setup/teardown, which is extremely
+similar, just named differently:
+
+https://docs.pytest.org/en/latest/how-to/xunit_setup.html#module-level-setup-teardown
+
+We keep compatibility shims for older pytest releases.
+
+Closes: #24
+---
+ tests/test_curvefitting.py  | 10 +++++++---
+ tests/test_interpolation.py |  9 +++++++--
+ 2 files changed, 14 insertions(+), 5 deletions(-)
+
+diff --git a/tests/test_curvefitting.py b/tests/test_curvefitting.py
+index 9398327..0d20cca 100644
+--- a/tests/test_curvefitting.py
++++ b/tests/test_curvefitting.py
+@@ -31,9 +31,8 @@
+ cf4 = CurveFitting()
+ 
+ 
+-def setup():
++def setup_module():
+     """This function is used to set up the environment for the tests"""
+-
+     # Set up a few CurveFitting objects
+     cf1.set([73.0, 38.0, 35.0, 42.0, 78.0, 68.0, 74.0, 42.0, 52.0, 54.0, 39.0,
+              61.0, 42.0, 49.0, 50.0, 62.0, 44.0, 39.0, 43.0, 54.0, 44.0, 37.0],
+@@ -58,10 +57,15 @@ def setup():
+              -0.8372, -0.4377, -0.3640, -0.3508, -0.2126])
+ 
+ 
+-def teardown():
++def teardown_module():
+     pass
+ 
+ 
++# pre pytest 7.2 compatibility
++setup = setup_module
++teardown = teardown_module
++
++
+ # CurveFitting class
+ 
+ def test_curvefitting_constructor():
+diff --git a/tests/test_interpolation.py b/tests/test_interpolation.py
+index e853c37..08f7b6e 100644
+--- a/tests/test_interpolation.py
++++ b/tests/test_interpolation.py
+@@ -32,7 +32,7 @@
+ i_sine = Interpolation()
+ 
+ 
+-def setup():
++def setup_module():
+     """This function is used to set up the environment for the tests"""
+     # Set up a interpolation object which uses Right Ascension
+     y0 = Angle(10, 18, 48.732, ra=True)
+@@ -64,10 +64,15 @@ def setup():
+                 0.5236885653, 0.5453707057])
+ 
+ 
+-def teardown():
++def teardown_module():
+     pass
+ 
+ 
++# pre pytest 7.2 ompatibility
++setup = setup_module
++teardown = teardown_module
++
++
+ # Interpolation class
+ 
+ def test_interpolation_constructor():
diff --git a/PyMeeus-sphinx8.patch b/PyMeeus-sphinx8.patch
new file mode 100644
index 0000000..ab3f871
--- /dev/null
+++ b/PyMeeus-sphinx8.patch
@@ -0,0 +1,22 @@
+From 4da77aafea0f76bb3fbefa5773e683f8d7461df8 Mon Sep 17 00:00:00 2001
+From: Vojtech Trefny <vtrefny at redhat.com>
+Date: Wed, 9 Jul 2025 12:50:44 +0200
+Subject: [PATCH] Fix documentation build with sphinx 8
+
+---
+ docs/source/conf.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/docs/source/conf.py b/docs/source/conf.py
+index 8552b55..5bad42f 100644
+--- a/docs/source/conf.py
++++ b/docs/source/conf.py
+@@ -197,4 +197,4 @@ epub_exclude_files = ['search.html']
+ 
+ 
+ # Example configuration for intersphinx: refer to the Python standard library.
+-intersphinx_mapping = {'https://docs.python.org/': None}
++intersphinx_mapping = {'python': ('https://docs.python.org/3', None)}
+-- 
+2.50.0
+
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/python-pymeeus.git/commitdiff/36ac7acb8bd4949f2a7243157b6830d790467445



More information about the pld-cvs-commit mailing list