Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to uv #30

Open
ipmb opened this issue Apr 19, 2024 · 0 comments
Open

Switch to uv #30

ipmb opened this issue Apr 19, 2024 · 0 comments

Comments

@ipmb
Copy link
Member

ipmb commented Apr 19, 2024

Maybe something like this in the Makefile:

BASE_PIP_COMPILE_ARGS=--python-version 3.12 --generate-hashes pyproject.toml
PIP_COMPILE_ARGS=--output-file=requirements.txt $(BASE_PIP_COMPILE_ARGS)
DEV_PIP_COMPILE_ARGS=--output-file=requirements-dev.txt --extra dev $(BASE_PIP_COMPILE_ARGS)

.venv/bin/activate:  ## Create a new virtual environment
	uv venv --python 3.12 --seed

requirements.txt: pyproject.toml  ## Generate requirements.txt from pyproject.toml
	uv pip compile $(PIP_COMPILE_ARGS)

requirements-dev.txt: requirements.txt pyproject.toml  ## Generate requirements-dev.txt from pyproject.toml
	uv pip compile $(DEV_PIP_COMPILE_ARGS)

.PHONY: lock
lock: requirements.txt requirements-dev.txt  ## Lock dependencies

.PHONY: install
install: .venv/bin/activate  ## Install dev dependencies
	uv pip sync --require-hashes requirements-dev.txt

.PHONY: upgrade-requirements
upgrade-requirements:  ## Upgrade all dependencies in requirements.txt and requirements-dev.txt
	uv pip compile --upgrade $(PIP_COMPILE_ARGS)
	uv pip compile --upgrade $(DEV_PIP_COMPILE_ARGS)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant