|
|
ea6e13f |
# tests require network to use poetry
|
|
|
ea6e13f |
%bcond_with tests
|
|
|
4620a37 |
|
|
|
4620a37 |
%global _description %{expand:
|
|
|
ea6e13f |
This is a Python 3.7+ plugin for Poetry 1.2.0+ and Poetry Core 1.0.0+ to enable
|
|
|
ea6e13f |
dynamic versioning based on tags in your version control system, powered by
|
|
|
ea6e13f |
Dunamai. Many different version control systems are supported, including Git
|
|
|
ea6e13f |
and Mercurial; please refer to the Dunamai page for the full list (and minimum
|
|
|
ea6e13f |
supported version where applicable).
|
|
|
ea6e13f |
|
|
|
ea6e13f |
poetry-dynamic-versioning provides a build backend that patches Poetry Core to
|
|
|
ea6e13f |
enable the versioning system in PEP 517 build frontends. When installed with
|
|
|
ea6e13f |
the plugin feature (i.e., poetry-dynamic-versioning[plugin]), it also
|
|
|
ea6e13f |
integrates with the Poetry CLI to trigger the versioning in commands like
|
|
|
ea6e13f |
poetry build.}
|
|
|
4620a37 |
|
|
|
4620a37 |
Name: python-poetry-dynamic-versioning
|
|
Packit |
3ecacef |
Version: 1.3.0
|
|
|
4620a37 |
Release: %{autorelease}
|
|
|
4620a37 |
Summary: Plugin for Poetry to enable dynamic versioning based on VCS tags
|
|
|
4620a37 |
|
|
|
b9033f3 |
# SPDX
|
|
|
4620a37 |
License: MIT
|
|
|
ea6e13f |
URL: https://github.com/mtkennerly/poetry-dynamic-versioning
|
|
|
f816b6c |
Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
|
|
|
f816b6c |
|
|
|
4620a37 |
BuildArch: noarch
|
|
|
4620a37 |
|
|
|
4620a37 |
%description %_description
|
|
|
4620a37 |
|
|
|
4620a37 |
%package -n python3-poetry-dynamic-versioning
|
|
|
4620a37 |
Summary: %{summary}
|
|
|
4620a37 |
BuildRequires: python3-devel
|
|
|
a461d35 |
BuildRequires: help2man
|
|
|
a461d35 |
|
|
|
ea6e13f |
%if %{with tests}
|
|
|
ea6e13f |
BuildRequires: python3-pytest
|
|
|
ea6e13f |
BuildRequires: /usr/bin/git
|
|
|
ea6e13f |
BuildRequires: /usr/bin/hg
|
|
|
ea6e13f |
BuildRequires: /usr/bin/darcs
|
|
|
ea6e13f |
BuildRequires: /usr/bin/svn
|
|
|
ea6e13f |
BuildRequires: /usr/bin/bzr
|
|
|
ea6e13f |
BuildRequires: /usr/bin/fossil
|
|
|
ea6e13f |
BuildRequires: /usr/bin/poetry
|
|
|
ea6e13f |
# pijul is not in Fedora yet
|
|
|
ea6e13f |
#BuildRequires: /usr/bin/pijul
|
|
|
ea6e13f |
%endif
|
|
|
4620a37 |
|
|
|
4620a37 |
%description -n python3-poetry-dynamic-versioning %_description
|
|
|
4620a37 |
|
|
|
4620a37 |
%prep
|
|
|
ea6e13f |
%autosetup -n poetry-dynamic-versioning-%{version}
|
|
|
4620a37 |
|
|
|
4620a37 |
%generate_buildrequires
|
|
|
4620a37 |
%pyproject_buildrequires
|
|
|
4620a37 |
|
|
|
4620a37 |
%build
|
|
|
4620a37 |
%pyproject_wheel
|
|
|
4620a37 |
|
|
|
4620a37 |
%install
|
|
|
4620a37 |
%pyproject_install
|
|
|
ea6e13f |
%pyproject_save_files poetry_dynamic_versioning
|
|
|
a461d35 |
|
|
|
a461d35 |
# generate man pages
|
|
|
a461d35 |
for binary in "poetry-dynamic-versioning"
|
|
|
a461d35 |
do
|
|
|
a461d35 |
echo "Generating man page for ${binary}"
|
|
|
a461d35 |
PYTHONPATH="$PYTHONPATH:%{buildroot}/%{python3_sitelib}/" PATH="$PATH:%{buildroot}/%{_bindir}/" help2man --no-info --no-discard-stderr --name="${binary}" --version-string="${binary} %{version}" --output="${binary}.1" "${binary}"
|
|
|
a461d35 |
cat "${binary}.1"
|
|
|
a461d35 |
install -t '%{buildroot}%{_mandir}/man1' -p -m 0644 -D "${binary}.1"
|
|
|
a461d35 |
done
|
|
|
4620a37 |
|
|
|
4620a37 |
%check
|
|
|
4620a37 |
%if %{with tests}
|
|
|
ea6e13f |
# set up git
|
|
|
ea6e13f |
git config --global user.email "you@example.com"
|
|
|
ea6e13f |
git config --global user.name "Your Name"
|
|
|
ea6e13f |
# set up bzr
|
|
|
ea6e13f |
brz whoami "Your Name <name@example.com>"
|
|
|
ea6e13f |
# set up darcs
|
|
|
ea6e13f |
export DARCS_EMAIL="Yep something <name@example.com>"
|
|
|
ea6e13f |
|
|
|
4620a37 |
%{pytest}
|
|
|
4620a37 |
%endif
|
|
|
4620a37 |
|
|
|
4620a37 |
%files -n python3-poetry-dynamic-versioning -f %{pyproject_files}
|
|
|
f816b6c |
%license LICENSE
|
|
|
ea6e13f |
%doc README.md CHANGELOG.md README.plugin.md
|
|
|
ea6e13f |
%{_bindir}/poetry-dynamic-versioning
|
|
|
f816b6c |
%{_mandir}/man1/poetry-dynamic-versioning.1*
|
|
|
4620a37 |
|
|
|
4620a37 |
%changelog
|
|
|
4620a37 |
%autochangelog
|