From eb660062cac865d6201241a452412e912fef30f5 Mon Sep 17 00:00:00 2001 From: Tsuyoshi Hombashi Date: Sat, 30 Oct 2021 21:32:15 +0900 Subject: [PATCH 01/40] Refactor clean target calls --- Makefile | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index f0af13a..81889d4 100644 --- a/Makefile +++ b/Makefile @@ -6,15 +6,12 @@ PKG_BUILD_DIR := $(BUILD_WORK_DIR)/$(PACKAGE) .PHONY: build -build: - @make clean +build: clean @tox -e build ls -lh dist/* .PHONY: build-remote -build-remote: -build-remote: - @rm -rf $(BUILD_WORK_DIR) +build-remote: clean @mkdir -p $(BUILD_WORK_DIR) @cd $(BUILD_WORK_DIR) && \ git clone https://github.com/$(OWNER)/$(PACKAGE).git && \ @@ -29,7 +26,8 @@ check: .PHONY: clean clean: - @tox -e clean + @rm -rf $(BUILD_WORK_DIR) + @$(PYTHON) -m tox -e clean .PHONY: fmt fmt: From 6b693a16867f43a540ba34da57ea55fd841b9e28 Mon Sep 17 00:00:00 2001 From: Tsuyoshi Hombashi Date: Sat, 30 Oct 2021 21:34:53 +0900 Subject: [PATCH 02/40] Refactor command executions --- Makefile | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 81889d4..c241b75 100644 --- a/Makefile +++ b/Makefile @@ -3,11 +3,12 @@ PACKAGE := allpairspy BUILD_WORK_DIR := _work DIST_DIR := $(BUILD_WORK_DIR)/$(PACKAGE)/dist PKG_BUILD_DIR := $(BUILD_WORK_DIR)/$(PACKAGE) +PYTHON := python3 .PHONY: build build: clean - @tox -e build + @$(PYTHON) -m tox -e build ls -lh dist/* .PHONY: build-remote @@ -16,12 +17,12 @@ build-remote: clean @cd $(BUILD_WORK_DIR) && \ git clone https://github.com/$(OWNER)/$(PACKAGE).git && \ cd $(PACKAGE) && \ - tox -e build + $(PYTHON) -m tox -e build ls -lh $(PKG_BUILD_DIR)/dist/* .PHONY: check check: - @tox -e lint + @$(PYTHON) -m tox -e lint travis lint .PHONY: clean @@ -31,14 +32,14 @@ clean: .PHONY: fmt fmt: - tox -e fmt + $(PYTHON) -m tox -e fmt .PHONY: release release: - @cd $(PKG_BUILD_DIR) && python setup.py release --sign + @cd $(PKG_BUILD_DIR) && @$(PYTHON) setup.py release --sign @make clean .PHONY: setup setup: - @pip install --upgrade -e .[test] releasecmd tox - pip check + @$(PYTHON) -m pip install -q --disable-pip-version-check --upgrade -e .[test] releasecmd tox + @$(PYTHON) -m pip check From ab0a9b0bd3e0e827194583c645f42b90ef8e7597 Mon Sep 17 00:00:00 2001 From: Tsuyoshi Hombashi Date: Sat, 30 Oct 2021 21:35:19 +0900 Subject: [PATCH 03/40] Remove a lint that no longer needed --- Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/Makefile b/Makefile index c241b75..a205479 100644 --- a/Makefile +++ b/Makefile @@ -23,7 +23,6 @@ build-remote: clean .PHONY: check check: @$(PYTHON) -m tox -e lint - travis lint .PHONY: clean clean: From 286f94e2831d8de1bd8682a2793ece35f37497f5 Mon Sep 17 00:00:00 2001 From: Tsuyoshi Hombashi Date: Sat, 30 Oct 2021 21:37:14 +0900 Subject: [PATCH 04/40] Add lower version limit to cleanpy deps --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index b528cda..44f5057 100644 --- a/tox.ini +++ b/tox.ini @@ -27,7 +27,7 @@ commands = [testenv:clean] skip_install = true deps = - cleanpy + cleanpy>=0.3.1 commands = cleanpy --all --exclude-envs . From c972e170c267e0a60cef5117760f04a0ac796404 Mon Sep 17 00:00:00 2001 From: Tsuyoshi Hombashi Date: Sun, 27 Feb 2022 14:01:39 +0900 Subject: [PATCH 05/40] Update sponsors --- README.rst | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index a152701..eda915c 100644 --- a/README.rst +++ b/README.rst @@ -325,8 +325,14 @@ no external dependencies. Sponsors ------------ -.. image:: https://avatars0.githubusercontent.com/u/44389260?s=48&u=6da7176e51ae2654bcfd22564772ef8a3bb22318&v=4 +.. image:: https://avatars.githubusercontent.com/u/3658062?s=48&v=4 + :target: https://github.com/b4tman + :alt: Dmitry Belyaev (b4tman) +.. image:: https://avatars.githubusercontent.com/u/44389260?s=48&u=6da7176e51ae2654bcfd22564772ef8a3bb22318&v=4 :target: https://github.com/chasbecker - :alt: chasbecker + :alt: Charles Becker (chasbecker) +.. image:: https://avatars.githubusercontent.com/u/46711571?s=48&u=57687c0e02d5d6e8eeaf9177f7b7af4c9f275eb5&v=4 + :target: https://github.com/Arturi0 + :alt: Arturi0 `Become a sponsor `__ From a572f8f8ad88c3144703fe628689c48a44b39962 Mon Sep 17 00:00:00 2001 From: Tsuyoshi Hombashi Date: Sun, 27 Feb 2022 14:10:18 +0900 Subject: [PATCH 06/40] Fix CI --- .github/workflows/tests.yml | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index eda546f..3e0ae0e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -3,33 +3,37 @@ name: Tests on: [push, pull_request] jobs: - build: + unit-test: + timeout-minutes: 20 runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - python-version: [3.5, 3.6, 3.7, 3.8, 3.9, 3.10.0-alpha.6, pypy3] + python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", pypy3] os: [ubuntu-latest, macos-latest, windows-latest] steps: - uses: actions/checkout@v2 - - name: Set up Python ${{ matrix.python-version }} + - name: Setup Python ${{ matrix.python-version }} uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} + - name: Install pip + run: python -m pip install --upgrade --disable-pip-version-check "pip>=21.1" + - name: Get pip cache dir id: pip-cache - run: | - python -m pip install --upgrade "pip>=20.1" - echo "::set-output name=dir::$(pip cache dir)" + run: echo "::set-output name=dir::$(pip cache dir)" - name: Cache pip uses: actions/cache@v2 with: - path: ${{ steps.pip-cache.outputs.dir }} - key: ${{ matrix.os }}-${{ matrix.python-version }}-pip-${{ hashFiles('**/requirements.txt') }} + path: | + ${{ steps.pip-cache.outputs.dir }} + ./.tox + key: ${{ matrix.os }}-${{ matrix.python-version }}-pip-${{ hashFiles('setup.py', '**/requirements.txt') }} restore-keys: | ${{ matrix.os }}-${{ matrix.python-version }}-pip- @@ -37,16 +41,15 @@ jobs: run: | python -m pip install --upgrade tox - - name: Run tox - run: | - tox -e cov + - name: Run tests + run: tox -e cov env: PYTEST_DISCORD_WEBHOOK: ${{ secrets.PYTEST_DISCORD_WEBHOOK }} - - name: Coverage report + - name: Upload coverage report + if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.8' run: | - python -m pip install --upgrade coveralls + python -m pip install --upgrade --disable-pip-version-check coveralls tomli coveralls --service=github env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.8' From e38c2e9d3f92160ed9ccfc8ab131847d79e7b246 Mon Sep 17 00:00:00 2001 From: Tsuyoshi Hombashi Date: Sun, 27 Feb 2022 14:18:29 +0900 Subject: [PATCH 07/40] Fix CI --- .github/workflows/tests.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3e0ae0e..13fa7a5 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -11,6 +11,11 @@ jobs: matrix: python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", pypy3] os: [ubuntu-latest, macos-latest, windows-latest] + exclude: + - os: macos-latest + python-version: "pypy3" + - os: windows-latest + python-version: "pypy3" steps: - uses: actions/checkout@v2 From 0ff3ccb05e65424c8e305abf75f73e2a5578cc77 Mon Sep 17 00:00:00 2001 From: Tsuyoshi Hombashi Date: Sun, 27 Feb 2022 14:26:26 +0900 Subject: [PATCH 08/40] Fix CI --- .github/workflows/tests.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 13fa7a5..f4db8a4 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -16,6 +16,8 @@ jobs: python-version: "pypy3" - os: windows-latest python-version: "pypy3" + - os: windows-latest + python-version: "3.6" steps: - uses: actions/checkout@v2 From db112112df14b4b640137b39220056b304139544 Mon Sep 17 00:00:00 2001 From: Tsuyoshi Hombashi Date: Sat, 8 Jul 2023 16:50:36 +0900 Subject: [PATCH 09/40] Remove clean from envlist --- tox.ini | 1 - 1 file changed, 1 deletion(-) diff --git a/tox.ini b/tox.ini index 44f5057..b9d5e0e 100644 --- a/tox.ini +++ b/tox.ini @@ -3,7 +3,6 @@ envlist = py{35,36,37,38,39,310} pypy3 build - clean cov fmt lint From 3f1754c151f3830eb896f2fd6172863c50347b80 Mon Sep 17 00:00:00 2001 From: Tsuyoshi Hombashi Date: Sat, 8 Jul 2023 16:51:46 +0900 Subject: [PATCH 10/40] Remove basepython from testenvs --- tox.ini | 3 --- 1 file changed, 3 deletions(-) diff --git a/tox.ini b/tox.ini index b9d5e0e..5bf4b3c 100644 --- a/tox.ini +++ b/tox.ini @@ -14,7 +14,6 @@ commands = pytest {posargs} [testenv:build] -basepython = python3.8 deps = twine wheel @@ -39,7 +38,6 @@ commands = coverage report -m [testenv:fmt] -basepython = python3.8 skip_install = true deps = autoflake @@ -51,7 +49,6 @@ commands = isort . [testenv:lint] -basepython = python3.8 skip_install = true deps = codespell From 1d1a2acc123d7c7336e365e5ceabebbcf2a6231a Mon Sep 17 00:00:00 2001 From: Tsuyoshi Hombashi Date: Sat, 8 Jul 2023 16:54:14 +0900 Subject: [PATCH 11/40] Drop support for Python 3.5 --- setup.py | 3 +-- tox.ini | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index 5a3f3eb..ccaaa40 100755 --- a/setup.py +++ b/setup.py @@ -45,7 +45,7 @@ def get_release_command_class(): maintainer_email=pkg_info["__maintainer_email__"], packages=setuptools.find_packages(exclude=["tests*"]), project_urls={"Source": REPOSITORY_URL, "Tracker": "{:s}/issues".format(REPOSITORY_URL)}, - python_requires=">=3.5", + python_requires=">=3.6", install_requires=install_requires, extras_require={"test": tests_requires}, classifiers=[ @@ -59,7 +59,6 @@ def get_release_command_class(): "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", diff --git a/tox.ini b/tox.ini index 5bf4b3c..da68867 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] envlist = - py{35,36,37,38,39,310} + py{36,37,38,39,310} pypy3 build cov From 7bb6fe525b35ca7f78e4e49bc72bfd09e52c6e32 Mon Sep 17 00:00:00 2001 From: Tsuyoshi Hombashi Date: Sat, 8 Jul 2023 16:55:37 +0900 Subject: [PATCH 12/40] Modify to use testenv.extras --- tox.ini | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tox.ini b/tox.ini index da68867..47ca890 100644 --- a/tox.ini +++ b/tox.ini @@ -8,8 +8,8 @@ envlist = lint [testenv] -deps = - .[test] +extras = + test commands = pytest {posargs} @@ -30,8 +30,9 @@ commands = cleanpy --all --exclude-envs . [testenv:cov] +extras = + test deps = - .[test] coverage[toml] commands = coverage run -m pytest {posargs:-vv} From d3edae00552bb8c3bb330bb2cf63011daf44a096 Mon Sep 17 00:00:00 2001 From: Tsuyoshi Hombashi Date: Sat, 8 Jul 2023 17:05:59 +0900 Subject: [PATCH 13/40] Modify to use Python 3.6 syntax --- allpairspy/allpairs.py | 4 ++-- examples/example1.1.py | 2 +- examples/example1.2.py | 2 +- examples/example1.3.py | 2 +- examples/example2.1.py | 2 +- examples/example2.2.py | 2 +- examples/example_ordered_dict.py | 2 +- setup.py | 7 +++++-- 8 files changed, 13 insertions(+), 10 deletions(-) mode change 100755 => 100644 setup.py diff --git a/allpairspy/allpairs.py b/allpairspy/allpairs.py index b8b1a82..4d0422a 100644 --- a/allpairspy/allpairs.py +++ b/allpairspy/allpairs.py @@ -130,7 +130,7 @@ def __next__(self): continue direction = 0 else: - raise ValueError("next(): unknown 'direction' code '{}'".format(direction)) + raise ValueError(f"next(): unknown 'direction' code '{direction}'") chosen_item_list[i] = self.__working_item_matrix[i][indexes[i]] @@ -202,7 +202,7 @@ def __resort_working_array(self, chosen_item_list, num): def __get_working_item_matrix(self, parameter_matrix): return [ [ - Item("a{:d}v{:d}".format(param_idx, value_idx), value) + Item(f"a{param_idx:d}v{value_idx:d}", value) for value_idx, value in enumerate(value_list) ] for param_idx, value_list in enumerate(parameter_matrix) diff --git a/examples/example1.1.py b/examples/example1.1.py index 7dcbea4..7ae3599 100755 --- a/examples/example1.1.py +++ b/examples/example1.1.py @@ -19,4 +19,4 @@ print("PAIRWISE:") for i, pairs in enumerate(AllPairs(parameters)): - print("{:2d}: {}".format(i, pairs)) + print(f"{i:2d}: {pairs}") diff --git a/examples/example1.2.py b/examples/example1.2.py index 07ba5ed..bdae899 100755 --- a/examples/example1.2.py +++ b/examples/example1.2.py @@ -19,4 +19,4 @@ print("TRIPLEWISE:") for i, pairs in enumerate(AllPairs(parameters, n=3)): - print("{:2d}: {}".format(i, pairs)) + print(f"{i:2d}: {pairs}") diff --git a/examples/example1.3.py b/examples/example1.3.py index 64cb0dc..0228f7a 100755 --- a/examples/example1.3.py +++ b/examples/example1.3.py @@ -26,4 +26,4 @@ print("PAIRWISE:") for i, pairs in enumerate(AllPairs(parameters, previously_tested=tested)): - print("{:2d}: {}".format(i, pairs)) + print(f"{i:2d}: {pairs}") diff --git a/examples/example2.1.py b/examples/example2.1.py index ff8401a..1d1eac8 100755 --- a/examples/example2.1.py +++ b/examples/example2.1.py @@ -48,4 +48,4 @@ def is_valid_combination(row): print("PAIRWISE:") for i, pairs in enumerate(AllPairs(parameters, filter_func=is_valid_combination)): - print("{:2d}: {}".format(i, pairs)) + print(f"{i:2d}: {pairs}") diff --git a/examples/example2.2.py b/examples/example2.2.py index 43b9893..a5c6436 100755 --- a/examples/example2.2.py +++ b/examples/example2.2.py @@ -56,4 +56,4 @@ def is_valid_combination(values, names): print("PAIRWISE:") for i, pairs in enumerate(pairwise): - print("{:2d}: {}".format(i, pairs)) + print(f"{i:2d}: {pairs}") diff --git a/examples/example_ordered_dict.py b/examples/example_ordered_dict.py index e014865..8284b4e 100644 --- a/examples/example_ordered_dict.py +++ b/examples/example_ordered_dict.py @@ -11,4 +11,4 @@ print("PAIRWISE:") for i, pairs in enumerate(AllPairs(parameters)): - print("{:2d}: {}".format(i, pairs)) + print(f"{i:2d}: {pairs}") diff --git a/setup.py b/setup.py old mode 100755 new mode 100644 index ccaaa40..bbcd092 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ MODULE_NAME = "allpairspy" -REPOSITORY_URL = "https://github.com/thombashi/{:s}".format(MODULE_NAME) +REPOSITORY_URL = f"https://github.com/thombashi/{MODULE_NAME:s}" REQUIREMENT_DIR = "requirements" pkg_info = {} @@ -44,7 +44,10 @@ def get_release_command_class(): maintainer=pkg_info["__maintainer__"], maintainer_email=pkg_info["__maintainer_email__"], packages=setuptools.find_packages(exclude=["tests*"]), - project_urls={"Source": REPOSITORY_URL, "Tracker": "{:s}/issues".format(REPOSITORY_URL)}, + project_urls={ + "Source": REPOSITORY_URL, + "Tracker": f"{REPOSITORY_URL:s}/issues", + }, python_requires=">=3.6", install_requires=install_requires, extras_require={"test": tests_requires}, From b0616c03ac852a2e4aec2190801e50502b1608c2 Mon Sep 17 00:00:00 2001 From: Tsuyoshi Hombashi Date: Sat, 8 Jul 2023 17:10:45 +0900 Subject: [PATCH 14/40] Remove tests/__init__.py that is no longer needed --- tests/__init__.py | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 tests/__init__.py diff --git a/tests/__init__.py b/tests/__init__.py deleted file mode 100644 index 0c798f6..0000000 --- a/tests/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -# this file temporarily required to get coverage: -# pytest-dev/pytest-cov#391 -# https://github.com/pytest-dev/pytest-cov/issues/391 From de308b17351a10d90d0d2f0fad08f8904efba6ba Mon Sep 17 00:00:00 2001 From: Tsuyoshi Hombashi Date: Sat, 8 Jul 2023 17:12:08 +0900 Subject: [PATCH 15/40] Apply formatter --- examples/example2.2.py | 1 - examples/example_ordered_dict.py | 6 +++++- tests/test_allpairs.py | 1 - 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/examples/example2.2.py b/examples/example2.2.py index a5c6436..5ca6ba8 100755 --- a/examples/example2.2.py +++ b/examples/example2.2.py @@ -9,7 +9,6 @@ def is_valid_combination(values, names): - dictionary = dict(zip(names, values)) """ diff --git a/examples/example_ordered_dict.py b/examples/example_ordered_dict.py index 8284b4e..38d0427 100644 --- a/examples/example_ordered_dict.py +++ b/examples/example_ordered_dict.py @@ -6,7 +6,11 @@ parameters = OrderedDict( - {"brand": ["Brand X", "Brand Y"], "os": ["98", "NT", "2000", "XP"], "minute": [15, 30, 60]} + { + "brand": ["Brand X", "Brand Y"], + "os": ["98", "NT", "2000", "XP"], + "minute": [15, 30, 60], + } ) print("PAIRWISE:") diff --git a/tests/test_allpairs.py b/tests/test_allpairs.py index c1d59c1..2886f79 100644 --- a/tests/test_allpairs.py +++ b/tests/test_allpairs.py @@ -210,7 +210,6 @@ def test_normal_example22(self): ] def is_valid_combination(values, names): - dictionary = dict(zip(names, values)) """ From 90447351225fa39c2da118e7af65cec89fb5426e Mon Sep 17 00:00:00 2001 From: Tsuyoshi Hombashi Date: Sat, 8 Jul 2023 17:12:40 +0900 Subject: [PATCH 16/40] Update test_requirements --- requirements/test_requirements.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/requirements/test_requirements.txt b/requirements/test_requirements.txt index e079f8a..d2adc09 100644 --- a/requirements/test_requirements.txt +++ b/requirements/test_requirements.txt @@ -1 +1,2 @@ -pytest +pytest>=6.0.1 +pytest-md-report>=0.3 From f7d6bc4338509e8fdc1478401bdc708bab53f7a7 Mon Sep 17 00:00:00 2001 From: Tsuyoshi Hombashi Date: Sat, 8 Jul 2023 17:13:18 +0900 Subject: [PATCH 17/40] Add tool.pytest.ini_options to pyproject.toml --- pyproject.toml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 686ea2d..b81548a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -49,3 +49,12 @@ skip_glob = [ '*/.pytype/*', '*/.tox/*', ] + +[tool.pytest.ini_options] +testpaths = [ + "tests", +] + +md_report = true +md_report_verbose = 0 +md_report_color = "auto" From db316130ddd1e32d06bf563b506dc47e878d328b Mon Sep 17 00:00:00 2001 From: Tsuyoshi Hombashi Date: Sat, 8 Jul 2023 17:14:11 +0900 Subject: [PATCH 18/40] Update deps of testenvs --- tox.ini | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tox.ini b/tox.ini index 47ca890..671c498 100644 --- a/tox.ini +++ b/tox.ini @@ -25,7 +25,7 @@ commands = [testenv:clean] skip_install = true deps = - cleanpy>=0.3.1 + cleanpy>=0.4 commands = cleanpy --all --exclude-envs . @@ -41,8 +41,8 @@ commands = [testenv:fmt] skip_install = true deps = - autoflake - black + autoflake>=2 + black>=23.1 isort>=5 commands = black setup.py examples tests allpairspy From cce78377ab7bb4ae1a6d426c5f13fbae9c4e2cf1 Mon Sep 17 00:00:00 2001 From: Tsuyoshi Hombashi Date: Sat, 8 Jul 2023 17:15:27 +0900 Subject: [PATCH 19/40] Update [build-system] --- pyproject.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index b81548a..3837858 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,6 @@ [build-system] -requires = ["setuptools", "wheel"] +requires = ["setuptools>=61.0"] +build-backend = "setuptools.build_meta" [tool.black] line-length = 100 From 7314e37333e54b408362c99ce8470737041b437b Mon Sep 17 00:00:00 2001 From: Tsuyoshi Hombashi Date: Sat, 8 Jul 2023 17:16:11 +0900 Subject: [PATCH 20/40] Add --depth to 'git clone' execution --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index a205479..648edc9 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,7 @@ build: clean build-remote: clean @mkdir -p $(BUILD_WORK_DIR) @cd $(BUILD_WORK_DIR) && \ - git clone https://github.com/$(OWNER)/$(PACKAGE).git && \ + git clone --depth 1 https://github.com/$(OWNER)/$(PACKAGE).git && \ cd $(PACKAGE) && \ $(PYTHON) -m tox -e build ls -lh $(PKG_BUILD_DIR)/dist/* From b46b2df118ac74e8a272dd8c6703aa68aca7bae9 Mon Sep 17 00:00:00 2001 From: Tsuyoshi Hombashi Date: Sat, 8 Jul 2023 17:16:33 +0900 Subject: [PATCH 21/40] Update pypy specifier --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f4db8a4..431728c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -9,7 +9,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", pypy3] + python-version: ['3.6', '3.7', '3.8', '3.9', '3.10', 'pypy-3.10'] os: [ubuntu-latest, macos-latest, windows-latest] exclude: - os: macos-latest From 03d7a7cb0ddb925c4d5cf622ef3b7fecf0db4ec0 Mon Sep 17 00:00:00 2001 From: Tsuyoshi Hombashi Date: Sat, 8 Jul 2023 17:17:42 +0900 Subject: [PATCH 22/40] Add push-ignore to trigger events --- .github/workflows/tests.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 431728c..7df3775 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,6 +1,14 @@ name: Tests -on: [push, pull_request] +on: + push: + paths-ignore: + - '.gitignore' + - 'README.rst' + pull_request: + paths-ignore: + - '.gitignore' + - 'README.rst' jobs: unit-test: From 73f9d433a1a9859c3361d434d70348ce9d005eb3 Mon Sep 17 00:00:00 2001 From: Tsuyoshi Hombashi Date: Sat, 8 Jul 2023 17:18:44 +0900 Subject: [PATCH 23/40] Update actions version --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7df3775..5befa0d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -28,10 +28,10 @@ jobs: python-version: "3.6" steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Setup Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} From 8badaee10fb5ea93e682b63f547efc51b7119769 Mon Sep 17 00:00:00 2001 From: Tsuyoshi Hombashi Date: Sat, 8 Jul 2023 17:19:59 +0900 Subject: [PATCH 24/40] Modify release target --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 648edc9..9f0b984 100644 --- a/Makefile +++ b/Makefile @@ -35,8 +35,8 @@ fmt: .PHONY: release release: - @cd $(PKG_BUILD_DIR) && @$(PYTHON) setup.py release --sign - @make clean + @cd $(PKG_BUILD_DIR) && @$(PYTHON) setup.py release --verbose + @$(MAKE) clean .PHONY: setup setup: From 85b0afe93e9ef5db776a7d2c8e04a19c4fd2f52c Mon Sep 17 00:00:00 2001 From: Tsuyoshi Hombashi Date: Sat, 8 Jul 2023 17:21:37 +0900 Subject: [PATCH 25/40] Add setup-ci target to Makefile --- .github/workflows/tests.yml | 2 +- Makefile | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5befa0d..ba7a759 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -54,7 +54,7 @@ jobs: - name: Install dependencies run: | - python -m pip install --upgrade tox + make setup-ci - name: Run tests run: tox -e cov diff --git a/Makefile b/Makefile index 9f0b984..62fffbd 100644 --- a/Makefile +++ b/Makefile @@ -38,7 +38,11 @@ release: @cd $(PKG_BUILD_DIR) && @$(PYTHON) setup.py release --verbose @$(MAKE) clean +.PHONY: setup-ci +setup-ci: + @$(PYTHON) -m pip install -q --disable-pip-version-check --upgrade tox + .PHONY: setup -setup: - @$(PYTHON) -m pip install -q --disable-pip-version-check --upgrade -e .[test] releasecmd tox +setup: setup-ci + @$(PYTHON) -m pip install -q --disable-pip-version-check --upgrade -e .[test] releasecmd @$(PYTHON) -m pip check From 049be361197aee89f6b502118b4a9d51c177fcc2 Mon Sep 17 00:00:00 2001 From: Tsuyoshi Hombashi Date: Sat, 8 Jul 2023 17:22:18 +0900 Subject: [PATCH 26/40] Refactor pip caching of workflows --- .github/workflows/tests.yml | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ba7a759..40bf7e9 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -34,24 +34,15 @@ jobs: uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} + cache: pip + cache-dependency-path: | + setup.py + **/*requirements.txt + tox.ini - name: Install pip run: python -m pip install --upgrade --disable-pip-version-check "pip>=21.1" - - name: Get pip cache dir - id: pip-cache - run: echo "::set-output name=dir::$(pip cache dir)" - - - name: Cache pip - uses: actions/cache@v2 - with: - path: | - ${{ steps.pip-cache.outputs.dir }} - ./.tox - key: ${{ matrix.os }}-${{ matrix.python-version }}-pip-${{ hashFiles('setup.py', '**/requirements.txt') }} - restore-keys: | - ${{ matrix.os }}-${{ matrix.python-version }}-pip- - - name: Install dependencies run: | make setup-ci From b49d60b7fc76880e5632ee3d9a68cf5d1d21af21 Mon Sep 17 00:00:00 2001 From: Tsuyoshi Hombashi Date: Sat, 8 Jul 2023 17:24:12 +0900 Subject: [PATCH 27/40] Drop support for Python 3.6 --- .github/workflows/tests.yml | 9 +-------- setup.py | 3 +-- tox.ini | 2 +- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 40bf7e9..41cf60d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -17,15 +17,8 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.6', '3.7', '3.8', '3.9', '3.10', 'pypy-3.10'] + python-version: ['3.7', '3.8', '3.9', '3.10', 'pypy-3.10'] os: [ubuntu-latest, macos-latest, windows-latest] - exclude: - - os: macos-latest - python-version: "pypy3" - - os: windows-latest - python-version: "pypy3" - - os: windows-latest - python-version: "3.6" steps: - uses: actions/checkout@v3 diff --git a/setup.py b/setup.py index bbcd092..6178e6a 100644 --- a/setup.py +++ b/setup.py @@ -48,7 +48,7 @@ def get_release_command_class(): "Source": REPOSITORY_URL, "Tracker": f"{REPOSITORY_URL:s}/issues", }, - python_requires=">=3.6", + python_requires=">=3.7", install_requires=install_requires, extras_require={"test": tests_requires}, classifiers=[ @@ -62,7 +62,6 @@ def get_release_command_class(): "Operating System :: OS Independent", "Programming Language :: Python", "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 671c498..3081ceb 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] envlist = - py{36,37,38,39,310} + py{37,38,39,310} pypy3 build cov From e5e3982c1d047481a3996c06e6b38165d37e9044 Mon Sep 17 00:00:00 2001 From: Tsuyoshi Hombashi Date: Sat, 8 Jul 2023 17:45:06 +0900 Subject: [PATCH 28/40] Add target-version to tool.black --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 3837858..7c93b49 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -19,6 +19,7 @@ exclude = ''' )/ | docs/conf.py ''' +target-version = ['py37', 'py38', 'py39', 'py310'] [tool.coverage.run] source = ['allpairspy'] From 5ec8d274ac7f5b6479666fb72e254dfb4bae5959 Mon Sep 17 00:00:00 2001 From: Tsuyoshi Hombashi Date: Sat, 8 Jul 2023 17:45:32 +0900 Subject: [PATCH 29/40] Update an example --- examples/test_parameterize.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/test_parameterize.py b/examples/test_parameterize.py index 54ba82c..7ca1473 100644 --- a/examples/test_parameterize.py +++ b/examples/test_parameterize.py @@ -9,7 +9,7 @@ from allpairspy import AllPairs -def function_to_be_tested(brand, operating_system, minute): +def function_to_be_tested(brand: str, operating_system: str, minute: int) -> bool: # do something return True @@ -19,8 +19,8 @@ class TestParameterized: @pytest.mark.parametrize( ["brand", "operating_system", "minute"], [ - value_list - for value_list in AllPairs( + values + for values in AllPairs( [["Brand X", "Brand Y"], ["98", "NT", "2000", "XP"], [10, 15, 30, 60]] ) ], From 464176ba9df373af37478f3d91208bdb388fd439 Mon Sep 17 00:00:00 2001 From: Tsuyoshi Hombashi Date: Sat, 8 Jul 2023 17:46:07 +0900 Subject: [PATCH 30/40] Modify to use pypa/build for package build --- tox.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index 3081ceb..3007d91 100644 --- a/tox.ini +++ b/tox.ini @@ -15,12 +15,12 @@ commands = [testenv:build] deps = + build>=0.10 twine wheel commands = - python setup.py sdist bdist_wheel + python -m build twine check dist/*.whl dist/*.tar.gz - python setup.py clean --all [testenv:clean] skip_install = true From 571c1782730d3faf52149731bcc15ab52f78edfc Mon Sep 17 00:00:00 2001 From: Tsuyoshi Hombashi Date: Sat, 8 Jul 2023 17:48:07 +0900 Subject: [PATCH 31/40] Replace deprecated setup.py calls --- tox.ini | 1 - 1 file changed, 1 deletion(-) diff --git a/tox.ini b/tox.ini index 3007d91..97df7f7 100644 --- a/tox.ini +++ b/tox.ini @@ -55,6 +55,5 @@ deps = codespell pylama commands = - python setup.py check codespell allpairspy examples tests -q2 --check-filenames pylama From 0b0bedc55f842e8068b87b99189300aacef9168b Mon Sep 17 00:00:00 2001 From: Tsuyoshi Hombashi Date: Sat, 8 Jul 2023 17:51:03 +0900 Subject: [PATCH 32/40] Add support for Python 3.11 --- .github/workflows/tests.yml | 2 +- setup.py | 1 + tox.ini | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 41cf60d..f1a1b04 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -17,7 +17,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.7', '3.8', '3.9', '3.10', 'pypy-3.10'] + python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', 'pypy-3.10'] os: [ubuntu-latest, macos-latest, windows-latest] steps: diff --git a/setup.py b/setup.py index 6178e6a..75e465b 100644 --- a/setup.py +++ b/setup.py @@ -66,6 +66,7 @@ def get_release_command_class(): "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", diff --git a/tox.ini b/tox.ini index 97df7f7..0f7aa80 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] envlist = - py{37,38,39,310} + py{37,38,39,310,311} pypy3 build cov From 5dceef94edb52bab6c0b296e533830830c0a8cc7 Mon Sep 17 00:00:00 2001 From: Tsuyoshi Hombashi Date: Sat, 8 Jul 2023 17:52:16 +0900 Subject: [PATCH 33/40] Add concurrency.group to unit-test job --- .github/workflows/tests.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f1a1b04..a716e03 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -14,6 +14,9 @@ jobs: unit-test: timeout-minutes: 20 runs-on: ${{ matrix.os }} + concurrency: + group: ${{ github.event_name }}-${{ github.workflow }}-${{ github.ref_name }}-ut-${{ matrix.os }}-${{ matrix.python-version }} + cancel-in-progress: true strategy: fail-fast: false matrix: From 8a2b46d387048430c21402e17d991dd5983ffbb4 Mon Sep 17 00:00:00 2001 From: Tsuyoshi Hombashi Date: Sat, 8 Jul 2023 17:52:40 +0900 Subject: [PATCH 34/40] Remove name from a step --- .github/workflows/tests.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index a716e03..4b4f3a0 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -39,9 +39,7 @@ jobs: - name: Install pip run: python -m pip install --upgrade --disable-pip-version-check "pip>=21.1" - - name: Install dependencies - run: | - make setup-ci + - run: make setup-ci - name: Run tests run: tox -e cov From cab449063355ca5af372e5e337d26aca4f12c2cd Mon Sep 17 00:00:00 2001 From: Tsuyoshi Hombashi Date: Sat, 8 Jul 2023 17:54:39 +0900 Subject: [PATCH 35/40] Add lint job to CI --- .github/workflows/tests.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 4b4f3a0..9a12240 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -11,6 +11,20 @@ on: - 'README.rst' jobs: + lint: + runs-on: ubuntu-latest + concurrency: + group: ${{ github.event_name }}-${{ github.workflow }}-${{ github.ref_name }}-lint + cancel-in-progress: true + timeout-minutes: 20 + container: + image: ghcr.io/thombashi/python-ci:3.11 + + steps: + - uses: actions/checkout@v3 + + - run: make check + unit-test: timeout-minutes: 20 runs-on: ${{ matrix.os }} From 944b170279e6e666de6637510ba62c8d2196d96c Mon Sep 17 00:00:00 2001 From: Tsuyoshi Hombashi Date: Sat, 8 Jul 2023 17:56:14 +0900 Subject: [PATCH 36/40] Add build-package job to CI --- .github/workflows/tests.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9a12240..bdcda55 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -11,6 +11,20 @@ on: - 'README.rst' jobs: + build-package: + runs-on: ubuntu-latest + concurrency: + group: ${{ github.event_name }}-${{ github.workflow }}-${{ github.ref_name }}-build + cancel-in-progress: true + timeout-minutes: 20 + container: + image: ghcr.io/thombashi/python-ci:3.11 + + steps: + - uses: actions/checkout@v3 + + - run: make build + lint: runs-on: ubuntu-latest concurrency: From c1316f8d5cd6e120d82bc6e9c433cd3ef1b9e136 Mon Sep 17 00:00:00 2001 From: Tsuyoshi Hombashi Date: Sat, 8 Jul 2023 17:56:30 +0900 Subject: [PATCH 37/40] Update README --- README.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.rst b/README.rst index eda915c..9372725 100644 --- a/README.rst +++ b/README.rst @@ -90,7 +90,7 @@ Basic Usage Filtering ================== -You can restrict pairs by setting filtering function to ``filter_func`` at +You can restrict pairs by setting a filtering function to ``filter_func`` at ``AllPairs`` constructor. :Sample Code: @@ -198,10 +198,10 @@ Pairs will be returned as ``collections.namedtuple`` instances. 11: Pairs(brand='Brand X', os='2000', minute=15) -Parameterized testing with pairwise by using pytest +Parameterized testing pairwise by using pytest ==================================================================== -Parameterized testing: valee matrix +Parameterized testing: value matrix ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :Sample Code: .. code:: python @@ -319,7 +319,7 @@ Known issues Dependencies ------------ -Python 3.5+ +Python 3.7+ no external dependencies. From fb5c9a486a9aab1fce504bb3b45d2f87de077e61 Mon Sep 17 00:00:00 2001 From: Tsuyoshi Hombashi Date: Sat, 8 Jul 2023 18:06:34 +0900 Subject: [PATCH 38/40] Bump version --- allpairspy/__version__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/allpairspy/__version__.py b/allpairspy/__version__.py index 618e6d3..658369e 100644 --- a/allpairspy/__version__.py +++ b/allpairspy/__version__.py @@ -3,4 +3,4 @@ __maintainer__ = "Tsuyoshi Hombashi" __maintainer_email__ = "tsuyoshi.hombashi@gmail.com" __license__ = "MIT License" -__version__ = "2.5.0" +__version__ = "2.5.1" From b5757869e1ff09ae33dca9a45431bed814d84856 Mon Sep 17 00:00:00 2001 From: Tsuyoshi Hombashi Date: Sat, 8 Jul 2023 18:08:41 +0900 Subject: [PATCH 39/40] Fix release target --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 62fffbd..051174a 100644 --- a/Makefile +++ b/Makefile @@ -35,8 +35,8 @@ fmt: .PHONY: release release: - @cd $(PKG_BUILD_DIR) && @$(PYTHON) setup.py release --verbose - @$(MAKE) clean + cd $(PKG_BUILD_DIR) && $(PYTHON) setup.py release --verbose + $(MAKE) clean .PHONY: setup-ci setup-ci: From 415a2d2c17196e3ace30f4eced8d3bf69b093c7e Mon Sep 17 00:00:00 2001 From: Tsuyoshi Hombashi Date: Sat, 8 Jul 2023 18:12:11 +0900 Subject: [PATCH 40/40] Update testenv:lint --- tox.ini | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index 0f7aa80..f8d1c0c 100644 --- a/tox.ini +++ b/tox.ini @@ -52,8 +52,10 @@ commands = [testenv:lint] skip_install = true deps = - codespell - pylama + black>=23.1 + codespell>=2 + pylama>=8.4.1 commands = + black --check setup.py examples tests allpairspy codespell allpairspy examples tests -q2 --check-filenames pylama