Skip to content

Commit

Permalink
build: migrate to uv
Browse files Browse the repository at this point in the history
  • Loading branch information
lengau committed Oct 21, 2024
1 parent 59706ef commit ffb4ca7
Show file tree
Hide file tree
Showing 11 changed files with 2,677 additions and 1,120 deletions.
6 changes: 6 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,15 @@ build:
tools:
python: "3.10"
jobs:
post_system_dependencies:
- asdf plugin add uv
- asdf install uv latest
- asdf global uv latest
post_checkout:
- git fetch --tags --unshallow # Also fetch tags
- git describe # Make sure we get a proper version
pre_install:
- uv export --frozen --extra docs --output-file requirements-doc.txt

# Build documentation in the docs/ directory with Sphinx
sphinx:
Expand Down
22 changes: 22 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
ifneq ($(shell which snap),)
TOOL_INSTALLER := sudo $(shell which snap)
else ifneq ($(shell which brew),)
TOOL_INSTALLER := $(shell which brew)
else
TOOL_INSTALLER := uv
endif
RUFF := $(shell ruff --version 2> /dev/null)

.PHONY: help
Expand All @@ -6,6 +13,10 @@ help: ## Show this help.
@printf "%-40s %s\n" "------" "-----------"
@fgrep " ## " $(MAKEFILE_LIST) | fgrep -v grep | awk -F ': .*## ' '{$$1 = sprintf("%-40s", $$1)} 1'

.PHONY: setup
setup: setup-uv ## Set up a development environment
uv sync --frozen

.PHONY: autoformat
autoformat: ## Run automatic code formatters.
ifndef RUFF
Expand Down Expand Up @@ -133,3 +144,14 @@ test-docs: installdocs ## Run docs tests.

.PHONY: tests
tests: lint test-integrations test-units test-docs ## Run all tests.

.PHONY: setup-uv
setup-uv: # Install uv
ifneq ($(shell which uv),)
else ifneq ($(shell which snap),)
sudo snap install --classic astral-uv
else ifeq ($(OS),Windows_NT)
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
else
curl -LsSf https://astral.sh/uv/install.sh | sh
endif
17 changes: 0 additions & 17 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ dev = [
"sphinx-lint",
"sphinx-toolbox",
"sphinxcontrib-details-directive",
"tox",
"twine",
"types-pyyaml",
"types-requests",
Expand All @@ -71,22 +70,6 @@ release = [
"twine",
"wheel",
]
test = [
"black",
"codespell",
"coverage",
"mccabe<0.7.0",
"mypy",
"pytest",
"pytest-check>=2.0",
"pytest-mock",
"pytest-subprocess",
"tox",
"types-pyyaml",
"types-requests",
"types-setuptools",
"types-tabulate>=0.9.0.2",
]

[project.urls]
Documentation = "https://rockcraft.readthedocs.io/en/latest/"
Expand Down
Loading

0 comments on commit ffb4ca7

Please sign in to comment.