-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
39 lines (31 loc) · 1.01 KB
/
Makefile
File metadata and controls
39 lines (31 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
.PHONY: update-deps test prepare distcheck clean develop update reinstall activate install-python clear-outputs bump
# Update dependencies and generate requirements.txt
update-deps:
pdm update && \
pdm fix && \
pdm export -o requirements.txt --without-hashes --pyproject --prod
# Run formatting, linting, and tests
test:
ruff format && \
ruff check . --fix && \
pdm test
# Build the package
distcheck:
pdm build
# Run tests, update dependencies, and perform distribution check
prepare: test update-deps distcheck clear-outputs
# Install Python 3.11 using pyenv if not already installed
install-python:
@if ! pyenv versions | grep 3.11; then \
echo "Python 3.11 not found. Installing..."; \
pyenv install 3.11; \
fi
# Create a PDM environment in the local folder with package requirements
develop: install-python
pyenv local 3.11 && \
pdm update && \
pdm install
bump:
pdm bump minor
clear-outputs:
find . -name "*.ipynb" -exec ./.venv/bin/jupyter nbconvert --ClearOutputPreprocessor.enabled=True --inplace {} \;