## START: Set by rpmautospec
## (rpmautospec version 0.7.3)
## RPMAUTOSPEC: autorelease, autochangelog
%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
    release_number = 2;
    base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}"));
    print(release_number + base_release_number - 1);
}%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}}
## END: Set by rpmautospec

%global _description %{expand:
NeuroM is a Python-based toolkit for the analysis and processing of neuron
morphologies.

Documentation is available at https://neurom.readthedocs.io/
}
%global forgeurl    https://github.com/BlueBrain/NeuroM

Name:           python-neurom
Version:        4.0.4
Release:        %autorelease
Summary:        Neuronal Morphology Analysis Tool

%global tag  v%{version}
%forgemeta

License:        BSD-3-Clause
URL:            %forgeurl
Source:         %forgesource

BuildArch:      noarch
# https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval
ExcludeArch:    %{ix86}

%description %_description

%package -n python3-neurom
Summary:        %{summary}

BuildRequires:  python3-devel
BuildRequires:  python3-pytest

%description -n python3-neurom %_description

%pyproject_extras_subpkg -n python3-neurom plotly

%package doc
Summary:        Documentation for %{name}

%description doc %_description

%prep
%forgeautosetup

%py3_shebang_fix examples/

# correct config files path
# not sure why this was changed: https://github.com/BlueBrain/NeuroM/commit/dbc3bd069a6fbded6c4a64cc038adb37c0b06932
sed -i 's|graft neurom/config|graft neurom/apps/config|' MANIFEST.in

%generate_buildrequires
export SETUPTOOLS_SCM_PRETEND_VERSION=%{version}
%pyproject_buildrequires -x plotly

%build
export SETUPTOOLS_SCM_PRETEND_VERSION=%{version}
%pyproject_wheel

%install
export SETUPTOOLS_SCM_PRETEND_VERSION=%{version}
%pyproject_install
%pyproject_save_files -l neurom

# Remove spurious installed files
rm -rf $RPM_BUILD_ROOT/%{python3_sitelib}/tests/

%check
export SETUPTOOLS_SCM_PRETEND_VERSION=%{version}
# tests failing
# reported upstream: https://github.com/BlueBrain/NeuroM/issues/983
k="${k-}${k+ and }not test_markers"  # failing with 3.2.11
k="${k-}${k+ and }not test_single_neurite_no_soma"  # failing with 3.2.11
k="${k-}${k+ and }not test_skip_header"  # failing with 3.2.11
PYTHONPATH=. %pytest -v -k "${k-}"

%files -n python3-neurom -f %{pyproject_files}
%doc AUTHORS.md
%doc CHANGELOG.rst
%doc README.md
%{_bindir}/neurom

%files doc
%license LICENSE.txt
%doc examples/
%doc tutorial/

%changelog
## START: Generated by rpmautospec
* Mon Oct 14 2024 Packit <hello@packit.dev> - 4.0.4-1
- Update to 4.0.4 upstream release
- Resolves: rhbz#2318520

* Fri Sep 27 2024 Sandro <devel@penguinpee.nl> - 4.0.3-2
- Re-enable two more tests that no longer fail
- Close RHBZ#2301182 (fixed in 4.0.3)

* Fri Sep 27 2024 Packit <hello@packit.dev> - 4.0.3-1
- Update to 4.0.3 upstream release
- Resolves: rhbz#2315101

* Fri Jul 19 2024 Fedora Release Engineering <releng@fedoraproject.org> - 4.0.2-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild

* Tue Jun 18 2024 Python Maint <python-maint@redhat.com> - 4.0.2-3
- Rebuilt for Python 3.13

* Tue Jun 11 2024 Ankur Sinha (Ankur Sinha Gmail) <sanjay.ankur@gmail.com> - 4.0.2-2
- fix: remove upstreamed patch (fixes rh#2284112)

* Tue Jun 11 2024 Packit <hello@packit.dev> - 4.0.2-1
- Update to 4.0.2 upstream release
- Resolves: rhbz#2284112

* Thu May 30 2024 Ankur Sinha (Ankur Sinha Gmail) <sanjay.ankur@gmail.com> - 4.0.0-3
- chore: check in patch (fixes rh##2283373)

* Thu May 30 2024 Ankur Sinha (Ankur Sinha Gmail) <sanjay.ankur@gmail.com> - 4.0.0-2
- fix: add patch to fix tests (fixes rh##2283373)

* Mon May 27 2024 Packit <hello@packit.dev> - 4.0.0-1
- Update to 4.0.0 upstream release
- Resolves: rhbz#2283373

* Sun May 05 2024 Ankur Sinha (Ankur Sinha Gmail) <sanjay.ankur@gmail.com> - 3.2.11-2
- chore: update comments for skipped tests (fixes rhbz#2278818)

* Fri May 03 2024 Packit <hello@packit.dev> - 3.2.11-1
- Update to 3.2.11 upstream release
- Resolves: rhbz#2278818

* Fri Apr 19 2024 Packit <hello@packit.dev> - 3.2.10-1
- Update to 3.2.10 upstream release
- Resolves: rhbz#2275136

* Fri Apr 19 2024 Ankur Sinha (Ankur Sinha Gmail) <sanjay.ankur@gmail.com> - 3.2.8-6
- chore: remove unused patches

* Mon Apr 15 2024 Nikola Forró <nforro@redhat.com> - 3.2.8-5
- Make the spec file parseable on non-Fedora OSes

* Wed Feb 21 2024 Sandro <devel@penguinpee.nl> - 3.2.8-4
- Unpin setuptools_scm for fedora <= 39

* Sun Feb 11 2024 Sandro <devel@penguinpee.nl> - 3.2.8-3
- Assert existence of license file

* Sun Feb 11 2024 Sandro <devel@penguinpee.nl> - 3.2.8-2
- Fix ModuleNotFoundError on test run
- Run tests with `pytest` directly (avoids coverage)

* Wed Feb 07 2024 Packit <hello@packit.dev> - 3.2.8-1
- [packit] 3.2.8 upstream release
- Resolves rhbz#2263187

* Fri Jan 26 2024 Fedora Release Engineering <releng@fedoraproject.org> - 3.2.5-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild

* Mon Jan 22 2024 Fedora Release Engineering <releng@fedoraproject.org> - 3.2.5-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild

* Mon Dec 04 2023 Ankur Sinha (Ankur Sinha Gmail) <sanjay.ankur@gmail.com> - 3.2.5-2
- feat: drop unused patches (fixes rhbz#2252404)

* Fri Dec 01 2023 Packit <hello@packit.dev> - 3.2.5-1
- [packit] 3.2.5 upstream release
- Resolves rhbz#2252404

* Mon Oct 09 2023 Sandro <devel@penguinpee.nl> - 3.2.4-2
- Drop obsolete patch (merged upstream)

* Mon Oct 09 2023 Packit <hello@packit.dev> - 3.2.4-1
- [packit] 3.2.4 upstream release

* Sun Oct 08 2023 Sandro <devel@penguinpee.nl> - 3.2.2-18
- Add Packit config

* Tue Sep 19 2023 Sandro <devel@penguinpee.nl> - 3.2.2-17
- Stop building for i686

* Fri Sep 15 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 3.2.2-16
- Update the list of test skips

* Fri Sep 15 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 3.2.2-14
- Package the changelog as documentation

* Fri Sep 15 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 3.2.2-12
- Replace python-mock test dependency with unittest.mock

* Fri Sep 15 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 3.2.2-11
- Add a metapackage for the “plotly” extra

* Fri Sep 15 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 3.2.2-10
- Better shebang line fixing
- Send a PR upstream to remove useless shebangs; apply it as a patch
- Use the py3_shebang_fix macro instead of sed to fix shebangs in examples

* Fri Sep 15 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 3.2.2-9
- Patch matplotlib 3.8 incompatibility

* Fri Sep 15 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 3.2.2-6
- Drop bogus BuildRequires on python3-toml

* Fri Sep 15 2023 Benjamin A. Beasley <code@musicinmybrain.net> - 3.2.2-5
- Update License to SPDX

* Fri Jul 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 3.2.2-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild

* Wed Jul 12 2023 Python Maint <python-maint@redhat.com> - 3.2.2-3
- Rebuilt for Python 3.12

* Fri Jan 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 3.2.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild

* Sun Oct 09 2022 Ankur Sinha (Ankur Sinha Gmail) <sanjay.ankur@gmail.com> - 3.2.2-1
- feat: update to 3.2.2 (fixes rh#2082562)

* Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 3.1.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild

* Wed Jun 15 2022 Python Maint <python-maint@redhat.com> - 3.1.0-4
- Rebuilt for Python 3.11

* Thu Mar 03 2022 Ankur Sinha (Ankur Sinha Gmail) <sanjay.ankur@gmail.com> - 3.1.0-3
- fix: patch manifest to include default config file

* Thu Mar 03 2022 Ankur Sinha (Ankur Sinha Gmail) <sanjay.ankur@gmail.com> - 3.1.0-2
- fix: install config files dir

* Sun Feb 20 2022 Ankur Sinha (Ankur Sinha Gmail) <sanjay.ankur@gmail.com> - 3.1.0-1
- feat: update to 3.1.0 (fixes rhbz#1952492)

* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.8.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild

* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.8.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild

* Fri Jun 04 2021 Python Maint <python-maint@redhat.com> - 1.8.0-2
- Rebuilt for Python 3.10

* Wed Apr 14 2021 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 1.8.0-1
- Initial build

## END: Generated by rpmautospec