Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 7 additions & 30 deletions .github/workflows/tox_runner.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Run tox (tests & linting)
name: Test workflow

on:
push:
Expand All @@ -9,35 +9,12 @@ on:
- '**'

jobs:
tox:
name: Run tox
test:
name: Check connection
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.txt

- name: Cache tox environments
uses: actions/cache@v3
with:
path: .tox
key: ${{ runner.os }}-tox-${{ hashFiles('**/requirements.txt') }}-${{ hashFiles('**/tox.ini') }}-${{ hashFiles('**/setup.cfg') }}
- name: Checkout code
uses: actions/checkout@v3

- name: Run tox on the repo
run: |
tox
- name: Echo hello
run: echo "Hello, world!"
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ python:
- "3.8"
- "3.9"
install:
- pip install -r requirements.txt
- pip install -r requirements-dev.txt
script:
- pytest --cov-report term --cov=taskflow

31 changes: 30 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -34,4 +63,4 @@ flow = Flow(
flow.run()

35
```
```
61 changes: 61 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
[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.pytest.ini_options]
testpaths = ["taskflow/tests"]

[tool.flake8]
exclude = [".cache", ".git", ".tox", ".vscode"]
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"]]
5 changes: 4 additions & 1 deletion requirements.txt → requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
22 changes: 0 additions & 22 deletions setup.cfg

This file was deleted.

58 changes: 0 additions & 58 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,58 +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=[],
)
2 changes: 1 addition & 1 deletion taskflow/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
__title__ = "Taskflow"
__version__ = "0.2.2"
__version__ = "0.3.0"

from .flow import * # noqa
from .tasks import * # noqa
29 changes: 0 additions & 29 deletions tox.ini

This file was deleted.