From 189b5014faf45766cccd6cbed759d5b706089160 Mon Sep 17 00:00:00 2001 From: elikaykova Date: Tue, 3 Jun 2025 13:16:56 +0300 Subject: [PATCH 01/11] (config) Move to pyproject.toml, remove setup.py, setup.cfg and tox.ini --- .github/workflows/tox_runner.yml | 2 +- .travis.yml | 2 +- pyproject.toml | 65 ++++++++++++++++++++++++ requirements.txt => requirements-dev.txt | 5 +- setup.cfg | 22 -------- setup.py | 57 --------------------- tox.ini | 29 ----------- 7 files changed, 71 insertions(+), 111 deletions(-) create mode 100644 pyproject.toml rename requirements.txt => requirements-dev.txt (52%) delete mode 100644 setup.cfg delete mode 100644 setup.py delete mode 100644 tox.ini diff --git a/.github/workflows/tox_runner.yml b/.github/workflows/tox_runner.yml index 8c53649..48f39f0 100644 --- a/.github/workflows/tox_runner.yml +++ b/.github/workflows/tox_runner.yml @@ -36,7 +36,7 @@ jobs: uses: actions/cache@v3 with: path: .tox - key: ${{ runner.os }}-tox-${{ hashFiles('**/requirements.txt') }}-${{ hashFiles('**/tox.ini') }}-${{ hashFiles('**/setup.cfg') }} + key: ${{ runner.os }}-tox-${{ hashFiles('**/requirements-dev.txt') }}-${{ hashFiles('**/pyproject.toml') }} - name: Run tox on the repo run: | diff --git a/.travis.yml b/.travis.yml index 5895d95..3af02d1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,7 @@ python: - "3.8" - "3.9" install: - - pip install -r requirements.txt + - pip install -r requirements-dev.txt script: - pytest --cov-report term --cov=taskflow diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..c96f004 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,65 @@ +[build-system] +requires = ["setuptools>=80.3.1"] +build-backend = "setuptools.build_meta" + +[project] +name = "taskflow" +dynamic = ["version", "optional-dependencies"] +urls = {"homepage" = "https://git@github.com/Vectorworks/taskflow.git"} +description = "A simple workflow library." +readme = "README.md" +requires-python = ">=3.9" +dependencies = [] + +[tool.setuptools.dynamic] +version = {attr = "taskflow.__version__"} +optional-dependencies = { dev = { file = ["requirements-dev.txt"] } } + +[tool.setuptools.packages.find] +where = ["."] + +[tool.setuptools.package-data] +taskflow = ["**/*"] + +[tool.flake8] +exclude = [".cache",".git",".tox",".vscode"] +max-line-length = 120 + +[tool.pylint] +exclude = [".cache", ".git", ".tox", ".vscode"] +max-line-length = 120 + +[tool.pycodestyle] +max-line-length = 120 + +[tool.isort] +skip = [".cache", ".git", ".tox", ".vscode"] +indent = 4 +line_length = 120 +multi_line_output = 2 +combine_as_imports = true +include_trailing_comma = true +default_section = "THIRDPARTY" +known_libraries = [] +known_first_party = ["taskflow"] +sections = ["FUTURE", "STDLIB", "THIRDPARTY", "LIBRARIES", "FIRSTPARTY", "LOCALFOLDER"] + +[tool.tox] +envlist = ["py39", "py310", "py311", "py312", "lint", "isort"] +isolated_build = true +skip_missing_interpreters = true + +[tool.tox.env.default] +recreate = false +alwayscopy = true +extras = ["dev"] +setenv = {PYTHONPATH = "{toxinidir}"} +commands = ["py.test -v"] + +[tool.tox.env.lint] +extras = ["dev"] +commands = [["python", "-m", "flake8", "taskflow"]] + +[tool.tox.env.isort] +extras = ["dev"] +commands = [["python", "-m", "isort", "--check-only", "--diff", "taskflow"]] diff --git a/requirements.txt b/requirements-dev.txt similarity index 52% rename from requirements.txt rename to requirements-dev.txt index e9b6f1b..97e6a88 100644 --- a/requirements.txt +++ b/requirements-dev.txt @@ -2,4 +2,7 @@ pytest==8.3.5 pytest-cov==6.0.0 pytest-mock==3.14.0 -tox==4.15.0 +tox==4.26.0 +flake8-pyproject==1.2.3 +flake8==7.2.0 +isort==5.13.2 diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index d2857aa..0000000 --- a/setup.cfg +++ /dev/null @@ -1,22 +0,0 @@ -[tool:pytest] - -[flake8] -exclude = .cache,.git,.tox,.vscode -max-line-length = 120 - -[pylint] -exclude = .cache,.git,.tox,.vscode -max-line-length = 120 - -[pycodestyle] -max-line-length = 120 - -[isort] -skip = .cache,.git,.tox,.vscode -indent = 4 -line_length = 120 -multi_line_output = 2 -combine_as_imports = true -default_section = THIRDPARTY -include_trailing_comma = true -sections = FUTURE,STDLIB,THIRDPARTY,LIBRARIES,FIRSTPARTY,LOCALFOLDER diff --git a/setup.py b/setup.py deleted file mode 100644 index 730e56d..0000000 --- a/setup.py +++ /dev/null @@ -1,57 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -import os -import re -from io import open - -from setuptools import setup - - -def get_version(package): - """ - Return package version as listed in `__version__` in `init.py`. - """ - init_py = open(os.path.join(package, '__init__.py')).read() - return re.search("__version__ = ['\"]([^'\"]+)['\"]", init_py).group(1) - - -def get_packages(package): - """ - Return root package and all sub-packages. - """ - return [dirpath - for dirpath, dirnames, filenames in os.walk(package) - if os.path.exists(os.path.join(dirpath, '__init__.py'))] - - -def get_package_data(package): - """ - Return all files under the root package, that are not in a - package themselves. - """ - walk = [(dirpath.replace(package + os.sep, '', 1), filenames) - for dirpath, dirnames, filenames in os.walk(package) - if not os.path.exists(os.path.join(dirpath, '__init__.py'))] - - filepaths = [] - for base, filenames in walk: - filepaths.extend([os.path.join(base, filename) - for filename in filenames]) - return {package: filepaths} - - -version = get_version('taskflow') - - -setup( - name='taskflow', - version=version, - url='https://git@github.com/Vectorworks/taskflow.git', - description='A simple workflow library.', - packages=get_packages('taskflow'), - package_data=get_package_data('taskflow'), - install_requires=[ - ], - dependency_links=[ - ] -) diff --git a/tox.ini b/tox.ini deleted file mode 100644 index 2f80615..0000000 --- a/tox.ini +++ /dev/null @@ -1,29 +0,0 @@ -[tox] -envlist = - py39, py310, py311, py312 - lint - isort - -[testenv] -recreate = false -alwayscopy = true -deps = - pytest==8.3.5 - pytest-cov==6.0.0 - pytest-mock==3.14.0 -setenv = - PYTHONPATH={toxinidir} -commands = - py.test -v - -[testenv:lint] -deps = - flake8==7.0.0 -commands = - flake8 taskflow - -[testenv:isort] -deps = - isort==5.13.2 -commands = - isort --check-only --diff taskflow From 7fc2b2c392f8bf5af40136cab380bb744a448a91 Mon Sep 17 00:00:00 2001 From: elikaykova Date: Tue, 3 Jun 2025 18:20:55 +0300 Subject: [PATCH 02/11] (config) pyproject.toml: fix tox_runner --- .github/workflows/tox_runner.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tox_runner.yml b/.github/workflows/tox_runner.yml index 48f39f0..7c051c3 100644 --- a/.github/workflows/tox_runner.yml +++ b/.github/workflows/tox_runner.yml @@ -30,7 +30,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install -r requirements.txt + pip install -r requirements-dev.txt - name: Cache tox environments uses: actions/cache@v3 From 27d9341a4a5303d36f2fe2ad8b1e634541d00a87 Mon Sep 17 00:00:00 2001 From: elikaykova Date: Tue, 10 Jun 2025 18:03:13 +0300 Subject: [PATCH 03/11] (config) Remove old style sections. Add ini_options. --- pyproject.toml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index c96f004..8b0d17b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,17 +21,13 @@ where = ["."] [tool.setuptools.package-data] taskflow = ["**/*"] -[tool.flake8] -exclude = [".cache",".git",".tox",".vscode"] -max-line-length = 120 +[tool.pytest.ini_options] +testpaths = ["taskflow/tests"] -[tool.pylint] +[tool.flake8] exclude = [".cache", ".git", ".tox", ".vscode"] max-line-length = 120 -[tool.pycodestyle] -max-line-length = 120 - [tool.isort] skip = [".cache", ".git", ".tox", ".vscode"] indent = 4 From 50c0b0a6060346e8e2fec1013c05271016231c2b Mon Sep 17 00:00:00 2001 From: elikaykova Date: Tue, 10 Jun 2025 18:31:33 +0300 Subject: [PATCH 04/11] Update readme. --- README.md | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1301256..0348781 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,34 @@ # taskflow +## Install +In the project root, run: + +```bash +pip install . +``` +or +```bash +pip install taskflow +``` +or add this to your `requirements.txt` file: + +`taskflow @ git+ssh://git@github.com/Vectorworks/taskflow.git@v{tag}` + +## Development +If you are using a virtual environment, make sure to activate it before running the following commands. + +To run tox locally you need only the dev requirements, which can be installed with: + +```bash +pip install -e .[dev] +``` +or + +```bash +pip install -r requirements-dev.txt +``` + + [![Build Status](https://travis-ci.com/Vectorworks/taskflow.svg?branch=master)](https://travis-ci.com/Vectorworks/taskflow) taskflow is a simple workflow library, designed to be easily extended to support asynchronous distributed execution. @@ -34,4 +63,4 @@ flow = Flow( flow.run() 35 -``` \ No newline at end of file +``` From 5548b0d254adaf8d1404cfaff622eba74aeab2fd Mon Sep 17 00:00:00 2001 From: elikaykova Date: Tue, 10 Jun 2025 18:32:15 +0300 Subject: [PATCH 05/11] Bump library version: 0.3.0. --- taskflow/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/taskflow/__init__.py b/taskflow/__init__.py index ed5fd53..e447e1e 100644 --- a/taskflow/__init__.py +++ b/taskflow/__init__.py @@ -1,5 +1,5 @@ -__title__ = 'Taskflow' -__version__ = '0.2.0' +__title__ = "Taskflow" +__version__ = "0.3.0" from .flow import * # noqa from .tasks import * # noqa From ccbb43e84292c3313f7377d074cfe788b17182f7 Mon Sep 17 00:00:00 2001 From: ppbonchev Date: Mon, 3 Nov 2025 16:20:57 +0200 Subject: [PATCH 06/11] Improve workflow consistency and speed --- .github/workflows/tox_runner.yml | 3 ++- .travis.yml | 6 ++---- pyproject.toml | 23 ++++++++++++++++++++--- requirements-dev.txt | 9 ++++++--- 4 files changed, 30 insertions(+), 11 deletions(-) diff --git a/.github/workflows/tox_runner.yml b/.github/workflows/tox_runner.yml index 7c051c3..922002b 100644 --- a/.github/workflows/tox_runner.yml +++ b/.github/workflows/tox_runner.yml @@ -19,6 +19,7 @@ jobs: uses: actions/setup-python@v4 with: python-version: '3.10' + - name: Set up Python 3.11 uses: actions/setup-python@v4 with: @@ -30,7 +31,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install -r requirements-dev.txt + pip install `grep 'tox==' < requirements-dev.txt` - name: Cache tox environments uses: actions/cache@v3 diff --git a/.travis.yml b/.travis.yml index 3af02d1..685cd3f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,9 +1,7 @@ language: python python: - - "3.6" - - "3.7" - - "3.8" - - "3.9" + - "3.10" + - "3.11" install: - pip install -r requirements-dev.txt script: diff --git a/pyproject.toml b/pyproject.toml index 8b0d17b..fa5ef2d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,6 @@ urls = {"homepage" = "https://git@github.com/Vectorworks/taskflow.git"} description = "A simple workflow library." readme = "README.md" requires-python = ">=3.9" -dependencies = [] [tool.setuptools.dynamic] version = {attr = "taskflow.__version__"} @@ -48,9 +47,27 @@ skip_missing_interpreters = true [tool.tox.env.default] recreate = false alwayscopy = true -extras = ["dev"] +usedevelop = false setenv = {PYTHONPATH = "{toxinidir}"} -commands = ["py.test -v"] +changedir = "{toxinidir}" + +[tool.tox.env.py310-django32] +extras = ["dev"] +deps = ["django>=3.2,<4.0"] +basepython = ["python3.10"] +commands = [["python", "-m", "pytest"]] + +[tool.tox.env.py310-django42] +extras = ["dev"] +deps = ["django>=4.2,<4.3"] +basepython = ["python3.10"] +commands = [["python", "-m", "pytest"]] + +[tool.tox.env.py311-django42] +extras = ["dev"] +deps = ["django>=4.2,<4.3"] +basepython = ["python3.11"] +commands = [["python", "-m", "pytest"]] [tool.tox.env.lint] extras = ["dev"] diff --git a/requirements-dev.txt b/requirements-dev.txt index 97e6a88..3e21977 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,8 +1,11 @@ -# dev dependencies +# test pytest==8.3.5 pytest-cov==6.0.0 pytest-mock==3.14.0 -tox==4.26.0 -flake8-pyproject==1.2.3 + +# codestyle flake8==7.2.0 +flake8-pyproject==1.2.3 isort==5.13.2 + +tox==4.26.0 From 6bb979f29e3cd456070b5bb7b914670c1c92211b Mon Sep 17 00:00:00 2001 From: ppbonchev Date: Mon, 3 Nov 2025 16:42:51 +0200 Subject: [PATCH 07/11] Fix tox configuration --- pyproject.toml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index fa5ef2d..f6e555c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -40,8 +40,7 @@ known_first_party = ["taskflow"] sections = ["FUTURE", "STDLIB", "THIRDPARTY", "LIBRARIES", "FIRSTPARTY", "LOCALFOLDER"] [tool.tox] -envlist = ["py39", "py310", "py311", "py312", "lint", "isort"] -isolated_build = true +envlist = ["py310-django32", "py310-django42", "py311-django42", "lint", "isort"] skip_missing_interpreters = true [tool.tox.env.default] From bbf8fa899353a3635a86f318b1ce6faadf5e3664 Mon Sep 17 00:00:00 2001 From: ppbonchev Date: Tue, 4 Nov 2025 07:29:19 +0200 Subject: [PATCH 08/11] Revert to working workflow --- .github/workflows/tox_runner.yml | 5 ++--- pyproject.toml | 28 ++++++---------------------- 2 files changed, 8 insertions(+), 25 deletions(-) diff --git a/.github/workflows/tox_runner.yml b/.github/workflows/tox_runner.yml index 922002b..5aea2d7 100644 --- a/.github/workflows/tox_runner.yml +++ b/.github/workflows/tox_runner.yml @@ -19,7 +19,6 @@ jobs: uses: actions/setup-python@v4 with: python-version: '3.10' - - name: Set up Python 3.11 uses: actions/setup-python@v4 with: @@ -31,7 +30,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install `grep 'tox==' < requirements-dev.txt` + pip install -r requirements-dev.txt - name: Cache tox environments uses: actions/cache@v3 @@ -41,4 +40,4 @@ jobs: - name: Run tox on the repo run: | - tox + tox \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index f6e555c..4380d32 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,6 +9,7 @@ urls = {"homepage" = "https://git@github.com/Vectorworks/taskflow.git"} description = "A simple workflow library." readme = "README.md" requires-python = ">=3.9" +dependencies = [] [tool.setuptools.dynamic] version = {attr = "taskflow.__version__"} @@ -40,33 +41,16 @@ known_first_party = ["taskflow"] sections = ["FUTURE", "STDLIB", "THIRDPARTY", "LIBRARIES", "FIRSTPARTY", "LOCALFOLDER"] [tool.tox] -envlist = ["py310-django32", "py310-django42", "py311-django42", "lint", "isort"] +envlist = ["py39", "py310", "py311", "py312", "lint", "isort"] +isolated_build = true skip_missing_interpreters = true [tool.tox.env.default] recreate = false alwayscopy = true -usedevelop = false -setenv = {PYTHONPATH = "{toxinidir}"} -changedir = "{toxinidir}" - -[tool.tox.env.py310-django32] -extras = ["dev"] -deps = ["django>=3.2,<4.0"] -basepython = ["python3.10"] -commands = [["python", "-m", "pytest"]] - -[tool.tox.env.py310-django42] extras = ["dev"] -deps = ["django>=4.2,<4.3"] -basepython = ["python3.10"] -commands = [["python", "-m", "pytest"]] - -[tool.tox.env.py311-django42] -extras = ["dev"] -deps = ["django>=4.2,<4.3"] -basepython = ["python3.11"] -commands = [["python", "-m", "pytest"]] +setenv = {PYTHONPATH = "{toxinidir}"} +commands = ["py.test -v"] [tool.tox.env.lint] extras = ["dev"] @@ -74,4 +58,4 @@ commands = [["python", "-m", "flake8", "taskflow"]] [tool.tox.env.isort] extras = ["dev"] -commands = [["python", "-m", "isort", "--check-only", "--diff", "taskflow"]] +commands = [["python", "-m", "isort", "--check-only", "--diff", "taskflow"]] \ No newline at end of file From 947e826b9eb2adf6b9d3afa2cbdd3891cabb1be6 Mon Sep 17 00:00:00 2001 From: ppbonchev Date: Tue, 4 Nov 2025 07:33:13 +0200 Subject: [PATCH 09/11] Revert all changes --- .travis.yml | 7 ++++--- requirements-dev.txt | 11 ++++------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index 685cd3f..2635831 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,9 +1,10 @@ language: python python: - - "3.10" - - "3.11" + - "3.6" + - "3.7" + - "3.8" + - "3.9" install: - pip install -r requirements-dev.txt script: - pytest --cov-report term --cov=taskflow - diff --git a/requirements-dev.txt b/requirements-dev.txt index 3e21977..94bac0a 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,11 +1,8 @@ -# test +# dev dependencies pytest==8.3.5 pytest-cov==6.0.0 pytest-mock==3.14.0 - -# codestyle -flake8==7.2.0 -flake8-pyproject==1.2.3 -isort==5.13.2 - tox==4.26.0 +flake8-pyproject==1.2.3 +flake8==7.2.0 +isort==5.13.2 \ No newline at end of file From 28601eb18397fb5bea5da420e60149a458d64007 Mon Sep 17 00:00:00 2001 From: ppbonchev Date: Tue, 4 Nov 2025 08:00:26 +0200 Subject: [PATCH 10/11] Add workflow job --- .github/workflows/tox_runner.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/tox_runner.yml b/.github/workflows/tox_runner.yml index 5aea2d7..b5822af 100644 --- a/.github/workflows/tox_runner.yml +++ b/.github/workflows/tox_runner.yml @@ -9,6 +9,16 @@ on: - '**' jobs: + test: + name: Check connection + runs-on: ubuntu-24.04 + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Echo hello + run: echo "Hello, world!" + tox: name: Run tox runs-on: ubuntu-24.04 From e67e709a42c08cf4724207689d554bc719c87f98 Mon Sep 17 00:00:00 2001 From: ppbonchev Date: Tue, 4 Nov 2025 08:07:06 +0200 Subject: [PATCH 11/11] Leave only test workflow job --- .github/workflows/tox_runner.yml | 35 +------------------------------- 1 file changed, 1 insertion(+), 34 deletions(-) diff --git a/.github/workflows/tox_runner.yml b/.github/workflows/tox_runner.yml index b5822af..883d92e 100644 --- a/.github/workflows/tox_runner.yml +++ b/.github/workflows/tox_runner.yml @@ -1,4 +1,4 @@ -name: Run tox (tests & linting) +name: Test workflow on: push: @@ -18,36 +18,3 @@ jobs: - name: Echo hello run: echo "Hello, world!" - - tox: - name: Run tox - runs-on: ubuntu-24.04 - timeout-minutes: 10 - - steps: - - name: Set up Python 3.10 - uses: actions/setup-python@v4 - with: - python-version: '3.10' - - name: Set up Python 3.11 - uses: actions/setup-python@v4 - with: - python-version: '3.11' - - - name: Checkout latest version from the repo. - uses: actions/checkout@v3 - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -r requirements-dev.txt - - - name: Cache tox environments - uses: actions/cache@v3 - with: - path: .tox - key: ${{ runner.os }}-tox-${{ hashFiles('**/requirements-dev.txt') }}-${{ hashFiles('**/pyproject.toml') }} - - - name: Run tox on the repo - run: | - tox \ No newline at end of file