From 2e5e6124063a41d56bf745a82fbb50aced51a911 Mon Sep 17 00:00:00 2001 From: Neil Hanlon Date: Mon, 8 Jan 2024 14:32:27 -0500 Subject: [PATCH] address more review comments --- 211.patch | 42 ++++++++++++++++++++++++++++++++++++++++++ pinnwand.spec | 19 +++++++++---------- sources | 2 +- 3 files changed, 52 insertions(+), 11 deletions(-) create mode 100644 211.patch diff --git a/211.patch b/211.patch new file mode 100644 index 0000000..1f761ba --- /dev/null +++ b/211.patch @@ -0,0 +1,42 @@ +From e1772a7bc39d4f97666405d098ac972e1e55fbad Mon Sep 17 00:00:00 2001 +From: Neil Hanlon +Date: Thu, 26 Oct 2023 23:41:01 -0400 +Subject: [PATCH] use `project.scripts` instead of `tool.poetry.scripts` for + entrypoints + +After the change from poetry to pdm in #121, it appears that some build systems +have trouble groking what scripts to install due to the use of the +poetry-specific entrypoint configuration in pyproject.toml. + +This change updates the pyproject.toml to use the +[PEP-621](https://www.python.org/dev/peps/pep-0621) specification for +identifying console_scripts/entrypoints, and resolves the build issue on +Fedora. From my testing, there is no impact for installations via e.g. +`pip`, as these tools will understand PEP-621 entrypoint specifications. +--- + pyproject.toml | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/pyproject.toml b/pyproject.toml +index 98faf4f..a7ff32a 100644 +--- a/pyproject.toml ++++ b/pyproject.toml +@@ -45,6 +45,9 @@ dev = [ + requires = ["pdm-pep517>=1.0"] + build-backend = "pdm.pep517.api" + ++[project.scripts] ++pinnwand = 'pinnwand.__main__:main' ++ + [tool.black] + line-length = 80 + target_version = ["py36"] +@@ -63,8 +66,6 @@ exclude = ''' + | dist + )/ + ''' +-[tool.poetry.scripts] +-pinnwand = 'pinnwand.__main__:main' + + [tool.pytest.ini_options] + pythonpath = ["src"] diff --git a/pinnwand.spec b/pinnwand.spec index d1c078e..e2c0635 100644 --- a/pinnwand.spec +++ b/pinnwand.spec @@ -12,6 +12,10 @@ URL: https://github.com/supakeen/pinnwand Source: %{url}/archive/%{gittag}/%{name}-%{version}.tar.gz Source: pinnwand.service +# Upstream switched to `pdm` from poetry for 1.5.0, but this prevents creation +# of the pinnwand entrypoint during build +Patch: https://github.com/supakeen/pinnwand/pull/211.patch + BuildArch: noarch BuildRequires: python3-devel BuildRequires: python3-pytest @@ -27,16 +31,11 @@ little more complex %prep %autosetup -p 1 -n pinnwand-%{version} -# NOTE(neil): 2023-10-26 pinnwand 1.4.0 wants 0.19, but Fedora has 20.X -# at the same time, 1.5.0 wants sqlalchemy >= 2, but Fedora has not upgraded to -# it yet. See: +# NOTE(neil): 2023-10-26 pinnwand 1.5.0 wants sqlalchemy >= 2, but Fedora has +# not upgraded to # it yet. See: # https://src.fedoraproject.org/rpms/python-sqlalchemy/pull-request/16 sed -i 's/sqlalchemy>=2/sqlalchemy<2/' pyproject.toml -# Upstream switched to `pdm` from poetry for 1.5.0, but this prevents creation -# of the pinnwand entrypoint during build -sed -i 's/tool\.poetry\.scripts/project.scripts/' pyproject.toml - %generate_buildrequires %pyproject_buildrequires @@ -65,14 +64,14 @@ install -Dpm 0644 etc/pinnwand.toml-example %{buildroot}%{_sysconfdir}/%{name}/% %files -f %{pyproject_files} %dir %{_sysconfdir}/%{name} %doc README.md -%license LICENSE +%license LICENSE AUTHORS.rst %{_bindir}/%{name} %{_unitdir}/pinnwand.service %config(noreplace) %{_sysconfdir}/%{name}/%{name}.toml %changelog -* Thu Oct 26 2023 Neil Hanlon - 1.5.0-1 -- Update to 1.4.0 +* Mon Jan 08 2024 Neil Hanlon - 1.5.0-1 +- Update to 1.5.0 * Thu Aug 03 2023 Neil Hanlon - 1.4.0-1 - Update to 1.4.0 diff --git a/sources b/sources index 6003f45..cffb458 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (pinnwand-1.4.0.tar.gz) = 4cf3c22679bafa7256e5caa2304922312a0e35aadb909611c49eafa46d053202dc903a886620c16f28449a4a29bc745ceb35e5cf787d7281bc966a818dd31b2e +SHA512 (pinnwand-1.5.0.tar.gz) = 9671517a3fe0be65145d6cc0eb5cca00089e27fe11510c8af1eabe24d900a41b4feda30e00e47be9792cc2e57b71e9cc1a4a5d60cfffe987f82a68a0edf2043a