address more review comments

This commit is contained in:
Neil Hanlon 2024-01-08 14:32:27 -05:00 committed by Neil Hanlon
parent 4fa91488af
commit 2e5e612406
Signed by: neil
GPG Key ID: 705BC21EC3C70F34
3 changed files with 52 additions and 11 deletions

42
211.patch Normal file
View File

@ -0,0 +1,42 @@
From e1772a7bc39d4f97666405d098ac972e1e55fbad Mon Sep 17 00:00:00 2001
From: Neil Hanlon <neil@rockylinux.org>
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"]

View File

@ -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 <neil@shrug.pw> - 1.5.0-1
- Update to 1.4.0
* Mon Jan 08 2024 Neil Hanlon <neil@shrug.pw> - 1.5.0-1
- Update to 1.5.0
* Thu Aug 03 2023 Neil Hanlon <neil@shrug.pw> - 1.4.0-1
- Update to 1.4.0

View File

@ -1 +1 @@
SHA512 (pinnwand-1.4.0.tar.gz) = 4cf3c22679bafa7256e5caa2304922312a0e35aadb909611c49eafa46d053202dc903a886620c16f28449a4a29bc745ceb35e5cf787d7281bc966a818dd31b2e
SHA512 (pinnwand-1.5.0.tar.gz) = 9671517a3fe0be65145d6cc0eb5cca00089e27fe11510c8af1eabe24d900a41b4feda30e00e47be9792cc2e57b71e9cc1a4a5d60cfffe987f82a68a0edf2043a