diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3a2ae9b..46f927f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -12,11 +12,11 @@ on: jobs: test: name: "Python ${{ matrix.python-version }} ${{ matrix.name-suffix }}" - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 strategy: matrix: - python-version: ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9"] + python-version: ["3.6", "3.7", "3.8", "3.9", "3.10-dev"] steps: - uses: actions/checkout@v2 diff --git a/appveyor.yml b/appveyor.yml index 6501efe..a981d68 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,16 +1,18 @@ # AppVeyor.com is a Continuous Integration service to build and run tests under # Windows +image: Visual Studio 2019 + environment: matrix: - - PYTHON: "C:\\Python27" - - PYTHON: "C:\\Python27-x64" - - PYTHON: "C:\\Python34" - - PYTHON: "C:\\Python34-x64" - - PYTHON: "C:\\Python35" - - PYTHON: "C:\\Python35-x64" - PYTHON: "C:\\Python36" - PYTHON: "C:\\Python36-x64" + - PYTHON: "C:\\Python37" + - PYTHON: "C:\\Python37-x64" + - PYTHON: "C:\\Python38" + - PYTHON: "C:\\Python38-x64" + - PYTHON: "C:\\Python39" + - PYTHON: "C:\\Python39-x64" install: - "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%" diff --git a/cycler.py b/cycler.py index 0c89e49..f86b68d 100644 --- a/cycler.py +++ b/cycler.py @@ -40,17 +40,11 @@ {'color': 'b', 'linestyle': '-.'} """ -from __future__ import (absolute_import, division, print_function, - unicode_literals) import copy from functools import reduce from itertools import product, cycle from operator import mul, add -import sys - -if sys.version_info < (3,): - from itertools import izip as zip __version__ = '0.10.0' @@ -107,7 +101,7 @@ def concat(left, right): return reduce(add, (_cycler(k, _l[k] + _r[k]) for k in left.keys)) -class Cycler(object): +class Cycler: """ Composable cycles. @@ -231,7 +225,7 @@ def _from_iter(cls, label, itr): """ ret = cls(None) ret._left = list({label: v} for v in itr) - ret._keys = set([label]) + ret._keys = {label} return ret def __getitem__(self, key): @@ -263,7 +257,7 @@ def __add__(self, other): """ if len(self) != len(other): raise ValueError("Can only add equal length cycles, " - "not {0} and {1}".format(len(self), len(other))) + f"not {len(self)} and {len(other)}") return Cycler(self, other, zip) def __mul__(self, other): @@ -347,7 +341,7 @@ def __repr__(self): if self._right is None: lab = self.keys.pop() itr = list(v[lab] for v in self) - return "cycler({lab!r}, {itr!r})".format(lab=lab, itr=itr) + return f"cycler({lab!r}, {itr!r})" else: op = op_map.get(self._op, '?') msg = "({left!r} {op} {right!r})" @@ -358,11 +352,11 @@ def _repr_html_(self): output = "
| {key!r} | ".format(key=key) + output += f"{key!r} | " for d in iter(self): output += "
|---|---|
| {val!r} | ".format(val=d[k]) + output += f"{d[k]!r} | " output += "