Skip to content

Commit 4aa5380

Browse files
committed
poetry: use poetry instead of setuptools
Time to move forward and use poetry instead of setup.py. Keep the result (wheel, sdist) to be as much close as possible with the output of setup.py. There are some notable changes though: - werkzeug version has been specified as >=2.0.0, which is where it dropped support for python 3.5 and 2. - wheel now contains the tests and other files as well, similar to sdist. These files won't be installed at all, but I haven't found any good way to separate the sdist with wheel in terms of the additional files, and I want to include these in sdist. poetry.lock has been also added. This is primairly to have a reproducible dev environment (eg. mypy, flake8, etc). This will be updated with a bot in the future. Fixes #47
1 parent 8a57b9f commit 4aa5380

10 files changed

Lines changed: 1484 additions & 93 deletions

File tree

.flake8

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[flake8]
2+
max-line-length = 145

.github/workflows/ci.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@ jobs:
1212
uses: actions/setup-python@v1
1313
with:
1414
python-version: '3.8'
15+
- uses: Gr1N/setup-poetry@v7
1516
- name: Bootstrap environment
1617
run: |
17-
make dev
18+
make dev EXTRAS=test
1819
- name: Lint
1920
run: |
2021
make cs mypy
@@ -32,9 +33,10 @@ jobs:
3233
uses: actions/setup-python@v2
3334
with:
3435
python-version: ${{ matrix.python-version }}
36+
- uses: Gr1N/setup-poetry@v7
3537
- name: Bootstrap test environment
3638
run: |
37-
make dev
39+
make dev EXTRAS=test
3840
- name: Test
3941
run: |
4042
make cov

.readthedocs.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# .readthedocs.yaml
2+
# Read the Docs configuration file
3+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
4+
5+
version: 2
6+
7+
build:
8+
os: ubuntu-20.04
9+
tools:
10+
python: "3.9"
11+
12+
sphinx:
13+
configuration: doc/conf.py
14+
15+
python:
16+
install:
17+
- method: pip
18+
path: .
19+
extra_requirements:
20+
- doc

Makefile

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11

2-
PYTHON ?= python3
2+
export POETRY_VIRTUALENVS_IN_PROJECT=true
3+
EXTRAS ?= dev
34

4-
.venv/bin/pip:
5-
${PYTHON} -m venv .venv
6-
.venv/bin/pip3 install --upgrade pip wheel
5+
.venv/.st-venv-completed:
6+
poetry install --verbose --extras $(EXTRAS)
7+
touch .venv/.st-venv-completed
78

89
.PHONY: venv
9-
venv: .venv/bin/pip
10+
venv: .venv/.st-venv-completed
1011

1112
.PHONY: dev
1213
dev: venv
13-
.venv/bin/pip3 install -e .[dev]
1414

1515
.PHONY: cs
1616
cs: venv
@@ -30,17 +30,13 @@ mrproper: clean
3030

3131
.PHONY: clean
3232
clean: cov-clean doc-clean
33-
rm -rf .venv *.egg-info build .eggs __pycache__ */__pycache__ .tox
33+
rm -rf .venv *.egg-info build .eggs __pycache__ */__pycache__ .tox poetry.lock
3434

35-
.PHONY: quick-test
36-
quick-test:
35+
.PHONY: test
36+
test: venv
3737
.venv/bin/pytest tests -s -vv
3838
.venv/bin/pytest tests -s -vv --ssl
3939

40-
.PHONY: test
41-
test:
42-
tox
43-
4440
.PHONY: test-pdb
4541
test-pdb:
4642
.venv/bin/pytest tests -s -vv --pdb

0 commit comments

Comments
 (0)