Skip to content

Commit

Permalink
make sure uv is optional
Browse files Browse the repository at this point in the history
  • Loading branch information
fabi1cazenave committed Nov 26, 2024
1 parent ede4e49 commit 891c161
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 33 deletions.
34 changes: 29 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,59 @@

PYTHON3?=python3

UV := $(shell command -v uv 2> /dev/null)

all: format lint test

dev: ## Install a development environment
# $(PYTHON3) -m pip install --user --upgrade -e .[dev]
ifndef UV
$(PYTHON3) -m pip install --user --upgrade -e .[dev]
else
uv pip install --upgrade -e .[dev]
endif

format: ## Format sources
ifndef UV
ruff format kalamine
ruff check --fix kalamine
else
uv run ruff format kalamine
uv run ruff check --fix kalamine
endif

lint: ## Lint sources
ifndef UV
ruff format --check kalamine
ruff check kalamine
mypy kalamine
else
uv run ruff format --check kalamine
uv run ruff check kalamine
uv run mypy kalamine
endif

test: ## Run tests
# $(PYTHON3) -m kalamine.cli guide > docs/README.md
# $(PYTHON3) -m kalamine.cli build layouts/*.toml
# $(PYTHON3) -m pytest
ifndef UV
$(PYTHON3) -m kalamine.cli guide > docs/README.md
$(PYTHON3) -m kalamine.cli build layouts/*.toml
$(PYTHON3) -m pytest
else
uv run kalamine guide > docs/README.md
uv run kalamine build layouts/*.toml
uv run pytest
endif

publish: test ## Publish package
rm -rf dist
# $(PYTHON3) -m build
ifndef UV
$(PYTHON3) -m build
twine check dist/*
twine upload dist/*
else
uv build
uv run twine check dist/*
uv run twine upload dist/*
endif

clean: ## Clean sources
rm -rf build
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ dependencies = [

[project.optional-dependencies]
dev = [
"uv",
"pytest",
"lxml",
"mypy>=1.13.0",
Expand Down
27 changes: 0 additions & 27 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 891c161

Please sign in to comment.