-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathpyproject.toml
More file actions
90 lines (79 loc) · 2.14 KB
/
pyproject.toml
File metadata and controls
90 lines (79 loc) · 2.14 KB
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
[project]
name = "carbon"
version = "0.1.0"
description = "Calculate carbon emissions"
authors = [
{name = "Jack Coker", email = "j.coker20@imperial.ac.uk"},
{name = "Imperial College London RSE Team", email = "ict-rse-team@imperial.ac.uk"},
]
requires-python = ">=3.13, <4"
dependencies = [
"types-requests>=2.32.4.20250913,<3",
"pydantic>=2.12.5,<3",
"pyaml>=26.2.1,<27",
"types-pyyaml>=6.0.12.20250915,<7",
"click>=8.3.2,<9",
"numpy>=2.3.3,<3",
]
[dependency-groups]
dev = [
"mypy>=1.20.1,<2",
"pytest>=9.0.3,<10",
"pytest-cov>=7.0.0,<8",
"pytest-mock>=3.15.1,<4",
"pre-commit>=4.3.0,<5",
"ruff>=0.14.0,<0.16",
"pyinstaller<7.0.0,>=6.18.0",
]
docs = [
"mkdocs>=1.6.1,<2",
"mkdocstrings>=0.30.0,<1.1",
"mkdocstrings-python>=2.0.3,<3",
"mkdocs-material>=9.6.21,<10",
"mkdocs-gen-files>=0.5.0,<0.7",
"mkdocs-literate-nav>=0.6.2,<0.7",
"mkdocs-section-index>=0.3.10,<0.4",
"mkdocs-include-markdown-plugin>=7.2.0",
"python-markdown-math>=0.9",
]
[tool.uv]
default-groups = ["dev", "docs"]
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.mypy]
disallow_any_explicit = true
disallow_any_generics = true
warn_unreachable = true
warn_unused_ignores = true
disallow_untyped_defs = true
exclude = [".venv/", "docs/"]
plugins = ["pydantic.mypy"]
[[tool.mypy.overrides]]
module = "tests.*"
disallow_untyped_defs = false
[tool.pydantic-mypy]
init_forbid_extra = true
init_typed = true
[tool.pytest.ini_options]
addopts = "-v -p no:warnings --cov=carbon --cov-branch --cov-report=html --cov-report=xml --doctest-modules --ignore=carbon/__main__.py --ignore=docs/"
[tool.ruff]
target-version = "py312"
[tool.ruff.lint]
select = [
"D", # pydocstyle
"E", # pycodestyle
"F", # Pyflakes
"I", # isort
"UP", # pyupgrade
"RUF", # ruff
]
pydocstyle.convention = "google"
[tool.ruff.lint.per-file-ignores]
"tests/*" = [
"D100", # Missing docstring in public module
"D104", # Missing docstring in public package
]
"carbon/__main__.py" = ["D301"] # To allow escape sequences in docstrings
[project.scripts]
carbon = "carbon.__main__:main"