Skip to content

Commit aa4da51

Browse files
committed
Prepare semver 3 (#176)
Generally, remove everything related to Python 2.7 & 3.4 and add missing 3.8 & 3.9: * Raise version to 2.99.99 (to indicate that it's different from 2.10.0) * Prepare (empty) CHANGELOG for 2.99.99 * Correct Trove categories and python_requires in setup.py * Adapt tox.ini & .travis.yml: remove old stuff, add missing (see above) * Adapt semver.py - Remove if clause for cmp - Don't check for `__name__`, use `__qualname__` instead - Use yield from ... (for loop is not necessary anymore)
1 parent 25f5423 commit aa4da51

File tree

5 files changed

+41
-22
lines changed

5 files changed

+41
-22
lines changed

.travis.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,6 @@ script: tox -v
1313

1414
matrix:
1515
include:
16-
- python: "2.7"
17-
env: TOXENV=py27
18-
19-
- python: "3.4"
20-
env: TOXENV=py34
2116

2217
- python: "3.6"
2318
env: TOXENV=checks
@@ -32,5 +27,13 @@ matrix:
3227
dist: xenial
3328
env: TOXENV=py37
3429

30+
- python: "3.8"
31+
dist: bionic
32+
env: TOXENV=py38
33+
34+
- python: "nightly"
35+
dist: bionic
36+
env: TOXENV=py39
37+
3538
- python: "pypy"
3639
env: TOXENV=pypy

CHANGELOG.rst

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,29 @@ Change Log
66
All notable changes to this code base will be documented in this file,
77
in every released version.
88

9+
Version 2.99.99
10+
===============
11+
12+
:Released: 2020-
13+
:Maintainer:
14+
15+
Features
16+
--------
17+
18+
19+
Bug Fixes
20+
---------
21+
22+
23+
Additions
24+
---------
25+
26+
27+
Removals
28+
--------
29+
30+
31+
932
Version 2.10.0
1033
==============
1134

semver.py

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import warnings
1111

1212

13-
__version__ = "2.10.0"
13+
__version__ = "2.99.99"
1414
__author__ = "Kostiantyn Rybnikov"
1515
__author_email__ = "k-bx@k-bx.com"
1616
__maintainer__ = ["Sebastien Celles", "Tom Schraitle"]
@@ -21,11 +21,9 @@
2121
SEMVER_SPEC_VERSION = "2.0.0"
2222

2323

24-
if not hasattr(__builtins__, "cmp"):
25-
26-
def cmp(a, b):
27-
"""Return negative if a<b, zero if a==b, positive if a>b."""
28-
return (a > b) - (a < b)
24+
def cmp(a, b):
25+
"""Return negative if a<b, zero if a==b, positive if a>b."""
26+
return (a > b) - (a < b)
2927

3028

3129
def deprecated(func=None, replace=None, version=None, category=DeprecationWarning):
@@ -56,10 +54,8 @@ def wrapper(*args, **kwargs):
5654
else:
5755
msg.append("Use the respective 'semver.VersionInfo.{r}' instead.")
5856

59-
# hasattr is needed for Python2 compatibility:
60-
f = func.__qualname__ if hasattr(func, "__qualname__") else func.__name__
57+
f = func.__qualname__
6158
r = replace or f
62-
6359
frame = inspect.currentframe().f_back
6460

6561
msg = " ".join(msg)
@@ -268,9 +264,7 @@ def _asdict(self):
268264

269265
def __iter__(self):
270266
"""Implement iter(self)."""
271-
# As long as we support Py2.7, we can't use the "yield from" syntax
272-
for v in self.to_tuple():
273-
yield v
267+
yield from self.to_tuple()
274268

275269
@staticmethod
276270
def _increment_string(string):

setup.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,16 +92,15 @@ def read_file(filename):
9292
"License :: OSI Approved :: BSD License",
9393
"Operating System :: OS Independent",
9494
"Programming Language :: Python",
95-
"Programming Language :: Python :: 2",
96-
"Programming Language :: Python :: 2.7",
9795
"Programming Language :: Python :: 3",
98-
"Programming Language :: Python :: 3.4",
9996
"Programming Language :: Python :: 3.5",
10097
"Programming Language :: Python :: 3.6",
10198
"Programming Language :: Python :: 3.7",
99+
"Programming Language :: Python :: 3.8",
100+
"Programming Language :: Python :: 3.9",
102101
"Topic :: Software Development :: Libraries :: Python Modules",
103102
],
104-
python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*",
103+
python_requires=">=3.5.*",
105104
tests_require=["tox", "virtualenv"],
106105
cmdclass={"clean": Clean, "test": Tox},
107106
entry_points={"console_scripts": ["pysemver = semver:main"]},

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[tox]
22
envlist =
33
flake8
4-
py{27,34,35,36,37}
4+
py{35,36,37,38,39}
55
pypy
66

77
[testenv]

0 commit comments

Comments
 (0)