Skip to content

Commit 4778e2c

Browse files
authored
Merge pull request #1 from Vectorworks/feature/move-to-pyproject
[SD-7864] (config) Move to pyproject.toml, remove setup.py, setup.cfg and tox.ini
2 parents a665100 + 26c30a9 commit 4778e2c

10 files changed

Lines changed: 121 additions & 123 deletions

File tree

.github/workflows/tox_runner.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ jobs:
1919
uses: actions/setup-python@v4
2020
with:
2121
python-version: '3.10'
22+
2223
- name: Set up Python 3.11
2324
uses: actions/setup-python@v4
2425
with:
@@ -30,13 +31,13 @@ jobs:
3031
- name: Install dependencies
3132
run: |
3233
python -m pip install --upgrade pip
33-
pip install -r requirements.txt
34+
pip install `grep 'tox==' < requirements-dev.txt`
3435
3536
- name: Cache tox environments
3637
uses: actions/cache@v3
3738
with:
3839
path: .tox
39-
key: ${{ runner.os }}-tox-${{ hashFiles('**/requirements.txt') }}-${{ hashFiles('**/tox.ini') }}-${{ hashFiles('**/setup.cfg') }}
40+
key: ${{ runner.os }}-tox-${{ hashFiles('**/requirements-dev.txt') }}-${{ hashFiles('**/pyproject.toml') }}
4041

4142
- name: Run tox on the repo
4243
run: |

.travis.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
language: python
22
python:
3-
- "3.6"
4-
- "3.7"
5-
- "3.8"
6-
- "3.9"
3+
- "3.10"
4+
- "3.11"
75
install:
8-
- pip install -r requirements.txt
6+
- pip install -r requirements-dev.txt
97
script:
108
- pytest --cov-report term --cov=taskflow
119

README.md

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,34 @@
11
# taskflow
22

3+
## Install
4+
In the project root, run:
5+
6+
```bash
7+
pip install .
8+
```
9+
or
10+
```bash
11+
pip install taskflow
12+
```
13+
or add this to your `requirements.txt` file:
14+
15+
`taskflow @ git+ssh://git@github.com/Vectorworks/taskflow.git@v{tag}`
16+
17+
## Development
18+
If you are using a virtual environment, make sure to activate it before running the following commands.
19+
20+
To run tox locally you need only the dev requirements, which can be installed with:
21+
22+
```bash
23+
pip install -e .[dev]
24+
```
25+
or
26+
27+
```bash
28+
pip install -r requirements-dev.txt
29+
```
30+
31+
332
[![Build Status](https://travis-ci.com/Vectorworks/taskflow.svg?branch=master)](https://travis-ci.com/Vectorworks/taskflow)
433

534
taskflow is a simple workflow library, designed to be easily extended to support asynchronous distributed execution.
@@ -34,4 +63,4 @@ flow = Flow(
3463
flow.run()
3564

3665
35
37-
```
66+
```

pyproject.toml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
[build-system]
2+
requires = ["setuptools>=80.3.1"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "taskflow"
7+
dynamic = ["version", "optional-dependencies"]
8+
urls = {"homepage" = "https://git@github.com/Vectorworks/taskflow.git"}
9+
description = "A simple workflow library."
10+
readme = "README.md"
11+
requires-python = ">=3.9"
12+
13+
[tool.setuptools.dynamic]
14+
version = {attr = "taskflow.__version__"}
15+
optional-dependencies = { dev = { file = ["requirements-dev.txt"] } }
16+
17+
[tool.setuptools.packages.find]
18+
where = ["."]
19+
20+
[tool.setuptools.package-data]
21+
taskflow = ["**/*"]
22+
23+
[tool.pytest.ini_options]
24+
testpaths = ["taskflow/tests"]
25+
26+
[tool.flake8]
27+
exclude = [".cache", ".git", ".tox", ".vscode"]
28+
max-line-length = 120
29+
30+
[tool.isort]
31+
skip = [".cache", ".git", ".tox", ".vscode"]
32+
indent = 4
33+
line_length = 120
34+
multi_line_output = 2
35+
combine_as_imports = true
36+
include_trailing_comma = true
37+
default_section = "THIRDPARTY"
38+
known_libraries = []
39+
known_first_party = ["taskflow"]
40+
sections = ["FUTURE", "STDLIB", "THIRDPARTY", "LIBRARIES", "FIRSTPARTY", "LOCALFOLDER"]
41+
42+
[tool.tox]
43+
envlist = ["py310-django32", "py310-django42", "py311-django42", "lint", "isort"]
44+
skip_missing_interpreters = true
45+
46+
[tool.tox.env.default]
47+
recreate = false
48+
alwayscopy = true
49+
usedevelop = false
50+
setenv = {PYTHONPATH = "{toxinidir}"}
51+
changedir = "{toxinidir}"
52+
53+
[tool.tox.env.py310-django32]
54+
extras = ["dev"]
55+
deps = ["django>=3.2,<4.0"]
56+
basepython = ["python3.10"]
57+
commands = [["python", "-m", "pytest"]]
58+
59+
[tool.tox.env.py310-django42]
60+
extras = ["dev"]
61+
deps = ["django>=4.2,<4.3"]
62+
basepython = ["python3.10"]
63+
commands = [["python", "-m", "pytest"]]
64+
65+
[tool.tox.env.py311-django42]
66+
extras = ["dev"]
67+
deps = ["django>=4.2,<4.3"]
68+
basepython = ["python3.11"]
69+
commands = [["python", "-m", "pytest"]]
70+
71+
[tool.tox.env.lint]
72+
extras = ["dev"]
73+
commands = [["python", "-m", "flake8", "taskflow"]]
74+
75+
[tool.tox.env.isort]
76+
extras = ["dev"]
77+
commands = [["python", "-m", "isort", "--check-only", "--diff", "taskflow"]]

requirements-dev.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
flake8==7.2.0
2+
flake8-pyproject==1.2.3
3+
isort==5.13.2
4+
pytest==8.3.5
5+
pytest-cov==6.0.0
6+
pytest-mock==3.14.0
7+
tox==4.26.0

requirements.txt

Lines changed: 0 additions & 5 deletions
This file was deleted.

setup.cfg

Lines changed: 0 additions & 22 deletions
This file was deleted.

setup.py

Lines changed: 0 additions & 58 deletions
This file was deleted.

taskflow/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
__title__ = "Taskflow"
2-
__version__ = "0.2.2"
2+
__version__ = "0.3.0"
33

44
from .flow import * # noqa
55
from .tasks import * # noqa

tox.ini

Lines changed: 0 additions & 29 deletions
This file was deleted.

0 commit comments

Comments
 (0)