Blame python-datalad.spec

da7fb19
# require network, so disabled by default
777bd35
# to run on mock, use --enable-network
777bd35
# only a couple of tests fail
777bd35
%bcond_with tests
777bd35
777bd35
%global forgeurl https://github.com/datalad/datalad
777bd35
777bd35
Name:           python-datalad
Packit a626521
Version:        1.0.1
777bd35
%global tag     %{version}
777bd35
%forgemeta
777bd35
Release:        %autorelease
777bd35
Summary:        Keep code, data, containers under control with git and git-annex
777bd35
777bd35
License:        MIT
777bd35
URL:            %{forgeurl}
777bd35
Source0:        %{forgesource}
777bd35
777bd35
BuildArch:      noarch
777bd35
777bd35
%global _description %{expand:
777bd35
DataLad makes data management and data distribution more accessible. To do
777bd35
that, it stands on the shoulders of Git and Git-annex to deliver a
777bd35
decentralized system for data exchange. This includes automated ingestion of
777bd35
data from online portals and exposing it in readily usable form as Git(-annex)
777bd35
repositories, so-called datasets. The actual data storage and permission
777bd35
management, however, remains with the original data providers.
777bd35
777bd35
The full documentation is available at https://docs.datalad.org and
777bd35
https://handbook.datalad.org provides a hands-on crash-course on DataLad
777bd35
777bd35
Extensions:
777bd35
777bd35
A number of extensions are available that provide additional functionality for
777bd35
DataLad. Extensions are separate packages that are to be installed in addition
777bd35
to DataLad. In order to install DataLad customized for a particular domain, one
777bd35
can simply install an extension directly, and DataLad itself will be
777bd35
automatically installed with it. An annotated list of extensions is available
777bd35
in the DataLad handbook.
777bd35
777bd35
Support:
777bd35
777bd35
The documentation for this project is found here: https://docs.datalad.org
777bd35
777bd35
If you have a problem or would like to ask a question about how to use DataLad,
777bd35
please submit a question to NeuroStars.org with a datalad tag. NeuroStars.org
777bd35
is a platform similar to StackOverflow but dedicated to neuroinformatics.
777bd35
777bd35
All previous DataLad questions are available here:
777bd35
https://neurostars.org/tags/datalad/}
777bd35
777bd35
%description %_description
777bd35
777bd35
%package -n python3-datalad
777bd35
Summary:        %{summary}
777bd35
BuildRequires:  python3-devel
da7fb19
BuildRequires:  python3-pytest
da7fb19
BuildRequires:  git-core
777bd35
BuildRequires:  git-annex
777bd35
# for 7za
777bd35
BuildRequires:  p7zip
03c7cb1
BuildRequires:  p7zip-plugins
777bd35
# Not added automatically
777bd35
Requires:       git-annex
03c7cb1
Requires:       p7zip p7zip-plugins
777bd35
Provides:       datalad = %{version}-%{release}
777bd35
777bd35
%description -n python3-datalad %_description
777bd35
777bd35
%prep
777bd35
%forgesetup
777bd35
03c7cb1
# tweak test requirements
03c7cb1
# - remove type packages
03c7cb1
# - remove mypy
03c7cb1
# - remove pytest-fail-slow
03c7cb1
sed -i -e '/types-python-dateutil/ d' \
03c7cb1
    -e '/types-requests/ d' \
03c7cb1
    -e '/mypy/ d' \
03c7cb1
    -e '/pytest-fail-slow/ d' \
03c7cb1
    setup.py
03c7cb1
777bd35
# Do not read deps from tox.ini, just use setup.py
777bd35
# tox.ini calls requirements.txt which doesn't work
777bd35
rm -f tox.ini
777bd35
777bd35
# Correct shebangs in tools
777bd35
find . -type f -exec sed -i "s|#!/usr/bin/env.*python$|#!%{python3}|" '{}' ';'
777bd35
777bd35
# remove shebangs
777bd35
find datalad/resources/procedures/ -type f -name "*.py" -exec sed -i '/^#![  ]*\/usr\/bin\/env.*$/ d' {} 2>/dev/null ';'
777bd35
da7fb19
# required for tests, and man page generation
da7fb19
git config --global user.name "Your Name"
da7fb19
git config --global user.email "youremail@yourdomain.com"
777bd35
777bd35
%if %{with tests}
777bd35
# Tests wants a git repo
777bd35
git init .
777bd35
git add .
777bd35
git commit -m "Dummy commit"
777bd35
777bd35
# correct function argument auto_spec -> autospec
777bd35
sed -i 's/auto_spec/autospec/' datalad/support/tests/test_annexrepo.py
777bd35
%endif
777bd35
777bd35
%generate_buildrequires
5a4102d
%pyproject_buildrequires %{?with_tests:-x tests}
777bd35
777bd35
%build
777bd35
%pyproject_wheel
da7fb19
# build man pages
da7fb19
%{python3} setup.py build_manpage
777bd35
777bd35
%install
777bd35
%pyproject_install
777bd35
%pyproject_save_files datalad
777bd35
da7fb19
# install man pages
da7fb19
install -m 0644 -p -Dt $RPM_BUILD_ROOT/%{_mandir}/man1/  build/man/*.1
da7fb19
da7fb19
777bd35
%check
777bd35
%if %{with tests}
777bd35
export PATH="${PATH}:%{buildroot}/%{_bindir}"
03c7cb1
%pytest
777bd35
%endif
03c7cb1
# check import
03c7cb1
# exclude imports that require a dataset
03c7cb1
%pyproject_check_import -e *test* -e *cfg_text2git* -e *cfg_yoda*
777bd35
777bd35
%files -n python3-datalad -f %{pyproject_files}
777bd35
%doc README.md CONTRIBUTORS CONTRIBUTING.md CHANGELOG.md CODE_OF_CONDUCT.md
777bd35
%{_bindir}/datalad
777bd35
%{_bindir}/git-annex-remote-datalad
777bd35
%{_bindir}/git-annex-remote-datalad-archives
777bd35
%{_bindir}/git-annex-remote-ora
da7fb19
%{_bindir}/git-annex-remote-ria
da7fb19
%{_bindir}/git-credential-datalad
da7fb19
%{_mandir}/man1/*.1*
777bd35
777bd35
%changelog
777bd35
%autochangelog