-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyproject.toml
57 lines (46 loc) · 1.16 KB
/
pyproject.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
[project]
name = "tomlscript"
version = "0.2.1"
description = "A lightweight, dependency-free tool to manage your scripts directly from pyproject.toml"
readme = "README.md"
requires-python = ">=3.10"
dependencies = ["tomli>=1; python_version<'3.11'"]
[project.urls]
"Source" = "https://github.com/phihung/tomlscript"
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project.scripts]
tom = "tomlscript.main:main"
tomlscript = "tomlscript.main:main"
[tool.uv]
dev-dependencies = [
"pytest>=8.3.3",
"pytest-cov>=5.0.0",
"ipykernel>=6.29.5",
"ruff>=0.6.9",
"inline-snapshot>=0.13.3",
]
[tool.ruff]
line-length = 100
target-version = "py311"
[tool.pytest.ini_options]
addopts = "--cov src --cov-branch --cov-report term --cov-report html"
[tool.tomlscript]
# Setup dev env
setup_dev = """
uv sync
uv run ruff check
uv run pytest
"""
# Run tests with coverage
test = """
uv run ruff check
uv run pytest --inline-snapshot=review
"""
# Publish pypi package
publish = "rm -rf dist && uv build && uvx twine upload dist/*"
# Open Cov report
cov = "open htmlcov/index.html"
# Execute a simple python function
example = "tests.myscript:run1"