From f539a09e80650e27261273318ad84511d87c61f24a955b314056afecae9c2864 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mark=C3=A9ta=20Machov=C3=A1?= Date: Tue, 6 May 2025 11:14:39 +0000 Subject: [PATCH] - Convert to pip-based build OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-Pweave?expand=0&rev=20 --- .gitattributes | 23 +++++++++ .gitignore | 1 + Pweave-0.30.3.tar.gz | 3 ++ markdown.patch | 37 ++++++++++++++ python-Pweave.changes | 60 ++++++++++++++++++++++ python-Pweave.spec | 116 ++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 240 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 Pweave-0.30.3.tar.gz create mode 100644 markdown.patch create mode 100644 python-Pweave.changes create mode 100644 python-Pweave.spec diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/Pweave-0.30.3.tar.gz b/Pweave-0.30.3.tar.gz new file mode 100644 index 0000000..ff17999 --- /dev/null +++ b/Pweave-0.30.3.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5e5298d90e06414a01f48e0d6aa4c36a70c5f223d929f2a9c7e2d388451c7357 +size 2173323 diff --git a/markdown.patch b/markdown.patch new file mode 100644 index 0000000..752a43e --- /dev/null +++ b/markdown.patch @@ -0,0 +1,37 @@ +From d956f7d02105a4ae734a8713f5e10a956fbbe5c8 Mon Sep 17 00:00:00 2001 +From: Dmitry Shachnev +Date: Mon, 18 Jul 2022 13:50:12 +0300 +Subject: [PATCH] Adjust for API changes in Python-Markdown 3.0 + +Support for old deprecated API was removed in Python-Markdown 3.4. +--- + pweave/formatters/markdownmath.py | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/pweave/formatters/markdownmath.py b/pweave/formatters/markdownmath.py +index 5a9c629..f665160 100644 +--- a/pweave/formatters/markdownmath.py ++++ b/pweave/formatters/markdownmath.py +@@ -1,3 +1,4 @@ ++from xml.etree.ElementTree import Element + import markdown + + +@@ -6,7 +7,7 @@ def __init__(self): + markdown.inlinepatterns.Pattern.__init__(self, r'(? + +- Convert to pip-based build + +------------------------------------------------------------------- +Wed Mar 13 10:09:40 UTC 2024 - Dirk Müller + +- skip python39 due to missing ipython + +------------------------------------------------------------------- +Sat Oct 15 23:41:37 UTC 2022 - Matej Cepl + +- Skip failing test testFIR_FilterExampleTex (gh#mpastell/Pweave#168) + +------------------------------------------------------------------- +Thu Oct 6 14:02:25 UTC 2022 - Markéta Machová + +- Add markdown.patch to fix the tests + +------------------------------------------------------------------- +Fri Feb 12 15:04:56 UTC 2021 - Dirk Müller + +- skip python 36 build (scipy) + +------------------------------------------------------------------- +Tue Feb 2 13:42:49 UTC 2021 - Dirk Müller + +- update-alternatives for multi-python3 builds + +------------------------------------------------------------------- +Mon Jun 8 07:55:03 UTC 2020 - Tomáš Chvátal + +- Adjust the tests to run with pytest and not nose +- Skip format checking tests that rely on jupyter behaviour + and thus break with updates + +------------------------------------------------------------------- +Wed Sep 18 09:24:15 UTC 2019 - Tomáš Chvátal + +- Skip one more test that fails due to extra output from + new matplotlib: + * testFIR_FilterExampleTex + +------------------------------------------------------------------- +Tue Mar 5 19:39:05 UTC 2019 - Tomáš Chvátal + +- Update 0.30.3: + * no upstream changelog for this release +- Run tests + +------------------------------------------------------------------- +Tue Dec 4 12:51:52 UTC 2018 - Matej Cepl + +- Remove superfluous devel dependency for noarch package + +------------------------------------------------------------------- +Tue Sep 12 20:58:25 UTC 2017 - toddrme2178@gmail.com + +- Initial version diff --git a/python-Pweave.spec b/python-Pweave.spec new file mode 100644 index 0000000..07043ae --- /dev/null +++ b/python-Pweave.spec @@ -0,0 +1,116 @@ +# +# spec file for package python-Pweave +# +# Copyright (c) 2025 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%{?sle15_python_module_pythons} +Name: python-Pweave +Version: 0.30.3 +Release: 0 +Summary: Scientific reports with embedded python computations +License: BSD-3-Clause +URL: https://github.com/mpastell/Pweave +Source: https://files.pythonhosted.org/packages/source/P/Pweave/Pweave-%{version}.tar.gz +# PATCH-FIX-UPSTREAM https://github.com/mpastell/Pweave/pull/167 Adjust for API changes in Python-Markdown 3.0 +Patch0: markdown.patch +BuildRequires: %{python_module pip} +BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module wheel} +BuildRequires: fdupes +BuildRequires: python-rpm-macros +Requires: python-Markdown +Requires: python-Pygments +Requires: python-certifi +Requires: python-jupyter_client +Requires: python-jupyter_ipykernel +Requires: python-jupyter_ipython +Requires: python-jupyter_nbconvert +Requires: python-jupyter_nbformat +Recommends: python-Sphinx +Recommends: python-matplotlib +Recommends: python-scipy +Recommends: python-sphinx_rtd_theme +BuildArch: noarch +# SECTION test requirements +BuildRequires: %{python_module Markdown} +BuildRequires: %{python_module Pygments} +BuildRequires: %{python_module certifi} +BuildRequires: %{python_module jupyter_client} +BuildRequires: %{python_module jupyter_ipykernel} +BuildRequires: %{python_module jupyter_ipython} +BuildRequires: %{python_module jupyter_nbconvert} +BuildRequires: %{python_module jupyter_nbformat} +BuildRequires: %{python_module matplotlib} +BuildRequires: %{python_module pytest} +BuildRequires: %{python_module scipy} +# /SECTION +%python_subpackages + +%description +Pweave is a scientific report generator and a literate programming +tool for Python. Pweave can capture the results and plots from data +analysis and works well with NumPy, SciPy and matplotlib. It is able +to run python code from source document and include the results and +capture matplotlib plots in the output. + +Pweave is good for creating reports, tutorials, presentations etc. +with embedded python code It can also be used to make websites together +with e.g. Sphinx or rest2web. + +%prep +%setup -q -n Pweave-%{version} +%autopatch -p1 + +%build +%pyproject_wheel + +%install +%pyproject_install +%python_expand %fdupes %{buildroot}%{$python_sitelib} +%python_clone -a %{buildroot}%{_bindir}/pweave +%python_clone -a %{buildroot}%{_bindir}/ptangle +%python_clone -a %{buildroot}%{_bindir}/pypublish +%python_clone -a %{buildroot}%{_bindir}/pweave-convert + +%post +%python_install_alternative pweave +%python_install_alternative ptangle +%python_install_alternative pypublish +%python_install_alternative pweave-convert + +%postun +%python_uninstall_alternative pweave +%python_uninstall_alternative ptangle +%python_uninstall_alternative pypublish +%python_uninstall_alternative pweave-convert + +%check +# tests.test_readers.test_url - online +# Formatters/publish Layout changes with updates in jupyter +# Failing test for testFIR_FilterExampleTex is gh#mpastell/Pweave#168 +%pytest -k 'not (test_url or testFormatters or test_publish or testFIR_FilterExampleTex)' + +%files %{python_files} +%doc CHANGELOG.txt README.rst +%license LICENSE.txt +%python_alternative %{_bindir}/pweave +%python_alternative %{_bindir}/ptangle +%python_alternative %{_bindir}/pypublish +%python_alternative %{_bindir}/pweave-convert +%{python_sitelib}/pweave +%{python_sitelib}/[Pp]weave-%{version}*info + +%changelog