%global pypi_name json-maj Name: python-%{pypi_name} Version: 0.0.8 Release: 3%{?dist} Summary: Small helper library for editing JSON files License: MIT URL: https://github.com/openneuropet/json_maj Source0: %{pypi_source json_maj} BuildArch: noarch BuildRequires: python3-devel %global _description %{expand: json-maj loads, updates and writes JSON sidecar files, with helpers for merging keys. PET2BIDS uses it.} %description %{_description} %package -n python3-%{pypi_name} Summary: %{summary} %description -n python3-%{pypi_name} %{_description} %prep %autosetup -p1 -n json_maj-%{version} # Fedora rejects ambiguous #!/usr/bin/env python shebangs in installed modules. grep -rlI '^#!/usr/bin/env python$' . | xargs -r sed -i '1s|^#!/usr/bin/env python$|#!%{python3}|' # 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 # create_executable.py is upstream's PyInstaller build helper, not library code; it # imports toml (retired from Fedora after F43). Not installed. rm json_maj/create_executable.py %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 json_maj %check %pyproject_check_import -e 'json_maj.tests*' -e 'json_maj.*.tests*' -e '*.test_*' -e '*.conftest' -e '*.pytest_plugin' %{py3_test_envvars} %{buildroot}%{_bindir}/updatejson --help > /dev/null %files -n python3-%{pypi_name} -f %{pyproject_files} # Upstream (PyPI and openneuropet/json_maj) ships no licence text; MIT per its metadata. %{_bindir}/updatejson %changelog * Mon Oct 12 2026 Morgan Hough - 0.0.8-3 - Ship the updatejson command. * Mon Oct 12 2026 Morgan Hough - 0.0.8-2 - Don't install create_executable.py (upstream's PyInstaller helper). * Mon Oct 12 2026 Morgan Hough - 0.0.8-1 - Initial package, for the DataLad extension stack and dandi.