From 3f22f62b6b4582a44b533239c79fd065a69cc8022da6ee08fc2cc8db4a72cfad Mon Sep 17 00:00:00 2001 From: Daniel Garcia Date: Thu, 13 Jun 2024 07:10:19 +0000 Subject: [PATCH 1/2] - Add required python-curses dependency - Remove not needed shebangs from installed files in sitelib - Add %check section to run the script, it's just running with --version OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-demosh?expand=0&rev=5 --- python-demosh.changes | 7 +++++++ python-demosh.spec | 15 +++++++++++---- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/python-demosh.changes b/python-demosh.changes index 7716897..9bdf670 100644 --- a/python-demosh.changes +++ b/python-demosh.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Thu Jun 13 07:09:01 UTC 2024 - Daniel Garcia + +- Add required python-curses dependency +- Remove not needed shebangs from installed files in sitelib +- Add %check section to run the script, it's just running with --version + ------------------------------------------------------------------- Mon Jun 10 19:29:03 UTC 2024 - Johannes Kastl diff --git a/python-demosh.spec b/python-demosh.spec index 3c7880d..30c4b22 100644 --- a/python-demosh.spec +++ b/python-demosh.spec @@ -24,6 +24,7 @@ Summary: Run code in Markdown files or shell scripts very interactively License: Apache-2.0 URL: https://github.com/BuoyantIO/demosh Source: https://github.com/BuoyantIO/demosh/archive/v%{version}.tar.gz#/demosh-%{version}.tar.gz +BuildRequires: %{python_module curses} BuildRequires: %{python_module flit} BuildRequires: %{python_module pip} BuildRequires: %{python_module setuptools} @@ -35,6 +36,7 @@ BuildRequires: fdupes BuildRequires: python-rpm-macros Requires(post): update-alternatives Requires(postun): update-alternatives +Requires: python-curses BuildArch: noarch %python_subpackages @@ -47,19 +49,24 @@ examples. %prep %autosetup -n demosh-%{version} - -sed -i 's#usr/bin/env python#usr/bin/python3#g' demosh/*.py +# Remove shebangs +sed -i '/#!.*env python/d' demosh/*.py +chmod 0644 demosh/__init__.py %build %pyproject_wheel %install %pyproject_install -%python_expand chmod +x %{buildroot}/%{$python_sitelib}/demosh/*.py %python_expand %fdupes %{buildroot}/%{$python_sitelib}/ %python_clone -a %{buildroot}%{_bindir}/demosh -# no checks available upstream +%check +# Test that the command works +%{python_expand # +export PYTHONPATH=%{buildroot}%{$python_sitelib} +%{buildroot}%{_bindir}/demosh-%{$python_version} --version +} %post %python_install_alternative demosh From 396fe8d4c1721cd2e3eb650a401f272b3f193a3187081d831c824bc47fe68197 Mon Sep 17 00:00:00 2001 From: Daniel Garcia Date: Thu, 13 Jun 2024 07:14:39 +0000 Subject: [PATCH 2/2] - Remove not needed %pycache_only OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-demosh?expand=0&rev=6 --- python-demosh.spec | 1 - 1 file changed, 1 deletion(-) diff --git a/python-demosh.spec b/python-demosh.spec index 30c4b22..d85ff37 100644 --- a/python-demosh.spec +++ b/python-demosh.spec @@ -80,6 +80,5 @@ export PYTHONPATH=%{buildroot}%{$python_sitelib} %python_alternative %{_bindir}/demosh %{python_sitelib}/demosh %{python_sitelib}/demosh-%{version}*-info -%pycache_only %{python_sitelib}/demosh/__pycache__/ %changelog