Skip to content

Commit

Permalink
Ignore unreleased Python versions
Browse files Browse the repository at this point in the history
Because Python 3.8 prereleases are already out and some people have
already added them to their tox.ini etc., but you cannot enable 3.8 on
Travis or Appveyor yet.

So let's treat 3.8 like we treat -dev releases.

Fixes #1 (the other half).
  • Loading branch information
mgedmin committed Feb 18, 2019
1 parent 872adc1 commit 6443d14
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Changelog
=========

0.11.1 (unreleased)
0.12.0 (unreleased)
-------------------

- Nothing changed yet.
- Ignore unreleased Python versions (3.8 at the moment).


0.11.0 (2019-02-13)
Expand Down
5 changes: 3 additions & 2 deletions check_python_versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@


__author__ = 'Marius Gedminas <marius@gedmin.as>'
__version__ = '0.11.1.dev0'
__version__ = '0.12.0.dev0'


log = logging.getLogger('check-python-versions')
Expand Down Expand Up @@ -409,10 +409,11 @@ def get_manylinux_python_versions(filename=MANYLINUX_INSTALL_SH):


def important(versions):
upcoming_release = f'3.{CURRENT_PYTHON_3_VERSION + 1}'
return {
v for v in versions
if not v.startswith(('PyPy', 'Jython')) and v != 'nightly'
and not v.endswith('-dev')
and not v.endswith('-dev') and v != upcoming_release
}


Expand Down
5 changes: 3 additions & 2 deletions tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -468,9 +468,10 @@ def test_get_manylinux_python_versions(tmp_path):
]


def test_important():
def test_important(monkeypatch):
monkeypatch.setattr(cpv, 'CURRENT_PYTHON_3_VERSION', 7)
assert cpv.important({
'2.7', '3.4', '3.7-dev', 'nightly', 'PyPy3', 'Jython'
'2.7', '3.4', '3.7-dev', '3.8', 'nightly', 'PyPy3', 'Jython'
}) == {'2.7', '3.4'}


Expand Down

0 comments on commit 6443d14

Please sign in to comment.