%global pypi_name datalad-gooey # 0.2.0 (2022) imports datalad_next.patches.clone, which datalad-next 1.x removed, so it can't # load against the datalad-next this Copr ships. Upstream fixed that on main in Jan 2024 # ("Adjust imports deprecated in next 1.0.0", #428) and never released it; package main. %global commit 5bd6b9257ff1569439d2a77663271f5d665e61b6 %global shortcommit %(c=%{commit}; echo ${c:0:7}) %global snapdate 20240220 Name: python-%{pypi_name} Version: 0.2.0^%{snapdate}git%{shortcommit} Release: 1%{?dist} Summary: Graphical user interface for DataLad License: MIT URL: https://github.com/datalad/datalad-gooey Source0: https://github.com/datalad/datalad-gooey/archive/%{commit}/datalad-gooey-%{shortcommit}.tar.gz BuildArch: noarch BuildRequires: python3-devel # DataLad imports and its extension entry points need git and git-annex at import time BuildRequires: git-core BuildRequires: git-annex %global _description %{expand: datalad-gooey is a Qt (PySide6) graphical interface for DataLad: browse a dataset, see file states and run DataLad commands from forms. Start it with datalad gooey. It is a DataLad extension: installing it adds commands and functionality to the datalad command and Python API.} %description %{_description} %package -n python3-%{pypi_name} Summary: %{summary} %description -n python3-%{pypi_name} %{_description} %prep %autosetup -p1 -n datalad-gooey-%{commit} # A GitHub archive has no git metadata for versioneer; pin the release it builds on. cat > datalad_gooey/_version.py << 'EOF' def get_versions(): return {'version': '0.2.0+%{snapdate}git%{shortcommit}', 'full-revisionid': '%{commit}', 'dirty': False, 'error': None, 'date': None} EOF sed -i 's/version=versioneer.get_version()/version="0.2.0+%{snapdate}git%{shortcommit}"/' setup.py grep -q 'version="0.2.0+%{snapdate}git%{shortcommit}"' setup.py # Fedora rejects ambiguous #!/usr/bin/env python shebangs in installed modules. find . -name '*.py' -exec sed -i '1s|^#!/usr/bin/env python$|#!%{python3}|' {} + # Old _datalad_buildsupport imports DistutilsOptionError from setuptools, which current # setuptools no longer re-exports; setuptools.errors.OptionError is the same class. if [ -f _datalad_buildsupport/setup.py ] && grep -q 'from setuptools import Command, DistutilsOptionError' _datalad_buildsupport/setup.py; then sed -i 's/^from setuptools import Command, DistutilsOptionError$/from setuptools import Command\nfrom setuptools.errors import OptionError as DistutilsOptionError/' _datalad_buildsupport/setup.py grep -q '^from setuptools.errors import OptionError as DistutilsOptionError$' _datalad_buildsupport/setup.py fi # Old versioneer.py uses configparser.SafeConfigParser and readfp, both removed in Python 3.12. if [ -f versioneer.py ] && grep -q SafeConfigParser versioneer.py; then sed -i 's/SafeConfigParser/ConfigParser/g; s/\.readfp(/.read_file(/g' versioneer.py if grep -qE 'SafeConfigParser|readfp\(' versioneer.py; then exit 1; fi fi %generate_buildrequires %pyproject_buildrequires %build %pyproject_wheel %install %pyproject_install # Build helpers some DataLad-template projects install at top level; not part of the package. rm -rf %{buildroot}%{python3_sitelib}/_datalad_buildsupport %{buildroot}%{python3_sitelib}/tools %{buildroot}%{python3_sitelib}/benchmarks %{buildroot}%{python3_sitelib}/tests %{buildroot}%{python3_sitelib}/tests.py # Old setup.py data_files can drop these at the top of site-packages (osfclient does). rm -f %{buildroot}%{python3_sitelib}/{LICENSE,VERSION,requirements.txt} %pyproject_save_files -L datalad_gooey %check export HOME=$PWD git config --global user.name mockbuild && git config --global user.email mockbuild@localhost %pyproject_check_import -e 'datalad_gooey.tests*' -e 'datalad_gooey.*.tests*' -e '*.test_*' -e '*.conftest' -e '*.pytest_plugin' -e '*.resources.procedures.*' # The extension registers with DataLad: its command suite loads through datalad's API. %{py3_test_envvars} %{python3} - <<'EOF' from importlib.metadata import entry_points eps = [e for e in entry_points(group='datalad.extensions') if e.value.startswith('datalad_gooey')] assert eps, 'no datalad.extensions entry point for datalad_gooey' for e in eps: suite = e.load() print(e.name, '->', suite[0] if isinstance(suite, tuple) else suite) EOF # datalad-gooey-askpass is a Qt password dialog (git/annex askpass helper): no --help, and it # needs a display. The import check and the extension load above cover the package. %files -n python3-%{pypi_name} -f %{pyproject_files} %license LICENSE %{_bindir}/datalad-gooey %{_bindir}/datalad-gooey-askpass %changelog * Mon Oct 12 2026 Morgan Hough - 0.2.0^20240220git5bd6b92-1 - Initial package: a snapshot of main (5bd6b92), since 0.2.0 can't load with datalad-next 1.x.