Blame python-setuptools-git-versioning.spec

3d6d2f0
# upstream tests require the upstream repo, so we can't run those
3d6d2f0
87ce257
Name:       python-setuptools-git-versioning
Packit 50841ca
Version:    2.0.0
87ce257
Release:    %autorelease
87ce257
Summary:    Use git repo data for building a version number according PEP-440
87ce257
87ce257
License:    MIT
87ce257
URL:        https://setuptools-git-versioning.readthedocs.io/
3d6d2f0
Source0:    https://github.com/dolfinus/setuptools-git-versioning/archive/v%{version}/%{name}-%{version}.tar.gz
87ce257
87ce257
BuildArch:  noarch
87ce257
87ce257
87ce257
%global _description %{expand:
87ce257
Use git repo data (latest tag, current commit hash, etc) for building a version
87ce257
number according PEP 440.
87ce257
87ce257
Features:
87ce257
- Can be installed & configured through both setup.py and PEP 518’s
87ce257
  pyproject.toml
87ce257
- Does not require to change source code of the project
87ce257
- Tag-, file-, and callback-based versioning schemas are supported
87ce257
- Templates for tag, dev and dirty versions are separated
87ce257
- Templates support a lot of substitutions including git and environment
87ce257
  information
87ce257
- Well-documented
87ce257
87ce257
Limitations:
87ce257
- Currently the only supported VCS is Git
87ce257
- Only git v2 is supported
87ce257
- Currently does not support automatic exporting of package version to a file
87ce257
  for runtime use (but you can use setuptools-git-versioning > file redirect
87ce257
  instead)
87ce257
}
87ce257
87ce257
%description %_description
87ce257
87ce257
%package -n python3-setuptools-git-versioning
87ce257
Summary:    Support for physical quantities with units, based on numpy
87ce257
BuildRequires:  python3-devel
3d6d2f0
BuildRequires:  python3dist(setuptools)
3d6d2f0
# man page
3d6d2f0
BuildRequires:  help2man
87ce257
3d6d2f0
%description -n python3-setuptools-git-versioning %_description
87ce257
87ce257
%prep
87ce257
%autosetup -n setuptools-git-versioning-%{version}
87ce257
87ce257
%generate_buildrequires
87ce257
%pyproject_buildrequires
87ce257
87ce257
%build
87ce257
%pyproject_wheel
87ce257
87ce257
%install
87ce257
%pyproject_install
6b377bd
%pyproject_save_files -l setuptools_git_versioning
3d6d2f0
3d6d2f0
for binary in setuptools-git-versioning
3d6d2f0
do
3d6d2f0
    echo "Generating man page for ${binary// /-/}"
3d6d2f0
    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}"
3d6d2f0
    cat "${binary// /-}.1"
3d6d2f0
    install -t '%{buildroot}%{_mandir}/man1' -p -m 0644 -D "${binary// /-}.1"
3d6d2f0
done
87ce257
87ce257
%check
3d6d2f0
%pyproject_check_import
87ce257
87ce257
%files -n python3-setuptools-git-versioning -f %{pyproject_files}
3d6d2f0
%{_bindir}/setuptools-git-versioning
3d6d2f0
%{_mandir}/man1/setuptools-git-versioning.*
87ce257
87ce257
%changelog
87ce257
%autochangelog