Skip to content

Commit 9642da9

Browse files
authored
Merge pull request #76 from python-project-templates/tkp/req
Add separate requirements step
2 parents 1cd0e6e + 33f1f03 commit 9642da9

File tree

5 files changed

+45
-7
lines changed

5 files changed

+45
-7
lines changed

js/Makefile.jinja

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,21 @@
55
develop-py:
66
uv pip install -e .[develop]
77

8-
develop-js:
9-
cd js; pnpm install && npx playwright install
8+
develop-js: requirements-js
109

1110
develop: develop-js develop-py ## setup project for development
1211

12+
.PHONY: requirements-py requirements-js requirements
13+
requirements-py: ## install prerequisite python build requirements
14+
python -m pip install --upgrade pip toml
15+
python -m pip install `python -c 'import toml; c = toml.load("pyproject.toml"); print("\n".join(c["build-system"]["requires"]))'`
16+
python -m pip install `python -c 'import toml; c = toml.load("pyproject.toml"); print(" ".join(c["project"]["optional-dependencies"]["develop"]))'`
17+
18+
requirements-js: ## install prerequisite javascript build requirements
19+
cd js; pnpm install && npx playwright install
20+
21+
requirements: requirements-js requirements-py ## setup project for development
22+
1323
.PHONY: build-py build-js build
1424
build-py:
1525
python -m build -w -n

jupyter/Makefile.jinja

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,21 @@
55
develop-py:
66
uv pip install -e .[develop]
77

8-
develop-js:
9-
cd js; pnpm install
8+
develop-js: requirements-js
109

1110
develop: develop-js develop-py ## setup project for development
1211

12+
.PHONY: requirements-py requirements-js requirements
13+
requirements-py: ## install prerequisite python build requirements
14+
python -m pip install --upgrade pip toml
15+
python -m pip install `python -c 'import toml; c = toml.load("pyproject.toml"); print("\n".join(c["build-system"]["requires"]))'`
16+
python -m pip install `python -c 'import toml; c = toml.load("pyproject.toml"); print(" ".join(c["project"]["optional-dependencies"]["develop"]))'`
17+
18+
requirements-js: ## install prerequisite javascript build requirements
19+
cd js; pnpm install && npx playwright install
20+
21+
requirements: requirements-js requirements-py ## setup project for development
22+
1323
.PHONY: build-py build-js build
1424
build-py:
1525
python -m build -w -n

python/Makefile.jinja

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66
develop: ## install dependencies and build library
77
uv pip install -e .[develop]
88

9+
requirements: ## install prerequisite python build requirements
10+
python -m pip install --upgrade pip toml
11+
python -m pip install `python -c 'import toml; c = toml.load("pyproject.toml"); print("\n".join(c["build-system"]["requires"]))'`
12+
python -m pip install `python -c 'import toml; c = toml.load("pyproject.toml"); print(" ".join(c["project"]["optional-dependencies"]["develop"]))'`
13+
914
build: ## build the python library
1015
python -m build -n
1116

rust/Makefile.jinja

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,17 @@ develop-rs:
1010

1111
develop: develop-rs develop-py ## setup project for development
1212

13+
.PHONY: requirements-py requirements-rs requirements
14+
requirements-py: ## install prerequisite python build requirements
15+
python -m pip install --upgrade pip toml
16+
python -m pip install `python -c 'import toml; c = toml.load("pyproject.toml"); print("\n".join(c["build-system"]["requires"]))'`
17+
python -m pip install `python -c 'import toml; c = toml.load("pyproject.toml"); print(" ".join(c["project"]["optional-dependencies"]["develop"]))'`
18+
19+
requirements-rs: ## install prerequisite rust build requirements
20+
make -C rust requirements
21+
22+
requirements: requirements-rs requirements-py ## setup project for development
23+
1324
.PHONY: build-py build-rs build dev
1425
build-py:
1526
maturin build

rust/rust/Makefile.jinja

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

2-
.PHONY: develop build
3-
develop: ## install required dev dependencies
2+
.PHONY: requirements develop build
3+
requirements: ## install required dev dependencies
44
rustup component add rustfmt
55
rustup component add clippy
6-
cargo install cargo-nextest
6+
cargo install cargo-nextest
77
cargo install cargo-llvm-cov
88

9+
develop: requirements ## install required dev dependencies
10+
911
build: ## build release
1012
cargo build --release --all-features
1113

0 commit comments

Comments
 (0)