Skip to content

Commit

Permalink
update Makefile and pre-commit config
Browse files Browse the repository at this point in the history
  • Loading branch information
tschm committed Dec 31, 2024
1 parent cef9115 commit 6978d7a
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 18 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ figures

.idea
.vscode
.python-version

# all .DS_Store files
**/.DS_Store
Expand Down
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.12
29 changes: 17 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,30 +1,35 @@
.DEFAULT_GOAL := help

VENV :=.venv
venv:
@curl -LsSf https://astral.sh/uv/install.sh | sh
@uv venv


.PHONY: install
install: ## Install a virtual environment
python -m venv ${VENV}
${VENV}/bin/pip install --upgrade pip
${VENV}/bin/pip install -r requirements.txt
install: venv ## Install a virtual environment
@uv pip install --upgrade pip
@uv pip install -r requirements.txt


.PHONY: fmt
fmt: venv ## Run autoformatting and linting
@uv pip install pre-commit
@uv run pre-commit install
@uv run pre-commit run --all-files


.PHONY: freeze
freeze: install ## Freeze all requirements
${VENV}/bin/pip freeze > requirements_frozen.txt
@uv pip freeze > requirements_frozen.txt

.PHONY: fmt
fmt: install ## Run autoformatting and linting
${VENV}/bin/pip install pre-commit
${VENV}/bin/pre-commit install
${VENV}/bin/pre-commit run --all-files

.PHONY: clean
clean: ## Clean up caches and build artifacts
@git clean -X -d -f

.PHONY: experiments
experiments: install ## Run all experiment
${VENV}/bin/python experiments.py
@uv run python experiments.py

.PHONY: help
help: ## Display this help screen
Expand Down
9 changes: 4 additions & 5 deletions requirements_frozen.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,19 @@ clarabel==0.9.0
contourpy==1.3.1
cvxpy==1.6.0
cycler==0.12.1
ecos==2.0.14
fonttools==4.55.3
Jinja2==3.1.5
jinja2==3.1.5
kiwisolver==1.4.8
loguru==0.7.3
MarkupSafe==3.0.2
markupsafe==3.0.2
matplotlib==3.10.0
Mosek==10.2.11
mosek==10.2.11
numpy==2.2.1
osqp==0.6.7.post3
packaging==24.2
pandas==2.2.3
pillow==11.0.0
pybind11==2.13.6
pip==24.3.1
pyparsing==3.2.0
python-dateutil==2.9.0.post0
pytz==2024.2
Expand Down

0 comments on commit 6978d7a

Please sign in to comment.