From b548b455b2801039bfa679b978df1497521bf53a Mon Sep 17 00:00:00 2001 From: Yusuke Hayashi Date: Sun, 24 Jan 2021 19:49:58 +0900 Subject: [PATCH] house keeping update --- .gitignore | 3 ++- .travis.yml | 4 ++-- Makefile | 7 +++---- patterns/behavioral/iterator.py | 8 ++++++-- requirements-dev.txt | 8 +++++--- setup.cfg | 2 +- setup.py | 2 ++ tox.ini | 4 ++-- 8 files changed, 23 insertions(+), 15 deletions(-) diff --git a/.gitignore b/.gitignore index a7379521..8b2c28d8 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,5 @@ __pycache__ .tox/ venv .vscode/ -.python-version \ No newline at end of file +.python-version +.coverage diff --git a/.travis.yml b/.travis.yml index f7719a4c..ab6ba6bf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,8 +4,8 @@ language: python jobs: include: - - python: "3.7" - env: TOXENV=py37 + - python: "3.8" + env: TOXENV=py38 - python: "3.9" env: TOXENV=py39 diff --git a/Makefile b/Makefile index 25826c8b..92ba244a 100644 --- a/Makefile +++ b/Makefile @@ -39,9 +39,8 @@ ifeq ("$(wildcard venv/bin/pip-sync)","") endif # pip-tools - @pip-compile --upgrade requirements-dev.txt - @pip-compile --upgrade requirements.txt - @pip-sync requirements-dev.txt requirements.txt + # @pip-compile --upgrade requirements-dev.txt + @pip-sync requirements-dev.txt .PHONY: pylinter @@ -85,4 +84,4 @@ endif --select "B,C,E,F,W,T4,B9" \ --ignore "E203,E266,E501,W503,F403,F401,E402" \ --exclude ".git,__pycache__,old, build, \ - dist, venv" $(path) + dist, venv, .tox" $(path) diff --git a/patterns/behavioral/iterator.py b/patterns/behavioral/iterator.py index 3c6ec985..40162461 100644 --- a/patterns/behavioral/iterator.py +++ b/patterns/behavioral/iterator.py @@ -14,8 +14,12 @@ def count_to(count): # Test the generator -count_to_two = lambda: count_to(2) -count_to_five = lambda: count_to(5) +def count_to_two() -> None: + return count_to(2) + + +def count_to_five() -> None: + return count_to(5) def main(): diff --git a/requirements-dev.txt b/requirements-dev.txt index 451dad45..0de4748b 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,6 +1,8 @@ -e . -pytest~=4.3.0 -pytest-cov~=2.6.0 -flake8~=3.7.0 +pytest~=6.2.0 +pytest-cov~=2.11.0 pytest-randomly~=3.1.0 +black>=20.8b1 +isort~=5.7.0 +flake8~=3.8.0 \ No newline at end of file diff --git a/setup.cfg b/setup.cfg index 159357a4..8f2de0ff 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,7 +1,7 @@ [flake8] max-line-length = 120 ignore = E266 E731 W503 -exclude = .venv* +exclude = venv* [tool:pytest] filterwarnings = diff --git a/setup.py b/setup.py index b4218c1c..b4d2cdf1 100644 --- a/setup.py +++ b/setup.py @@ -10,5 +10,7 @@ "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", ], ) diff --git a/tox.ini b/tox.ini index ee8b9579..168e2c9d 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py37,py38,py39,cov-report +envlist = py38,py39,cov-report skip_missing_interpreters = true @@ -9,7 +9,7 @@ setenv = deps = -r requirements-dev.txt commands = - flake8 . --exclude=./.* + flake8 . --exclude="./.*, venv" ; `randomly-seed` option from `pytest-randomly` helps with deterministic outputs for examples like `other/blackboard.py` pytest --randomly-seed=1234 --doctest-modules patterns/ pytest -s -vv --cov={envsitepackagesdir}/patterns --log-level=INFO tests/