Blob Blame History Raw
# Upstream name
%global srcname Flask-Migrate

%if 0%{?fedora == 35}
# Disable the tests until python-flask-sqlalchemy is updated to support
# python-sqlalchemy 1.4.
%bcond_with tests
%else
%bcond_without tests
%endif

# Name used in egg-info
%global eggname %(\
  awk -vn='%{srcname}' 'BEGIN { gsub(/-/, "_", n); print n }')
# Name of importable Python package
%global modname %(\
  awk -vn='%{srcname}' 'BEGIN { gsub(/-/, "_", n); print tolower(n) }')
# Name used in RPM package names
%global rpmname %{py_dist_name %{srcname}}

Name:               python-%{rpmname}
Version:            2.5.3
Release:            3%{?dist}
Summary:            SQLAlchemy database migrations for Flask applications using Alembic

License:            MIT
URL:                https://github.com/miguelgrinberg/%{srcname}/
Source0:            %{pypi_source}
BuildArch:          noarch

BuildRequires:      python3-devel
BuildRequires:      python3-setuptools

# install_requires
BuildRequires:      %{py3_dist Flask} >= 0.9
BuildRequires:      %{py3_dist Flask-SQLAlchemy} >= 1.0
BuildRequires:      %{py3_dist alembic} >= 0.7
%if %{with tests}
# tests_requires
BuildRequires:      %{py3_dist Flask-Script} >= 0.6
%endif

BuildRequires:      python3dist(sphinx)
BuildRequires:      make

%description
SQLAlchemy database migrations for Flask applications using Alembic.


%package -n python3-%{rpmname}
Summary:            SQLAlchemy database migrations for Flask applications using Alembic

%description -n python3-%{rpmname}
SQLAlchemy database migrations for Flask applications using Alembic.


%package doc
Summary:            Documentation for %{srcname}

%description doc
Documentation for %{srcname}.


%prep
%autosetup -n %{srcname}-%{version}
# Fix unwanted executable bits inside the Python package (fixed upstream in a
# later release)
find '%{modname}' -type f -perm /0111 -execdir chmod -v a-x '{}' '+'
# Fix unversioned Python command
sed -r -i 's/(python)( |$)/\13\2/g' tests/*.py


%build
%py3_build
%make_build -C docs SPHINXOPTS='%{?_smp_mflags}' html


%install
%py3_install


%check
%if %{with tests}
env PYTHONPATH="${PYTHONPATH:-%{buildroot}%{python3_sitelib}}" \
    PYTHONDONTWRITEBYTECODE=1 \
    %{python3} -m unittest discover -v
%else
echo 'Tests are disabled'
%endif


%files -n python3-%{rpmname}
%license LICENSE
%{python3_sitelib}/%{modname}/
%{python3_sitelib}/%{eggname}-%{version}*


%files doc
%license LICENSE
%doc README.md
%doc docs/_build/html


%changelog
* Sun May 23 2021 Benjamin A. Beasley <code@musicinmybrain.net> - 2.5.3-3
- Replace %%modname with a group of name macros and use them in more places
- Change URL from PyPI to GitHub, and HTTP to HTTPS
- Use %%pypi_source macro
- Adjust whitespace to personal preference
- Drop manual Requires; EPEL8 and all Fedoras have automatic dependency generation
- Drop %%python3_pkgversion and %%python_provide macros, only needed in EPEL
- Stop chmod’ing template files in %%prep, as there is no longer anything to fix
- Remove executable bits from files in the Python package (currently __init__.py)
- Express BR’s as python3dist(…)/%%{py3_dist …} and version them
- Allow running the tests; disable them on Fedora 35 until
  python-flask-sqlalchemy is updated
- Build documentation and install it in a new -doc subpackage

* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.5.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild

* Tue Sep 29 2020 José Lemos Neto <LemosJoseX@protonmail.com> - 2.5.3-1
- Update to version 2.5.3

* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.1-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild

* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 2.1.1-9
- Rebuilt for Python 3.9

* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.1-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild

* Mon Sep 09 2019 Miro Hrončok <mhroncok@redhat.com> - 2.1.1-7
- Subpackage python2-flask-migrate has been removed
  See https://fedoraproject.org/wiki/Changes/Mass_Python_2_Package_Removal

* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 2.1.1-6
- Rebuilt for Python 3.8

* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.1-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild

* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.1-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild

* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild

* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 2.1.1-2
- Rebuilt for Python 3.7

* Sun Apr 15 2018 Itamar Reis Peixoto <itamar@ispbrasil.com.br> - 2.1.1-1
- new version

* Wed Feb 21 2018 Iryna Shcherbina <ishcherb@redhat.com> - 2.0.0-8
- Update Python 2 dependency declarations to new packaging standards
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)

* Fri Feb 16 2018 Itamar Reis Peixoto <itamar@ispbrasil.com.br> - 2.0.0-7
- make spec file compatible with epel7

* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.0-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Wed Jan 18 2017 Ralph Bean <rbean@redhat.com> - 2.0.0-3
- Conditionalize deps for EL7.

* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 2.0.0-2
- Rebuild for Python 3.6

* Wed Aug 10 2016 Ralph Bean <rbean@redhat.com> - 2.0.0-1
- Initial package for Fedora!  \ó/