diff --git a/.gitignore b/.gitignore index 6cd2a09..a99caf0 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ /matplotlib-scalebar-0.7.2.tar.gz /matplotlib-scalebar-0.8.0.tar.gz /matplotlib-scalebar-0.8.1.tar.gz +/matplotlib-scalebar-2c57173.tar.gz diff --git a/python-matplotlib-scalebar.spec b/python-matplotlib-scalebar.spec index 56c4aa6..4121afa 100644 --- a/python-matplotlib-scalebar.spec +++ b/python-matplotlib-scalebar.spec @@ -1,15 +1,21 @@ +%global commit 2c57173d67a346b323a4afff7b7dd9c7f1314da4 +%global shortcommit %(c=%{commit}; echo ${c:0:7}) +%global snapdate 20230706 +%global releasever 0.8.1 + Name: python-matplotlib-scalebar -Version: 0.8.1 +Version: %{releasever}^%{snapdate}git%{shortcommit} Release: %autorelease Summary: Artist for matplotlib to display a scale bar License: BSD URL: https://github.com/ppinard/matplotlib-scalebar -Source0: %{pypi_source matplotlib-scalebar} +Source0: %{url}/archive/%{commit}/matplotlib-scalebar-%{shortcommit}.tar.gz BuildArch: noarch BuildRequires: python3-devel +BuildRequires: python3dist(pytest) %global _description %{expand: Provides a new artist for matplotlib to display a scale bar, aka micron bar. It @@ -42,23 +48,28 @@ Requires: python3dist(requests) %prep -%autosetup -n matplotlib-scalebar-%{version} -p1 +%autosetup -n matplotlib-scalebar-%{commit} %generate_buildrequires -%pyproject_buildrequires -r requirements.txt requirements-test.txt +# Python tools don't like %%version +export SETUPTOOLS_SCM_PRETEND_VERSION=%{releasever} +%pyproject_buildrequires %build +export SETUPTOOLS_SCM_PRETEND_VERSION=%{releasever} %pyproject_wheel %install +export SETUPTOOLS_SCM_PRETEND_VERSION=%{releasever} %pyproject_install %pyproject_save_files matplotlib_scalebar %check +export SETUPTOOLS_SCM_PRETEND_VERSION=%{releasever} %pytest diff --git a/sources b/sources index 9aef11d..3c40c93 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (matplotlib-scalebar-0.8.1.tar.gz) = 1804a8ad9d9aa06bd0bf7042a86049d54cb3a08768ab1aeb445ba8469e24dcc0022099e39deb948dc1ddfc29e6da45973458fd7dd0a1168b0b1ed227aec46ffc +SHA512 (matplotlib-scalebar-2c57173.tar.gz) = 2d71fafabdf12685fd27ab2b5cc3afb7ea8fe95036c2696ba9d895f0ca41b24b0c6b495cafd327a89ec704726c10a137e47c67ff1acc7702dff4ccb0c03f4f8e