From 6978d7a3831b93da291919dd40b5607f301e5b6b Mon Sep 17 00:00:00 2001 From: Thomas Schmelzer Date: Mon, 30 Dec 2024 09:34:38 +0400 Subject: [PATCH] update Makefile and pre-commit config --- .gitignore | 1 - .python-version | 1 + Makefile | 29 +++++++++++++++++------------ requirements_frozen.txt | 9 ++++----- 4 files changed, 22 insertions(+), 18 deletions(-) create mode 100644 .python-version diff --git a/.gitignore b/.gitignore index 187b49c..6a108d4 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,6 @@ figures .idea .vscode -.python-version # all .DS_Store files **/.DS_Store diff --git a/.python-version b/.python-version new file mode 100644 index 0000000..e4fba21 --- /dev/null +++ b/.python-version @@ -0,0 +1 @@ +3.12 diff --git a/Makefile b/Makefile index ae5ded9..ee2952a 100644 --- a/Makefile +++ b/Makefile @@ -1,22 +1,27 @@ .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 @@ -24,7 +29,7 @@ clean: ## Clean up caches and build artifacts .PHONY: experiments experiments: install ## Run all experiment - ${VENV}/bin/python experiments.py + @uv run python experiments.py .PHONY: help help: ## Display this help screen diff --git a/requirements_frozen.txt b/requirements_frozen.txt index d8cab02..2cbcb6e 100644 --- a/requirements_frozen.txt +++ b/requirements_frozen.txt @@ -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