You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
python-filelock/python-filelock.spec

115 lines
2.5 KiB

8 years ago
%global srcname filelock
%if 0%{?fedora}
%bcond_without docs
%else
%bcond_with docs
%endif
%bcond_without tests
8 years ago
Name: python-%{srcname}
Version: 3.3.1
Release: %autorelease
6 years ago
Summary: A platform independent file lock
8 years ago
License: Unlicense
URL: https://github.com/tox-dev/py-%{srcname}
Source0: %{pypi_source %{srcname}}
8 years ago
BuildArch: noarch
BuildRequires: python3-devel
BuildRequires: pyproject-rpm-macros
%if %{with tests}
# We cannot install extra dependencies because there are some
# we do not have in Fedora like covdefaults in testing or furo in docs.
# Test dependencies
BuildRequires: python3-pytest
BuildRequires: python3-pytest-timeout
%endif
%if %{with docs}
# Doc dependencies
BuildRequires: python3-sphinx
BuildRequires: python3-sphinx-autodoc-typehints
%endif
8 years ago
%description
This package contains a single module, which implements a platform independent
file locking mechanism for Python.
The lock includes a lock counter and is thread safe. This means, when locking
the same lock object twice, it will not block.
%if %{with docs}
8 years ago
%package doc
6 years ago
Summary: Documentation for %{srcname}, %{summary}
8 years ago
%description doc
6 years ago
%{summary}
%endif
%package -n python%{python3_pkgversion}-%{srcname}
6 years ago
Summary: %{summary}
%if 0%{?fedora}
Suggests: %{name}-doc
%endif # fedora
%description -n python%{python3_pkgversion}-%{srcname}
This package contains a single module, which implements a platform independent
file locking mechanism for Python.
The lock includes a lock counter and is thread safe. This means, when locking
the same lock object twice, it will not block.
8 years ago
%prep
%autosetup -n %{srcname}-%{version}
# furo theme is not available in Fedora
sed -i "/html_theme =.*/d" docs/conf.py
8 years ago
%generate_buildrequires
%pyproject_buildrequires -r
8 years ago
%build
%pyproject_wheel
8 years ago
%if %{with docs}
pushd docs
PYTHONPATH=../src sphinx-build ./ html --color -b html
PYTHONPATH=../src sphinx-build ./ man --color -b man
rm html/.buildinfo
popd
%endif
8 years ago
%install
%pyproject_install
%pyproject_save_files %{srcname}
%if %{with docs}
install -p -m0644 -D docs/man/%{srcname}.1 %{buildroot}%{_mandir}/man1/%{srcname}.1
%endif
8 years ago
%check
%if %{with tests}
%pytest
%else
%pyproject_check_import
%endif
8 years ago
%if %{with docs}
8 years ago
%files doc
%license LICENSE
%doc docs/html
%endif
8 years ago
%files -n python%{python3_pkgversion}-%{srcname} -f %{pyproject_files}
%license LICENSE
%doc README.md
%if %{with docs}
%{_mandir}/man1/%{srcname}.1.gz
%endif
8 years ago
%changelog
%autochangelog