forked from mlco2/codecarbon
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
162 lines (146 loc) · 5.04 KB
/
Copy pathpyproject.toml
File metadata and controls
162 lines (146 loc) · 5.04 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
[build-system]
requires = ["setuptools>=77", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "codecarbon"
dynamic = ["version"]
readme = "README.md"
requires-python = ">=3.10"
license = "MIT"
license-files = ["LICENSE"]
authors = [
{ name = "Mila" },
{ name = "DataForGood" },
{ name = "BCG GAMMA" },
{ name = "Comet.ml" },
{ name = "Haverford College" },
]
classifiers = [
"Natural Language :: English",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
]
dependencies = [
"arrow",
"authlib>=1.2.1",
"click",
"pandas>=2.3.3;python_version>='3.14'",
"pandas;python_version<'3.14'",
"prometheus_client",
"psutil >= 6.0.0",
"py-cpuinfo",
"pydantic",
"nvidia-ml-py",
"rapidfuzz",
"requests",
"questionary",
"rich",
"typer",
]
[tool.setuptools.dynamic]
version = {attr = "codecarbon._version.__version__"}
[tool.setuptools]
include-package-data = false
[tool.setuptools.packages.find]
include = ["codecarbon*"]
exclude = ["*.json", "**/*.csv", "*.geojson"]
[tool.setuptools.package-data]
codecarbon = [
"py.typed",
"data/cloud/impact.csv",
"data/hardware/cpu_power.csv",
"data/canada_provinces.geojson",
"data/private_infra/global_energy_mix.json",
"data/private_infra/carbon_intensity_per_source.json",
"data/private_infra/2016/usa_emissions.json",
"data/private_infra/2023/canada_energy_mix.json",
"viz/assets/car_icon.png",
"viz/assets/house_icon.png",
"viz/assets/tv_icon.png"
]
[project.urls]
Homepage = "https://codecarbon.io/"
Repository = "https://github.com/mlco2/codecarbon"
Dashboard = "http://dashboard.codecarbon.io/"
Documentation = "https://docs.codecarbon.io/"
Issues = "https://github.com/mlco2/codecarbon/issues"
Changelog = "https://github.com/mlco2/codecarbon/releases"
[dependency-groups]
dev = [
"taskipy",
"bumpver",
"pre-commit",
"ruff",
"black",
"mypy",
"pytest",
"requests",
"requests-mock",
"responses",
"pytest-cov",
"logfire>=1.0.1", # For testing Logfire output method
]
doc = [
"setuptools",
"zensical",
"mike",
"mkdocstrings[python]>=0.26",
]
[project.optional-dependencies]
carbonboard = [
"dash",
"dash_bootstrap_components > 1.0.0",
"fire",
]
# Backwards compatibility alias - will be removed in v4.0.0
viz-legacy = [
"dash",
"dash_bootstrap_components > 1.0.0",
"fire",
]
[project.scripts]
carbonboard = "codecarbon.viz.carbonboard:main"
codecarbon = "codecarbon.cli.main:main"
[tool.taskipy.tasks]
pre-commit-install = { cmd = "pre-commit install", help = "Install pre-commit hook." }
dashboard = "uv run --project carbonserver uvicorn main:app --reload"
dashboard-ci = "uv run --project carbonserver uvicorn main:app --host 0.0.0.0 --port 8008"
docker = "docker-compose up -d"
test-api-unit = "uv run --project carbonserver python -m pytest -vv carbonserver/tests/api/routers && uv run --project carbonserver python -m pytest -vv carbonserver/tests/api/service/ && uv run --project carbonserver python -m pytest -vv carbonserver/tests/api/usecase/"
test-api-integ = "uv run --project carbonserver python -m pytest -vv carbonserver/tests/api/integration/"
setup-db = "cd carbonserver && uv run --project carbonserver python -m alembic -c carbonserver/database/alembic.ini upgrade head"
downgrade-db = "cd carbonserver && uv run --project carbonserver python -m alembic -c carbonserver/database/alembic.ini downgrade base"
carbonserver-api-requirements = "uv pip compile carbonserver/pyproject.toml --output-file requirements/requirements-api.txt"
build-doc = "zensical build -f mkdocs.yml"
precommit-install = "pre-commit install"
precommit-update = "pre-commit autoupdate"
precommit = "pre-commit run --show-diff-on-failure --color=always --all-files"
mypy-check = "mypy -m codecarbon --ignore-missing-imports --no-strict-optional --disable-error-code attr-defined --disable-error-code assignment --disable-error-code misc"
lint = "black --check --diff . && ruff check . && mypy ."
format = "black . && ruff check --fix --exit-non-zero-on-fix ."
test-package = "CODECARBON_ALLOW_MULTIPLE_RUNS=True pytest --ignore=tests/test_viz_data.py -vv -m 'not integ_test' tests/"
test-coverage = "CODECARBON_ALLOW_MULTIPLE_RUNS=True pytest --cov --cov-report=xml --ignore=tests/test_viz_data.py -vv -m 'not integ_test' tests/"
test-package-integ = "CODECARBON_ALLOW_MULTIPLE_RUNS=True python -m pytest -vv tests/"
docs = "zensical build -f mkdocs.yml"
docs-serve = "zensical serve -f mkdocs.yml"
docs-check-drift = "python scripts/check-docs-drift.py"
carbonboard = "python codecarbon/viz/carbonboard.py"
[tool.bumpver]
current_version = "3.2.3"
version_pattern = "MAJOR.MINOR.PATCH[_TAGNUM]"
[tool.bumpver.file_patterns]
"codecarbon/_version.py" = [
'^__version__ = "{version}"$',
]
[tool.pytest.ini_options]
pythonpath = "."
[tool.coverage.run]
source = [
"codecarbon",
]
omit = [
"codecarbon/viz/*",
]