Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drop Python 2.6 and 3.3 support #689

Merged
merged 5 commits into from
Dec 1, 2017
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,3 @@ htmlcov
.idea
.eggs/
py27/

.coverage.*
7 changes: 4 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ sudo: false
language: python
cache: python
python:
- 2.6
- 2.7
- 3.3
- 3.4
- 3.5
- 3.6
Expand All @@ -22,7 +20,10 @@ matrix:
- os: osx
language: generic

before_install: if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then source .travis-osx; fi
before_install:
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then source .travis-osx; fi
# work around https://github.com/travis-ci/travis-ci/issues/8363
- pyenv global system 3.5
install: pip install -U six && pip install --pre -U tox
script: tox -e py
after_success:
Expand Down
6 changes: 2 additions & 4 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
environment:
matrix:
- TOXENV: fix-lint
- TOXENV: py26
- TOXENV: py27
- TOXENV: py33
- TOXENV: py34
- TOXENV: py35
- TOXENV: py36
Expand All @@ -15,8 +13,8 @@ build: false # Not a C# project
install: C:\Python36\python -m pip install --pre -U tox
test_script: C:\Python36\scripts\tox
after_test:
- if exist .coverage.* (C:\Python36\scripts\tox -e coverage) else (echo no .coverage files)
- if exist coverage.xml (C:\Python36\scripts\tox -e codecov) else (echo no coverage.xml)
- if exist .tox\.coverage.* (C:\Python36\scripts\tox -e coverage) else (echo no .coverage files)
- if exist .tox\coverage.xml (C:\Python36\scripts\tox -e codecov) else (echo no coverage.xml)

cache:
- '%LOCALAPPDATA%\pip\cache'
Expand Down
2 changes: 2 additions & 0 deletions changelog/679.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
drop Python ``2.6`` and ``3.3`` support: ``setuptools`` dropped supporting these, and as we depend on it we'll follow
up with doing the same (use ``tox <= 2.9.1`` if you still need this support) - by @gaborbernat
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can mention that a recent enough pip (>=9) should automatically install < 2.9 on Python 2.6 and Python 3.3.

2 changes: 1 addition & 1 deletion doc/_static/sphinxdoc.css
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ td.linenos pre {

div.quotebar {
background-color: #f8f8f8;
max-width: 250px;
max-width: 350px;
float: right;
padding: 2px 7px;
border: 1px solid #ccc;
Expand Down
30 changes: 15 additions & 15 deletions doc/config-v2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ namely these goals:
Example: Generating and selecting variants
----------------------------------------------

Suppose you want to test your package against python2.6, python2.7 and on the
Suppose you want to test your package against python3.6, python2.7 and on the
windows and linux platforms. Today you would have to
write down 2*2 = 4 ``[testenv:*]`` sections and then instruct
tox to run a specific list of environments on each platform.
Expand All @@ -71,29 +71,29 @@ With tox-1.X you can directlys specify combinations::

# combination syntax gives 2 * 2 = 4 testenv names
#
envlist = {py26,py27}-{win,linux}
envlist = {py27,py36}-{win,linux}

[testenv]
deps = pytest
platform =
win: windows
linux: linux
basepython =
py26: python2.6
py27: python2.7
py36: python3.6
commands = pytest

Let's go through this step by step::

envlist = {py26,py27}-{windows,linux}
envlist = {py27,py36}-{windows,linux}

This is bash-style syntax and will create ``2*2=4`` environment names
like this::

py26-windows
py26-linux
py27-windows
py27-linux
py36-windows
py36-linux

Our ``[testenv]`` uses a new templating style for the ``platform`` definition::

Expand All @@ -110,10 +110,10 @@ The next configuration item in the ``testenv`` section deals with
the python interpreter::

basepython =
py26: python2.6
py27: python2.7
py36: python3.6

This defines a python executable, depending on if ``py26`` or ``py27``
This defines a python executable, depending on if ``py36`` or ``py27``
appears in the environment name.

The last config item is simply the invocation of the test runner::
Expand All @@ -128,7 +128,7 @@ Nothing special here :)
settings, so the above ini-file can be further reduced::

[tox]
envlist = {py26,py27}-{win,linux}
envlist = {py27,py36}-{win,linux}

[testenv]
deps = pytest
Expand Down Expand Up @@ -185,7 +185,7 @@ If you want to have your package installed with both easy_install
and pip, you can list them in your envlist likes this::

[tox]
envlist = py[26,27,32]-django[13,14]-[easy,pip]
envlist = py[27,35,36]-django[13,14]-[easy,pip]

If no installer is specified, ``pip`` will be used.

Expand All @@ -195,7 +195,7 @@ Default settings related to environments names/variants
tox comes with predefined settings for certain variants, namely:

* ``{easy,pip}`` use easy_install or pip respectively
* ``{py24,py25,py26,py27,py31,py32,py33,py34,pypy19]`` use the respective
* ``{py27,py34,py35,py36,pypy19]`` use the respective
pythonNN or PyPy interpreter
* ``{win32,linux,darwin}`` defines the according ``platform``.

Expand All @@ -217,11 +217,11 @@ Transforming the examples: django-rest

The original `django-rest-framework tox.ini
<https://github.com/encode/django-rest-framework/blob/b001a146d73348af18cfc4c943d87f2f389349c9/tox.ini>`_
file has 159 lines and a lot of repetition, the new one would +have 20
file has 159 lines and a lot of repetition, the new one would have ``20+``
lines and almost no repetition::

[tox]
envlist = {py25,py26,py27}-{django12,django13}{,-example}
envlist = {py27,py35,py36}-{django12,django13}{,-example}

[testenv]
deps=
Expand Down Expand Up @@ -253,13 +253,13 @@ Another `tox.ini
has 233 lines and runs tests against multiple Postgres and Mysql
engines. It also performs backend-specific test commands, passing
different command line options to the test script. With the new tox-1.X
we not only can do the same with 32 non-repetive configuration lines but
we not only can do the same with 35 non-repetive configuration lines but
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this one was supposed to change

we also produce 36 specific testenvs with specific dependencies and test
commands::

[tox]
envlist =
{py24,py25,py26,py27}-{django11,django12,django13}-{nodb,pg,mysql}, docs
{py27,py34,py35,py36}-{django11,django12,django13}-{nodb,pg,mysql}, docs

[testenv:docs]
changedir = docs
Expand Down
56 changes: 28 additions & 28 deletions doc/config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -515,25 +515,25 @@ Generating environments, conditional settings

.. versionadded:: 1.8

Suppose you want to test your package against python2.6, python2.7 and against
Suppose you want to test your package against python2.7, python3.6 and against
several versions of a dependency, say Django 1.5 and Django 1.6. You can
accomplish that by writing down 2*2 = 4 ``[testenv:*]`` sections and then
listing all of them in ``envlist``.

However, a better approach looks like this::

[tox]
envlist = {py26,py27}-django{15,16}
envlist = {py27,py36}-django{15,16}

[testenv]
basepython =
py26: python2.6
py27: python2.7
py36: python3.6
deps =
pytest
django15: Django>=1.5,<1.6
django16: Django>=1.6,<1.7
py26: unittest2
py36: unittest2
commands = pytest

This uses two new facilities of tox-1.8:
Expand All @@ -553,35 +553,35 @@ Generative envlist

::

envlist = {py26,py27}-django{15,16}
envlist = {py36,py27}-django{15,16}

This is bash-style syntax and will create ``2*2=4`` environment names
like this::

py26-django15
py26-django16
py27-django15
py27-django16
py36-django15
py36-django16

You can still list environments explicitly along with generated ones::

envlist = {py26,py27}-django{15,16}, docs, flake
envlist = {py27,py36}-django{15,16}, docs, flake

Keep in mind that whitespace characters (except newline) within ``{}``
are stripped, so the following line defines the same environment names::

envlist = {py26, py27}-django{ 15, 16 }, docs, flake
envlist = {py27,py36}-django{ 15, 16 }, docs, flake

.. note::

To help with understanding how the variants will produce section values,
you can ask tox to show their expansion with a new option::

$ tox -l
py26-django15
py26-django16
py27-django15
py27-django16
py36-django15
py36-django16
docs
flake

Expand All @@ -595,12 +595,12 @@ Parts of an environment name delimited by hyphens are called factors and can
be used to set values conditionally::

basepython =
py26: python2.6
py27: python2.7
py36: python3.6

This conditional setting will lead to either ``python2.6`` or
``python2.7`` used as base python, e.g. ``python2.6`` is selected if current
environment contains ``py26`` factor.
This conditional setting will lead to either ``python3.6`` or
``python2.7`` used as base python, e.g. ``python3.6`` is selected if current
environment contains ``py36`` factor.

In list settings such as ``deps`` or ``commands`` you can freely intermix
optional lines with unconditional ones::
Expand All @@ -609,14 +609,14 @@ optional lines with unconditional ones::
pytest
django15: Django>=1.5,<1.6
django16: Django>=1.6,<1.7
py26: unittest2
py36: unittest2

Reading it line by line:

- ``pytest`` will be included unconditionally,
- ``Django>=1.5,<1.6`` will be included for environments containing ``django15`` factor,
- ``Django>=1.6,<1.7`` similarly depends on ``django16`` factor,
- ``unittest`` will be loaded for Python 2.6 environments.
- ``unittest`` will be loaded for Python 3.6 environments.

.. note::

Expand All @@ -632,25 +632,25 @@ Sometimes you need to specify the same line for several factors or create a
special case for a combination of factors. Here is how you do it::

[tox]
envlist = py{26,27,33}-django{15,16}-{sqlite,mysql}
envlist = py{27,34,36}-django{15,16}-{sqlite,mysql}

[testenv]
deps =
py33-mysql: PyMySQL ; use if both py33 and mysql are in an env name
py26,py27: urllib3 ; use if any of py26 or py27 are in an env name
py{26,27}-sqlite: mock ; mocking sqlite in python 2.x
py34-mysql: PyMySQL ; use if both py34 and mysql are in an env name
py27,py36: urllib3 ; use if any of py36 or py27 are in an env name
py{27,36}-sqlite: mock ; mocking sqlite in python 2.x

Take a look at first ``deps`` line. It shows how you can special case something
for a combination of factors, you just join combining factors with a hyphen.
This particular line states that ``PyMySQL`` will be loaded for python 3.3,
mysql environments, e.g. ``py33-django15-mysql`` and ``py33-django16-mysql``.
mysql environments, e.g. ``py34-django15-mysql`` and ``py34-django16-mysql``.

The second line shows how you use same line for several factors - by listing
them delimited by commas. It's possible to list not only simple factors, but
also their combinations like ``py26-sqlite,py27-sqlite``.
also their combinations like ``py27-sqlite,py36-sqlite``.

Finally, factor expressions are expanded the same way as envlist, so last
example could be rewritten as ``py{26,27}-sqlite``.
example could be rewritten as ``py{27,36}-sqlite``.

.. note::

Expand All @@ -659,11 +659,11 @@ example could be rewritten as ``py{26,27}-sqlite``.
expression are also factors of an env then that condition is considered
hold.

For example, environment ``py26-mysql``:
For example, environment ``py36-mysql``:

- could be matched with expressions ``py26``, ``py26-mysql``,
``mysql-py26``,
- but not with ``py2`` or ``py26-sql``.
- could be matched with expressions ``py36``, ``py36-mysql``,
``mysql-py36``,
- but not with ``py2`` or ``py36-sql``.


Other Rules and notes
Expand Down
16 changes: 7 additions & 9 deletions doc/example/basic.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ reside next to your ``setup.py`` file:

# content of: tox.ini , put in same dir as setup.py
[tox]
envlist = py26,py27
envlist = py27,py36
[testenv]
deps=pytest # or 'nose' or ...
commands=pytest # or 'nosetests' or ...
Expand All @@ -30,20 +30,18 @@ the specified command in each of them. With:

.. code-block:: shell

tox -e py26
tox -e py36

you can run restrict the test run to the python2.6 environment.
you can run restrict the test run to the python3.6 environment.

Available "default" test environments names are:

.. code-block:: shell

py
py2
py26
py27
py3
py33
py34
py35
py36
Expand Down Expand Up @@ -319,15 +317,15 @@ use :ref:`generative-envlist` and :ref:`conditional settings <factors>` to expre
.. code-block:: ini

[tox]
envlist = py{26,27,33}-django{15,16}-{sqlite,mysql}
envlist = py{27,34,36}-django{15,16}-{sqlite,mysql}

[testenv]
deps =
django15: Django>=1.5,<1.6
django16: Django>=1.6,<1.7
py33-mysql: PyMySQL ; use if both py33 and mysql are in an env name
py26,py27: urllib3 ; use if any of py26 or py27 are in an env name
py{26,27}-sqlite: mock ; mocking sqlite in python 2.x
py34-mysql: PyMySQL ; use if both py34 and mysql are in an env name
py27,py36: urllib3 ; use if any of py36 or py27 are in an env name
py{27,36}-sqlite: mock ; mocking sqlite in python 2.x

Prevent symbolic links in virtualenv
------------------------------------
Expand Down
Loading