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

uv + uv.lock #200

Merged
merged 5 commits into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suddenly wondering whether this works on Windows or not.
@Geobert can you test this, please?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will do this evening :)


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
Loading