Convert to pyproject macros
This commit is contained in:
parent
4292e2da8c
commit
f074ac9671
40
0001-Add-docs-and-test-extras.patch
Normal file
40
0001-Add-docs-and-test-extras.patch
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
From bf93b56a7bf0fc6c88508438b2c58452ef0775ef Mon Sep 17 00:00:00 2001
|
||||||
|
From: Carl George <carl@george.computer>
|
||||||
|
Date: Fri, 6 May 2022 15:02:17 -0500
|
||||||
|
Subject: [PATCH] Add docs and test extras
|
||||||
|
|
||||||
|
This makes it easier to install just documentation or test dependencies
|
||||||
|
without installing all dev dependencies.
|
||||||
|
---
|
||||||
|
pyproject.toml | 8 ++++++++
|
||||||
|
1 file changed, 8 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/pyproject.toml b/pyproject.toml
|
||||||
|
index a2ee476..0814537 100644
|
||||||
|
--- a/pyproject.toml
|
||||||
|
+++ b/pyproject.toml
|
||||||
|
@@ -11,6 +11,10 @@ documentation = "https://pyiso8601.readthedocs.io/en/latest/"
|
||||||
|
|
||||||
|
[tool.poetry.dependencies]
|
||||||
|
python = ">=3.6.2,<4.0"
|
||||||
|
+pytest = { version = "^6.2.2", optional = true }
|
||||||
|
+hypothesis = { version = "^6.1.1", optional = true }
|
||||||
|
+pytz = { version = "^2021.1", optional = true }
|
||||||
|
+Sphinx = { version = "^4.2.0", optional = true }
|
||||||
|
|
||||||
|
[tool.poetry.dev-dependencies]
|
||||||
|
mypy = "^0.910"
|
||||||
|
@@ -24,6 +28,10 @@ pre-commit = "^2.15.0"
|
||||||
|
nox = "^2021.10.1"
|
||||||
|
Sphinx = "^4.2.0"
|
||||||
|
|
||||||
|
+[tool.poetry.extras]
|
||||||
|
+docs = ["Sphinx"]
|
||||||
|
+test = ["pytest", "hypothesis", "pytz"]
|
||||||
|
+
|
||||||
|
[build-system]
|
||||||
|
requires = ["poetry-core>=1.0.0"]
|
||||||
|
build-backend = "poetry.core.masonry.api"
|
||||||
|
--
|
||||||
|
2.35.1
|
||||||
|
|
||||||
@ -1,68 +1,60 @@
|
|||||||
%{!?upstream_version: %global upstream_version %{version}%{?milestone}}
|
|
||||||
|
|
||||||
%global srcname iso8601
|
%global srcname iso8601
|
||||||
%global pkgdesc \
|
%global pkgdesc \
|
||||||
This module parses the most common forms of ISO 8601 date strings \
|
This module parses the most common forms of ISO 8601 date strings \
|
||||||
(e.g. 2007-01-14T20:34:22+00:00) into datetime objects.
|
(e.g. 2007-01-14T20:34:22+00:00) into datetime objects.
|
||||||
|
|
||||||
|
%bcond_without tests
|
||||||
|
|
||||||
Name: python-%{srcname}
|
Name: python-%{srcname}
|
||||||
Version: 1.0.2
|
Version: 1.0.2
|
||||||
Release: 1%{?dist}
|
Release: 2%{?dist}
|
||||||
Summary: Simple module to parse ISO 8601 dates
|
Summary: Simple module to parse ISO 8601 dates
|
||||||
|
|
||||||
License: MIT
|
License: MIT
|
||||||
URL: https://github.com/micktwomey/pyiso8601
|
URL: https://github.com/micktwomey/pyiso8601
|
||||||
Source0: %{pypi_source}
|
Source: %{pypi_source}
|
||||||
|
# https://github.com/micktwomey/pyiso8601/pull/19
|
||||||
|
Patch: 0001-Add-docs-and-test-extras.patch
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
|
|
||||||
%description %{pkgdesc}
|
%description %{pkgdesc}
|
||||||
|
|
||||||
%package -n python%{python3_pkgversion}-%{srcname}
|
%package -n python3-%{srcname}
|
||||||
Summary: %{summary}
|
Summary: %{summary}
|
||||||
|
BuildRequires: python3-devel
|
||||||
|
|
||||||
BuildRequires: python%{python3_pkgversion}-devel
|
%description -n python3-%{srcname} %{pkgdesc}
|
||||||
BuildRequires: python%{python3_pkgversion}-setuptools
|
|
||||||
%{?python_provide:%python_provide python%{python3_pkgversion}-%{srcname}}
|
|
||||||
|
|
||||||
%description -n python%{python3_pkgversion}-%{srcname} %{pkgdesc}
|
|
||||||
|
|
||||||
%if 0%{?with_python3_other}
|
|
||||||
%package -n python%{python3_other_pkgversion}-%{srcname}
|
|
||||||
Summary: %{summary}
|
|
||||||
|
|
||||||
BuildRequires: python%{python3_other_pkgversion}-devel
|
|
||||||
BuildRequires: python%{python3_other_pkgversion}-setuptools
|
|
||||||
%{?python_provide:%python_provide python%{python3_other_pkgversion}-%{srcname}}
|
|
||||||
|
|
||||||
%description -n python%{python3_other_pkgversion}-%{srcname} %{pkgdesc}
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%autosetup -n %{srcname}-%{version}
|
%autosetup -p 1 -n %{srcname}-%{version}
|
||||||
|
# relax upper bounds on dependencies
|
||||||
|
sed -e 's/\^/>=/' -i pyproject.toml
|
||||||
|
|
||||||
|
%generate_buildrequires
|
||||||
|
%pyproject_buildrequires %{?with_tests:-x test}
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%py3_build
|
%pyproject_wheel
|
||||||
%if 0%{?with_python3_other}
|
|
||||||
%py3_other_build
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%install
|
%install
|
||||||
%py3_install
|
%pyproject_install
|
||||||
%if 0%{?with_python3_other}
|
%pyproject_save_files %{srcname}
|
||||||
%py3_other_install
|
|
||||||
|
%check
|
||||||
|
%if %{with tests}
|
||||||
|
%pytest
|
||||||
|
%else
|
||||||
|
%pyproject_check_import -e iso8601.test_iso8601
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%files -n python%{python3_pkgversion}-%{srcname}
|
%files -n python3-%{srcname} -f %{pyproject_files}
|
||||||
%doc LICENSE README.rst
|
%license LICENSE
|
||||||
%{python3_sitelib}/*
|
%doc README.rst
|
||||||
|
|
||||||
%if 0%{?with_python3_other}
|
|
||||||
%files -n python%{python3_other_pkgversion}-%{srcname}
|
|
||||||
%doc LICENSE README.rst
|
|
||||||
%{python3_other_sitelib}/*
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Fri May 06 2022 Carl George <carl@george.computer> - 1.0.2-2
|
||||||
|
- Convert to pyproject macros
|
||||||
|
|
||||||
* Thu Mar 24 2022 Fabian Affolter <mail@fabian-affolter.ch> - 1.0.2-1
|
* Thu Mar 24 2022 Fabian Affolter <mail@fabian-affolter.ch> - 1.0.2-1
|
||||||
- Update to latest upstream release 1.0.2
|
- Update to latest upstream release 1.0.2
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user