Skip to content

Commit

Permalink
uv + uv.lock (#200)
Browse files Browse the repository at this point in the history
  • Loading branch information
fabi1cazenave authored Dec 9, 2024
1 parent 272f9eb commit 40b0907
Show file tree
Hide file tree
Showing 3 changed files with 977 additions and 7 deletions.
33 changes: 30 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,59 @@

PYTHON3?=python3

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

all: format lint test

dev: ## Install a development environment
ifndef UV
$(PYTHON3) -m pip install --user --upgrade -e .[dev]
# $(PYTHON3) -m pip install --user --upgrade build
# $(PYTHON3) -m pip install --user --upgrade twine wheel
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
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/*
rm -rf dist
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
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ name = "kalamine"
version = "0.38"
description = "a cross-platform Keyboard Layout Maker"
readme = "README.rst"

authors = [{ name = "Fabien Cazenave", email = "[email protected]" }]
license = { text = "MIT License" }

Expand All @@ -26,7 +25,7 @@ classifiers = [

requires-python = ">= 3.8"
dependencies = [
"click",
"click>=8.0",
"livereload",
"pyyaml",
"tomli",
Expand All @@ -35,11 +34,12 @@ dependencies = [

[project.optional-dependencies]
dev = [
"ruff",
"pytest",
"lxml",
"mypy",
"mypy>=1.13.0",
"ruff>=0.8.0",
"types-PyYAML",
"twine>=5.1.1",
]

[project.urls]
Expand Down
Loading

0 comments on commit 40b0907

Please sign in to comment.