b354d33
# Enabled by default
b354d33
# If the package needs to download data for the test which cannot be done in
b354d33
# koji, these can be disabled in koji by using `bcond_with` instead, but the
b354d33
# tests must be validated in mock with network enabled like so:
b354d33
# mock -r fedora-rawhide-x86_64 rebuild <srpm> --enable-network --rpmbuild-opts="--with tests"
b354d33
%bcond_without tests
b354d33
b354d33
# Enabled by default
b354d33
%bcond_without docs
b354d33
b354d33
%global pypi_name pylatex
b354d33
%global fancy_name PyLaTeX
b354d33
b354d33
%global _description %{expand:
b354d33
PyLaTeX is a Python library for creating and compiling LaTeX files or snippets.
b354d33
The goal of this library is being an easy but extensible interface between
b354d33
Python and LaTeX.}
b354d33
b354d33
Name:           python-%{pypi_name}
0ba0c67
Version:        1.4.1
cb20892
Release:        9%{?dist}
b354d33
Summary:        Library for creating LaTeX files and snippets
b354d33
b354d33
# https://fedoraproject.org/wiki/Licensing:Main?rd=Licensing#Good_Licenses
b354d33
License:        MIT
b354d33
URL:            https://jeltef.github.io/PyLaTeX/
b354d33
Source0:        https://github.com/JelteF/%{fancy_name}/archive/v%{version}/%{name}-%{version}.tar.gz
b354d33
BuildArch:      noarch
b354d33
b354d33
%description %_description
b354d33
b354d33
%{?python_enable_dependency_generator}
b354d33
b354d33
%package -n python3-%{pypi_name}
b354d33
Summary:        %{summary}
b354d33
# Not picked up by dep generator
b354d33
Requires:       %{py3_dist matplotlib}
b354d33
Requires:       %{py3_dist quantities}
b354d33
Requires:       %{py3_dist numpy}
b354d33
# Will also pull a lot of texlive, but that cannot be helpeb
b354d33
Requires:       /usr/bin/latexmk
b354d33
Requires:       /usr/bin/pdflatex
b354d33
# From `ag Package`
b354d33
Requires:       tex(alltt.sty)
b354d33
Requires:       tex(amsmath.sty)
b354d33
Requires:       tex(booktabs.sty)
b354d33
Requires:       tex(cleveref.sty)
b354d33
Requires:       tex(enumitem.sty)
b354d33
Requires:       tex(fontenc.sty)
b354d33
Requires:       tex(fancyhdr.sty)
b354d33
Requires:       tex(geometry.sty)
b354d33
Requires:       tex(graphicx.sty)
b354d33
Requires:       tex(hyperref.sty)
b354d33
Requires:       tex(inputenc.sty)
b354d33
Requires:       tex(lmodern.sty)
b354d33
Requires:       tex(lastpage.sty)
b354d33
Requires:       tex(longtable.sty)
b354d33
Requires:       tex(ltablex.sty)
b354d33
Requires:       tex(mdframed.sty)
b354d33
Requires:       tex(microtype.sty)
b354d33
Requires:       tex(multirow.sty)
b354d33
Requires:       tex(parskip.sty)
b354d33
Requires:       tex(pgfplots.sty)
b354d33
Requires:       tex(ragged2e.sty)
b354d33
Requires:       tex(subcaption.sty)
b354d33
Requires:       tex(siunitx.sty)
b354d33
Requires:       tex(tabularx.sty)
b354d33
Requires:       tex(tabu.sty)
b354d33
Requires:       tex(textcomp.sty)
b354d33
Requires:       tex(textpos.sty)
b354d33
Requires:       tex(tikz.sty)
b354d33
Requires:       tex(xcolor.sty)
b354d33
Requires:       texlive
b354d33
5dcf3db
BuildRequires: make
b354d33
BuildRequires:  python3-devel
8968032
BuildRequires:  python3-setuptools
b354d33
%if %{with tests}
b354d33
# Explicit requirements for tests
b354d33
BuildRequires:  %{py3_dist matplotlib}
b354d33
BuildRequires:  %{py3_dist numpy}
6f28dc1
BuildRequires:  %{py3_dist pytest}
b354d33
BuildRequires:  %{py3_dist quantities}
b354d33
# https://fedoraproject.org/wiki/Features/TeXLive
b354d33
BuildRequires:  tex(alltt.sty)
b354d33
BuildRequires:  tex(amsmath.sty)
b354d33
BuildRequires:  tex(booktabs.sty)
b354d33
BuildRequires:  tex(cleveref.sty)
b354d33
BuildRequires:  tex(enumitem.sty)
b354d33
BuildRequires:  tex(fontenc.sty)
b354d33
BuildRequires:  tex(fancyhdr.sty)
b354d33
BuildRequires:  tex(geometry.sty)
b354d33
BuildRequires:  tex(graphicx.sty)
b354d33
BuildRequires:  tex(hyperref.sty)
b354d33
BuildRequires:  tex(inputenc.sty)
b354d33
BuildRequires:  tex(lmodern.sty)
b354d33
BuildRequires:  tex(lastpage.sty)
b354d33
BuildRequires:  tex(longtable.sty)
b354d33
BuildRequires:  tex(ltablex.sty)
b354d33
BuildRequires:  tex(mdframed.sty)
b354d33
BuildRequires:  tex(microtype.sty)
b354d33
BuildRequires:  tex(multirow.sty)
b354d33
BuildRequires:  tex(parskip.sty)
b354d33
BuildRequires:  tex(pgfplots.sty)
b354d33
BuildRequires:  tex(ragged2e.sty)
b354d33
BuildRequires:  tex(subcaption.sty)
b354d33
BuildRequires:  tex(siunitx.sty)
b354d33
BuildRequires:  tex(tabularx.sty)
b354d33
BuildRequires:  tex(tabu.sty)
b354d33
BuildRequires:  tex(textcomp.sty)
b354d33
BuildRequires:  tex(textpos.sty)
b354d33
BuildRequires:  tex(tikz.sty)
b354d33
BuildRequires:  tex(xcolor.sty)
b354d33
BuildRequires:  texlive
b354d33
%endif
b354d33
0ba0c67
%py_provides python3-{pypi_name}
b354d33
b354d33
%description -n python3-%{pypi_name} %_description
b354d33
b354d33
%if %{with docs}
b354d33
%package doc
b354d33
Summary:        %{summary}
b354d33
BuildRequires:  %{py3_dist sphinx}
b354d33
BuildRequires:  %{py3_dist ordered-set}
b354d33
BuildRequires:  %{py3_dist sphinx_rtd_theme}
b354d33
b354d33
%description doc
b354d33
Documentation for %{name}.
b354d33
%endif
b354d33
b354d33
%prep
b354d33
%autosetup -n %{fancy_name}-%{version}
b354d33
rm -rf %{fancy_name}.egg-info
b354d33
b354d33
# Comment out to remove /usr/bin/env shebangs
b354d33
# Can use something similar to correct/remove /usr/bin/python shebangs also
b354d33
# find . -type f -name "*.py" -exec sed -i '/^#![  ]*\/usr\/bin\/env.*$/ d' {} 2>/dev/null ';'
b354d33
b354d33
%build
b354d33
%py3_build
b354d33
b354d33
make -C docs SPHINXBUILD=sphinx-build-3 html
b354d33
pushd docs/build/html
b354d33
    # Remove unneeded dot files
b354d33
    rm -frv .doctrees
b354d33
    rm -frv .buildinfo
b354d33
    # Correct end of line
b354d33
    sed -i 's/\r$//' _static/favicons/browserconfig.xml
b354d33
    # convert to utf8
b354d33
    iconv -f iso8859-1 -t utf-8 objects.inv > objects.inv.conv && mv -f objects.inv.conv objects.inv
b354d33
    sed -i 's/\r$//' objects.inv
b354d33
popd
b354d33
b354d33
%install
b354d33
%py3_install
b354d33
b354d33
b354d33
%check
b354d33
%if %{with tests}
b354d33
# Run tests
8c322ab
%pytest
b354d33
b354d33
# Test examples
b354d33
pushd examples
b354d33
for f in *.py; do
b354d33
    PYTHONPATH=%{buildroot}/%{python3_sitelib} %{__python3} $f
b354d33
done
b354d33
popd
b354d33
%endif
b354d33
b354d33
%files -n python3-%{pypi_name}
b354d33
%license LICENSE
b354d33
%doc README.rst
c3f9089
%{python3_sitelib}/%{fancy_name}-%{version}-py%{python3_version}.egg-info
b354d33
%{python3_sitelib}/%{pypi_name}
b354d33
b354d33
%if %{with docs}
b354d33
%files doc
b354d33
%license LICENSE
b354d33
%doc docs/build/html examples
b354d33
%endif
b354d33
b354d33
%changelog
cb20892
* Fri Jan 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.4.1-9
cb20892
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
cb20892
949471f
* Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.4.1-8
949471f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
949471f
f8798e4
* Wed Jun 15 2022 Python Maint <python-maint@redhat.com> - 1.4.1-7
f8798e4
- Rebuilt for Python 3.11
f8798e4
8c322ab
* Wed Mar 16 2022 Charalampos Stratakis <cstratak@redhat.com> - 1.4.1-6
8c322ab
- Utilize pytest instead of the deprecated nose test runner
8c322ab
8ab4dea
* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.4.1-5
8ab4dea
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
8ab4dea
204e45c
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.4.1-4
204e45c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
204e45c
d338470
* Fri Jun 04 2021 Python Maint <python-maint@redhat.com> - 1.4.1-3
d338470
- Rebuilt for Python 3.10
d338470
9b9b2cd
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.4.1-2
9b9b2cd
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
9b9b2cd
0ba0c67
* Sat Nov 28 2020 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 1.4.1-1
0ba0c67
- Update to latest release
0ba0c67
6f28dc1
* Thu Oct 01 2020 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 1.4.0-1
6f28dc1
- Update to new release
6f28dc1
2e2bf9f
* Sat Aug 22 2020 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 1.3.4-1
2e2bf9f
- Update to new release
2e2bf9f
c45a9fa
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.3-3
c45a9fa
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
c45a9fa
8968032
* Thu Jun 25 2020 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 1.3.3-2
8968032
- Explicitly BR setuptools
8968032
b4974ed
* Sun Jun 21 2020 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 1.3.3-1
b4974ed
- Update to 1.3.3
b4974ed
843fbad
* Mon Jun 15 2020 Victor Tejada Yau <victortyau@gmail.com> 1.3.2-1
b4974ed
- Update to 1.3.2
843fbad
6f14d37
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 1.3.1-3
6f14d37
- Rebuilt for Python 3.9
6f14d37
c05f8b9
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.1-2
c05f8b9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
c05f8b9
36e1368
* Thu Oct 10 2019 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 1.3.1-1
36e1368
- Update to 1.3.1
36e1368
9d8be65
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 1.3.0-3
9d8be65
- Rebuilt for Python 3.8
9d8be65
f937fb9
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.0-2
f937fb9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
f937fb9
b354d33
* Tue Jun 18 2019 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 1.3.0-1
b354d33
- Minor tweaks as per review comments
b354d33
- https://bugzilla.redhat.com/show_bug.cgi?id=1721409
b354d33
- Improve description macro
b354d33
b354d33
* Mon Jun 17 2019 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 1.3.0-1
b354d33
- Initial rpm build