Skip to content

Commit

Permalink
build: more uv work
Browse files Browse the repository at this point in the history
  • Loading branch information
phil65 committed Oct 15, 2024
1 parent 9125b94 commit e93b992
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ repos:
hooks:
- id: pytest-check
name: pytest-check
entry: hatch run test
entry: uv run pytest
language: system
# stages: [push]
types: [python]
Expand Down
10 changes: 9 additions & 1 deletion duties.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from duty import duty


ENV_PREFIX = "hatch run "
ENV_PREFIX = "uv run "

PARAMS = ["--disable-pip-version-check", "--outdated", "--format=json"]
UPDATE_CMD = f"""{ENV_PREFIX}python -m pip list {" ".join(PARAMS)}"""
Expand Down Expand Up @@ -69,6 +69,14 @@ def lint_check(ctx):
ctx.run("uv run mypy mkdocs_mknodes/")


@duty(capture=False)
def docs_test_build(ctx):
"""Build some test pages."""
ctx.run("uv run mkdocs build -v")
opts = "-d ../site/mkdocs -p configs/mkdocs_mkdocs.yml -v --clone-depth 100"
ctx.run(f"uv run mknodes build {opts}")


@duty(capture=False)
def version(ctx, *args: str):
"""Bump package version."""
Expand Down
28 changes: 3 additions & 25 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
[tool.hatch]

[tool.hatch.metadata]
allow-direct-references = true

Expand Down Expand Up @@ -34,26 +32,6 @@ dev-dependencies = [
"pillow",
]

[tool.hatch.envs.default.scripts]
test = "pytest -vv"
test-cov-xml = "pytest --cov-report=xml"
test-cov-html = "pytest --cov-report=html"
lint = [
"hatch run ruff check --fix .",
"hatch run ruff format .",
"hatch run mypy mkdocs_mknodes/",
]
lint-check = [
"hatch run ruff check .",
"hatch run ruff format --check .",
"hatch run mypy mkdocs_mknodes/",
]

docs-build-test = [
"hatch run mkdocs build -v",
"hatch run mknodes build -d ../site/mkdocs -p configs/mkdocs_mkdocs.yml -v --clone-depth 100",
]

[build-system]
requires = ["hatchling", "hatch-regex-commit"]
build-backend = "hatchling.build"
Expand Down Expand Up @@ -244,17 +222,17 @@ target-version = "py311"
# Enable preview style formatting.
preview = true

[tool.ruff.flake8-quotes]
[tool.ruff.lint.flake8-quotes]
docstring-quotes = "double"

[tool.ruff.isort]
[tool.ruff.lint.isort]
lines-after-imports = 2
lines-between-types = 1
# atomic = true
force-sort-within-sections = true
combine-as-imports = true

[tool.ruff.per-file-ignores]
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["E402", "I001"]

[tool.black]
Expand Down

0 comments on commit e93b992

Please sign in to comment.