Skip to content

Commit 318ebc0

Browse files
author
Fabien Coelho
committed
simplify Makefile and CI by dropping VENV
1 parent 7575873 commit 318ebc0

File tree

4 files changed

+30
-24
lines changed

4 files changed

+30
-24
lines changed

.github/workflows/docs.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ jobs:
1313
- name: Set up Python
1414
uses: actions/setup-python@v5
1515
- name: Install dependencies
16-
run: make VENV= venv.update
16+
run: make dev
1717
- name: Check documentation syntax
18-
run: make VENV= check.docs
18+
run: make check.docs
1919
- name: Generate documentation
20-
run: make VENV= docs
20+
run: make docs
2121
- name: Upload to GitHub Pages
2222
uses: actions/upload-pages-artifact@v3
2323
# NOTE separate jobs because this one requires authn data

.github/workflows/package.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@ jobs:
2929
allow-prereleases: true
3030
cache: "pip"
3131
- name: Install Python Dependencies
32-
run: make VENV= venv
32+
run: make venv
3333
- name: Check with pyright
34-
run: make VENV= check.pyright
34+
run: make check.pyright
3535
- name: Check with ruff
36-
run: make VENV= check.ruff
36+
run: make check.ruff
3737
- name: Check with pytest
38-
run: make VENV= check.pytest
38+
run: make check.pytest
3939
- name: Check with coverage
40-
run: make VENV= check.coverage
40+
run: make check.coverage
4141
- name: Check with pymarkdown
42-
run: make VENV= check.docs
42+
run: make check.docs

Makefile

+20-13
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ SHELL = /bin/bash
44
.ONESHELL:
55

66
MODULE = FlaskTester
7-
VENV = venv
87

98
F.md = $(wildcard *.md)
109
F.pdf = $(F.md:%.md=%.pdf)
@@ -15,40 +14,40 @@ PYTHON = python
1514

1615
.PHONY: check.mypy
1716
check.mypy: venv
18-
[ "$(VENV)" ] && source $(VENV)/bin/activate
17+
source venv/bin/activate
1918
mypy --implicit-optional --check-untyped-defs $(MODULE).py
2019

2120
.PHONY: check.pyright
2221
check.pyright: venv
23-
[ "$(VENV)" ] && source $(VENV)/bin/activate
22+
source venv/bin/activate
2423
pyright $(MODULE).py
2524

2625
# E127,W504
2726
.PHONY: check.ruff
2827
check.ruff: venv
29-
[ "$(VENV)" ] && source $(VENV)/bin/activate
28+
source venv/bin/activate
3029
ruff check --ignore=E227,E402,E501,E721,F401,F811 $(MODULE).py
3130

3231
.PHONY: check.pytest
3332
check.pytest: venv
34-
[ "$(VENV)" ] && source $(VENV)/bin/activate
33+
source venv/bin/activate
3534
$(MAKE) -C tests check
3635

3736
.PHONY: check.coverage
3837
check.coverage: venv
39-
[ "$(VENV)" ] && source $(VENV)/bin/activate
38+
source venv/bin/activate
4039
$(MAKE) -C tests check.coverage
4140

4241
# MD013: line length
4342
.PHONY: check.docs
4443
check.docs:
45-
[ "$(VENV)" ] && source $(VENV)/bin/activate
44+
source venv/bin/activate
4645
pymarkdown -d MD013 scan *.md
4746
sphinx-lint docs/
4847

4948
.PHONY: check
5049
check: venv
51-
[ "$(VENV)" ] && source $(VENV)/bin/activate
50+
source venv/bin/activate
5251
type $(PYTHON)
5352
$(MAKE) check.mypy
5453
$(MAKE) check.pyright
@@ -59,7 +58,7 @@ check: venv
5958

6059
.PHONY: docs
6160
docs: venv
62-
[ "$(VENV)" ] && source $(VENV)/bin/activate
61+
source venv/bin/activate
6362
$(MAKE) -C docs html
6463
find docs/_build -type d -print0 | xargs -0 chmod a+rx
6564
find docs/_build -type f -print0 | xargs -0 chmod a+r
@@ -84,7 +83,7 @@ dev: venv
8483

8584
.PHONY: venv.update
8685
venv.update:
87-
[ "$(VENV)" ] && source $(VENV)/bin/activate
86+
source venv/bin/activate
8887
pip install -U pip
8988
pip install -e .[dev,doc]
9089

@@ -94,12 +93,20 @@ venv:
9493
$(MAKE) venv.update
9594

9695
$(MODULE).egg-info: venv
97-
[ "$(VENV)" ] && source $(VENV)/bin/activate
96+
source venv/bin/activate
9897
pip install -e .
9998

99+
.PHONY: pub
100+
pub: venv/.pub
101+
102+
venv/.pub: venv
103+
source venv/bin/activate
104+
pip install -e .[pub]
105+
touch $@
106+
100107
# generate source and built distribution
101-
dist: venv
102-
[ "$(VENV)" ] && source $(VENV)/bin/activate
108+
dist: pub
109+
source venv/bin/activate
103110
$(PYTHON) -m build
104111

105112
.PHONY: publish

pyproject.toml

+1-2
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,12 @@ package = "https://pypi.org/project/FlaskTester/"
3535
dev = [
3636
# static checks…
3737
"mypy", "pyright", "ruff", "coverage", "pymarkdownlnt!=0.9.5",
38-
# packaging
39-
"build", "twine", "wheel",
4038
# tests
4139
"types-flask", "types-requests", "FlaskSimpleAuth>=33.0", "bcrypt", "pydantic"
4240
]
4341
# documentation generation
4442
doc = ["sphinx", "sphinx_rtd_theme", "sphinx-autoapi", "sphinx-lint", "myst_parser"]
43+
pub = ["build", "twine", "wheel"]
4544

4645
[tool.setuptools]
4746
py-modules = [ "FlaskTester" ]

0 commit comments

Comments
 (0)