psss / rpms / python-tox

Forked from rpms/python-tox 3 years ago
Clone
3137e7c
# Tests requiring Internet connections are disabled by default
3137e7c
# pass --with internet to run them (e.g. when doing a local rebuild
cb1dcfe
# for sanity checks before committing). Example:
cb1dcfe
# $ mock --enable-network --with internet <SRPM>
3137e7c
%bcond_with internet
3137e7c
3137e7c
4e85c05
%global pypi_name tox
4e85c05
Name:           python-%{pypi_name}
f18e06a
Version:        3.15.2
b5021c5
Release:        1%{?dist}
3137e7c
Summary:        Virtualenv-based automation of test activities
3137e7c
cb1dcfe
License:        MIT
cbb1e4c
URL:            https://tox.readthedocs.io/
4e85c05
Source0:        %{pypi_source}
80602e3
1fd92e9
BuildArch:      noarch
3137e7c
1fd92e9
%description
32f1962
Tox as is a generic virtualenv management and test command line tool you
1fd92e9
can use for:
6683010
32f1962
 - checking your package installs correctly with different Python versions
1fd92e9
   and interpreters
32f1962
 - running your tests in each of the environments, configuring your test tool
1fd92e9
   of choice
32f1962
 - acting as a frontend to Continuous Integration servers, greatly reducing
1fd92e9
   boilerplate and merging CI and shell-based testing.
1fd92e9
1fd92e9
4e85c05
%package -n python3-%{pypi_name}
1fd92e9
Summary:        %{summary}
4e85c05
%{?python_provide:%python_provide python3-%{pypi_name}}
4e85c05
Provides:       %{pypi_name} = %{version}-%{release}
1fd92e9
BuildRequires:  python3-devel
1fd92e9
BuildRequires:  python3-setuptools
c25a770
BuildRequires:  python3-setuptools_scm
1fd92e9
454e6cd
# Recommend "all the Pythons"
c286211
# Why? Tox exists to enable developers to test libraries against various Python
c286211
# versions, with just "dnf install tox" and a config file.
c286211
# See: https://developer.fedoraproject.org/tech/languages/python/python-installation.html#using-virtualenv
c286211
# Tox itself runs on the system python3 (i.e. %%{python3_version},
c286211
# however it launches other Python versions as subprocesses.
c286211
# It recommends all Python versions it supports. (This is an exception to
c286211
# the rule that Fedora packages may not require the alternative interpreters.)
b680470
Recommends:     python2.7
b680470
Recommends:     python3.5
b680470
Recommends:     python3.6
b680470
Recommends:     python3.7
b680470
Recommends:     python3.8
b680470
Recommends:     python3.9
cb1dcfe
Recommends:     pypy2-devel
f0d7c36
Recommends:     pypy3-devel
ee3f834
Recommends:     python2-devel
f0d7c36
Recommends:     python3-devel
454e6cd
3014377
# Replace the python2 version
3014377
Obsoletes:      python2-tox < 2.9.1-4
3014377
cb1dcfe
# Replace detox (no longer supported, functionality is now in tox)
cb1dcfe
Obsoletes:      python3-detox < 0.19-5
cb1dcfe
1fd92e9
%if %{with internet}
1fd92e9
# for tests
cb1dcfe
BuildRequires:  python3-filelock
cb1dcfe
BuildRequires:  python3-flaky
cb1dcfe
BuildRequires:  python3-freezegun
4e85c05
BuildRequires:  python3-packaging
cb1dcfe
BuildRequires:  python3-pathlib2
cb1dcfe
BuildRequires:  python3-pip
4e85c05
BuildRequires:  python3-pluggy >= 0.12
3fff713
BuildRequires:  python3-poetry
cb1dcfe
BuildRequires:  python3-psutil
b16e8f3
BuildRequires:  python3-py
b16e8f3
BuildRequires:  python3-pytest
cb1dcfe
BuildRequires:  python3-pytest-mock
cb1dcfe
#BuildRequires:  python3-pytest-randomly -- not packaged
cb1dcfe
BuildRequires:  python3-pytest-xdist
cb1dcfe
BuildRequires:  python3-toml
b16e8f3
BuildRequires:  python3-virtualenv
4e85c05
BuildRequires:  python3-wheel
80602e3
BuildRequires:  (python3-importlib-metadata if python3 < 3.8)
3fff713
BuildRequires:  /usr/bin/gcc
cb1dcfe
BuildRequires:  /usr/bin/git
3fff713
BuildRequires:  /usr/bin/poetry
3fff713
BuildRequires:  libffi-devel
1fd92e9
%endif
b16e8f3
3014377
%?python_enable_dependency_generator
3014377
4e85c05
%description -n python3-%{pypi_name}
32f1962
Tox as is a generic virtualenv management and test command line tool you
b16e8f3
can use for:
b16e8f3
32f1962
 - checking your package installs correctly with different Python versions
b16e8f3
   and interpreters
32f1962
 - running your tests in each of the environments, configuring your test tool
b16e8f3
   of choice
32f1962
 - acting as a frontend to Continuous Integration servers, greatly reducing
b16e8f3
   boilerplate and merging CI and shell-based testing.
b16e8f3
795f3eb
%prep
80602e3
%autosetup -p1 -n %{pypi_name}-%{version}
795f3eb
795f3eb
# remove bundled egg-info
4e85c05
rm -rf %{pypi_name}.egg-info
6683010
3137e7c
%build
1fd92e9
%py3_build
b16e8f3
b16e8f3
3137e7c
%install
1fd92e9
%py3_install
3137e7c
3137e7c
# if internet connection available, run tests
3137e7c
%if %{with internet}
3137e7c
%check
cb1dcfe
# there will be failures like
cb1dcfe
#    ModuleNotFoundError: tox
cb1dcfe
# or InterpreterNotFound: python
cb1dcfe
# We juggle the environment variables as much as we can, but it's not perfect.
cb1dcfe
# To workaround this:
cb1dcfe
#    1. build --without internet
cb1dcfe
#    2. install the new python3-tox
cb1dcfe
#    3. build --with internet
cb1dcfe
mkdir .path
cb1dcfe
ln -s %{__python3} .path/python
cb1dcfe
ln -s /usr/bin/easy_install-%{python3_version} .path/easy_install
cb1dcfe
ln -s /usr/bin/pytest-%{python3_version} .path/pytest
cb1dcfe
ln -s /usr/bin/pip3 .path/pip
cb1dcfe
export PATH=$(pwd)/.path:%{buildroot}%{_bindir}:$PATH
cb1dcfe
export PYTHONPATH=%{buildroot}%{python3_sitelib}
cb1dcfe
export TOXENV=py%{python3_version_nodots}
cb1dcfe
export TOX_TESTENV_PASSENV="PATH TOX_TESTENV_PASSENV"
4e85c05
# TODO figure out why PEP517/518 tests and test_provision_cli_args_ignore won't pass
4e85c05
pytest-3 -n auto -k "not test_verbose_isolated_build and not test_dist_exists_version_change and not test_provision_cli_args_ignore"
cb1dcfe
rm -rf .path
3137e7c
%endif
b42ab61
4e85c05
%files -n python3-%{pypi_name}
4e85c05
%{_bindir}/%{pypi_name}
4e85c05
%{_bindir}/%{pypi_name}-quickstart
745bdd1
%{python3_sitelib}/%{pypi_name}/
745bdd1
%{python3_sitelib}/%{pypi_name}-%{version}-py%{python3_version}.egg-info/
3137e7c
3137e7c
%changelog
f18e06a
* Mon Jun 08 2020 Miro Hrončok <mhroncok@redhat.com> - 3.15.2-1
f18e06a
- Update to 3.15.2 (#1844689)
f18e06a
b5021c5
* Mon Jun 01 2020 Charalampos Stratakis <cstratak@redhat.com> - 3.15.1-1
b5021c5
- Update to 3.15.1 (#1838137)
b5021c5
ee641c0
* Sat May 23 2020 Miro Hrončok <mhroncok@redhat.com> - 3.15.0-2
ee641c0
- Rebuilt for Python 3.9
ee641c0
74d980a
* Wed May 13 2020 Tomas Hrnciar <thrnciar@redhat.com> - 3.15.0-1
74d980a
- Update to 3.15.0
b680470
- Stop recommending Python 3.4
74d980a
c347739
* Thu Mar 19 2020 Tomas Hrnciar <thrnciar@redhat.com> - 3.14.6-1
c347739
- Update to 3.14.6
c347739
bde7ce6
* Thu Feb 06 2020 Miro Hrončok <mhroncok@redhat.com> - 3.14.3-1
bde7ce6
- Update to 3.14.3 (#1725939)
bde7ce6
- Fix invocation with Python 3.9 (#1798929)
bde7ce6
- Recommend Python 3.9
bde7ce6
7dd27a8
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 3.13.2-5
7dd27a8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
7dd27a8
21f3945
* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 3.13.2-4
21f3945
- Rebuilt for Python 3.8.0rc1 (#1748018)
21f3945
39e3635
* Fri Aug 16 2019 Miro Hrončok <mhroncok@redhat.com> - 3.13.2-3
39e3635
- Rebuilt for Python 3.8
39e3635
119eb1e
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 3.13.2-2
119eb1e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
119eb1e
4e85c05
* Mon Jul 08 2019 Miro Hrončok <mhroncok@redhat.com> - 3.13.2-1
4e85c05
- Update to 3.13.2 (#1699032)
4e85c05
cb1dcfe
* Tue Apr 30 2019 Miro Hrončok <mhroncok@redhat.com> - 3.9.0-1
cb1dcfe
- Update to 3.9.0
cb1dcfe
- Obsolete detox
cb1dcfe
- License is MIT
cb1dcfe
130c199
* Fri Feb 15 2019 Lumír Balhar <lbalhar@redhat.com> - 3.5.3-3
130c199
- Recommend Python 3.8
130c199
138cc6b
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 3.5.3-2
138cc6b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
138cc6b
4f5a2fe
* Thu Nov 22 2018 Artem Goncharov <artem.goncharov@gmail.com> - 3.5.3-1
4f5a2fe
- Upgrade to 3.5.3 version
4f5a2fe
5f6beb2
* Mon Nov 19 2018 Artem Goncharov <artem.goncharov@gmail.com> - 3.4.0-1
5f6beb2
- Upgrade to 3.4.0 version (#1652657)
5f6beb2
1581084
* Thu Nov 01 2018 Matthias Runge <mrunge@redhat.com> - 3.0.0-6
1581084
- remove and revert the change to recommend python 2.7 (rhbz#1645025)
1581084
9325be7
* Tue Aug 28 2018 Miro Hrončok <mhroncok@redhat.com> - 3.0.0-4
9325be7
- Don't recommend Python 2.6, it doesn't work with tox 3
9325be7
0a9a1e1
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.0-3
0a9a1e1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
0a9a1e1
95f4a83
* Mon Jul 02 2018 Miro Hrončok <mhroncok@redhat.com> - 3.0.0-2
95f4a83
- Rebuilt for Python 3.7
95f4a83
2419c84
* Mon Jul 02 2018 Matthias Runge <mrunge@redhat.com> - 3.0.0-1
2419c84
- upgrade to 3.0.0
2419c84
cdbf10a
* Sun Jun 17 2018 Miro Hrončok <mhroncok@redhat.com> - 2.9.1-7
cdbf10a
- Rebuilt for Python 3.7
cdbf10a
3014377
* Tue May 15 2018 Miro Hrončok <mhroncok@redhat.com> - 2.9.1-6
3014377
- Remove the python2 version once again
21a8dfc
- Stop recommending python33 (it's retired)
3014377
03fb4ae
* Mon May 07 2018 Miro Hrončok <mhroncok@redhat.com> - 2.9.1-5
03fb4ae
- Add python2 back, see #1575667
03fb4ae
0f06d08
* Mon Apr 30 2018 Miro Hrončok <mhroncok@redhat.com> - 2.9.1-4
0f06d08
- Remove the python2 version
0f06d08
7ab1656
* Thu Mar 15 2018 Miro Hrončok <mhroncok@redhat.com> - 2.9.1-3
7ab1656
- Switch to automatic dependency generator (also fixes #1556164)
7ab1656
- Recommend python37
7ab1656
ff2180b
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.9.1-2
ff2180b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
ff2180b
c25a770
* Mon Jan 29 2018 Matthias Runge <mrunge@redhat.com> - 2.9.1-1
c25a770
- update to 2.9.1
c25a770
efaaaa7
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.7.0-2
efaaaa7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
efaaaa7
32f1962
* Tue Apr 25 2017 Matthias Runge <mrunge@redhat.com> - 2.7.0-1
32f1962
- upgrade to 2.7.0
32f1962
f0d7c36
* Sun Apr 09 2017 Miro Hrončok <mhroncok@redhat.com> - 2.3.1-8
f0d7c36
- Recommend the devel subpackages of Pythons (so tox works with extension modules)
f0d7c36
bfb11ca
* Tue Feb 14 2017 Miro Hrončok <mhroncok@redhat.com> - 2.3.1-7
bfb11ca
- Recommend python36
bfb11ca
38dc612
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.3.1-6
38dc612
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
38dc612
53edfdd
* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 2.3.1-5
53edfdd
- Rebuild for Python 3.6
53edfdd
454e6cd
* Mon Oct 10 2016 Miro Hrončok <mhroncok@redhat.com> - 2.3.1-4
454e6cd
- Recommend "all the Pythons"
454e6cd
1fd92e9
* Thu Aug 11 2016 Miro Hrončok <mhroncok@redhat.com> - 2.3.1-3
1fd92e9
- /usr/bin/tox is Python3
1fd92e9
- Python 2 subpackage is python2-tox
1fd92e9
- Run the tests also on Python 3
1fd92e9
- Update Source URL and URL
1fd92e9
- Use modern macros
1fd92e9
- Get rid of Fedora 17 checks
1fd92e9
328c670
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.3.1-2
328c670
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
328c670
99c28ef
* Mon Feb 29 2016 Matthias Runge <mrunge@redhat.com> - 2.3.1-1
99c28ef
- update to 2.3.1
99c28ef
e65973a
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.1-4
e65973a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
e65973a
1142918
* Thu Nov 12 2015 Kalev Lember <klember@redhat.com> - 2.1.1-3
1142918
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5
1142918
79129af
* Tue Aug 25 2015 Matthias Runge <mrunge@redhat.com> - 2.1.1-2
79129af
- add requirement: python-pluggy
79129af
b42ab61
* Tue Aug 18 2015 Matthias Runge <mrunge@redhat.com> - 2.1.1-1
b42ab61
- update to 2.1.1
b42ab61
6e5b288
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.8.1-2
6e5b288
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
6e5b288
795f3eb
* Tue Dec 16 2014 Matthias Runge <mrunge@redhat.com> - 1.8.1-1
795f3eb
- update to 1.8.1
795f3eb
6683010
* Wed Aug 13 2014 Matthias Runge <mrunge@redhat.com> - 1.7.1-3
6683010
- Fix ConfigError: ConfigError: substitution key 'posargs' not found
6683010
  (rhbz#1127961, rhbz#1128562)
6683010
06bc480
* Wed Jul 30 2014 Matthias Runge <mrunge@redhat.com> - 1.7.1-2
06bc480
- require virtualenv >= 1.11.2 (rhbz#1122603)
06bc480
39de635
* Tue Jul 08 2014 Matthias Runge <mrunge@redhat.com> - 1.7.1-1
39de635
- update to 1.7.1 (rhbz#111797)
39de635
ab45d3c
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.6.1-2
ab45d3c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
ab45d3c
b16e8f3
* Tue Sep 24 2013 Matthias Runge <mrunge@redhat.com> - 1.6.1-1
b16e8f3
- update to 1.6.1
b16e8f3
f3cb1e6
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4.2-9
f3cb1e6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
f3cb1e6
2fccf8d
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4.2-8
2fccf8d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
2fccf8d
4dd102a
* Wed Nov 14 2012 Matthias Runge <mrunge@redhat.com> - 1.4.2-7
4dd102a
- add requires python-py, python-virtualenv (rhbz#876246)
4dd102a
3137e7c
* Thu Oct 18 2012 Matthias Runge <mrunge@redhat.com> - 1.4.2-6
3137e7c
- change license to GPLv2+ and MIT
3137e7c
3137e7c
* Tue Oct 16 2012 Matthias Runge <mrunge@redhat.com> - 1.4.2-5
3137e7c
- totally disable python3 support for now
3137e7c
3137e7c
* Fri Oct 12 2012 Matthias Runge <mrunge@redhat.com> - 1.4.2-4
3137e7c
- conditionalize checks, as internet connection required, not available on koji
3137e7c
3137e7c
* Thu Oct 11 2012 Matthias Runge <mrunge@redhat.com> - 1.4.2-3
3137e7c
- buildrequirement: virtualenv
3137e7c
- disable python3-tests because of missing build-requirement python3-virtualenv
3137e7c
3137e7c
* Wed Oct 10 2012 Matthias Runge <mrunge@redhat.com> - 1.4.2-2
3137e7c
- include tests
3137e7c
3137e7c
* Tue Oct 09 2012 Matthias Runge <mrunge@redhat.com> - 1.4.2-1
3137e7c
- initial packaging