-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #43 from criteo/new-tooling
New tooling for dependency management and building
- Loading branch information
Showing
13 changed files
with
939 additions
and
1,505 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
# ignore misc build/test files | ||
.env-lint | ||
# ignore uv venv | ||
.venv | ||
|
||
# ignore standard cache folders | ||
.*_cache | ||
|
||
# ignore built files | ||
*.pyc | ||
.ruff-cache | ||
dist | ||
|
||
hwbench-out-* | ||
hwbench.egg-info | ||
.coverage | ||
junit-python*.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,37 @@ | ||
all: | ||
|
||
.PHONY: update_deps clean check format | ||
.PHONY: update_deps update_lock sync_deps clean check check_ci bundle format | ||
|
||
UPDATE_DEPS_ENV = .env-deps | ||
LINT_ENV = .env-lint | ||
SOURCES = hwbench csv graph | ||
|
||
SOURCES = hwbench setup.py csv graph | ||
update_deps: | ||
uv sync -U | ||
|
||
update_env: | ||
python3 -m venv $(UPDATE_DEPS_ENV) | ||
./$(UPDATE_DEPS_ENV)/bin/pip install --upgrade --quiet pip-tools | ||
update_lock: | ||
uv lock | ||
|
||
update_deps: update_env | ||
./$(UPDATE_DEPS_ENV)/bin/pip-compile --upgrade --output-file=requirements/base.txt requirements/base.in | ||
./$(UPDATE_DEPS_ENV)/bin/pip-compile --upgrade --output-file=requirements/test.txt requirements/test.in | ||
|
||
regen_hashes: update_env | ||
./$(UPDATE_DEPS_ENV)/bin/pip-compile --output-file=requirements/base.txt requirements/base.in | ||
./$(UPDATE_DEPS_ENV)/bin/pip-compile --output-file=requirements/test.txt requirements/test.in | ||
sync_deps: | ||
uv sync --all-extras --dev | ||
|
||
clean: | ||
rm -fr $(UPDATE_DEPS_ENV) $(LINT_ENV) | ||
|
||
$(LINT_ENV): | ||
python3 -m venv $(LINT_ENV) | ||
./$(LINT_ENV)/bin/pip install -r requirements/test.txt | ||
|
||
check: $(LINT_ENV) | ||
env PYTHON=python3 ./$(LINT_ENV)/bin/tox | ||
|
||
bundle: $(LINT_ENV) | ||
env PYTHON=python3 ./$(LINT_ENV)/bin/tox -e bundle | ||
|
||
format: $(LINT_ENV) | ||
./$(LINT_ENV)/bin/ruff format $(SOURCES) | ||
uv venv | ||
|
||
check: | ||
@uv lock --locked || echo "Your lock file should change because you probably added a dependency or bump the minimal Python version. Please run `uv lock`" | ||
uv tool run ruff format --diff $(SOURCES) | ||
uv tool run ruff check $(SOURCES) | ||
uv run mypy $(SOURCES) | ||
uv run pytest $(SOURCES) | ||
|
||
check_ci: | ||
@uv lock --locked || echo "Your lock file should change because you probably added a dependency or bump the minimal Python version, but this is not allowed in the CI. Please run `uv lock`" | ||
uv tool run ruff format --diff $(SOURCES) | ||
uv tool run ruff check --output-format=github $(SOURCES) | ||
uv run mypy $(SOURCES) | ||
uv run pytest $(SOURCES) | ||
|
||
bundle: | ||
uv build | ||
|
||
format: | ||
uv tool run ruff format $(SOURCES) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,44 @@ | ||
[tool.pip-tools] | ||
rebuild = true | ||
generate-hashes = true | ||
resolver = "backtracking" | ||
allow-unsafe = true | ||
no-emit-index-url = true | ||
no-emit-trusted-host = true | ||
quiet = true | ||
strip-extras = true | ||
[build-system] | ||
requires = ["hatchling>=1.25.0"] | ||
build-backend = "hatchling.build" | ||
|
||
[project] | ||
name = "hwbench" | ||
authors = [{name = "Erwan Velu", email = "e.velu@criteo.com"}, {name = "Anisse Astier", email = "a.astier@criteo.com"}, {name = "Aurélien Rougemont", email="a.rougemont@criteo.com"}] | ||
description = "hwbench is a benchmark orchestrator to automate the low-level testing of servers" | ||
version = "0.1.0" | ||
readme = "README.md" | ||
requires-python = ">=3.9" | ||
dependencies = [ | ||
"cachetools", | ||
"redfish", | ||
"packaging" | ||
] | ||
|
||
[project.urls] | ||
Home = "https://github.com/criteo/hwbench" | ||
|
||
[project.scripts] | ||
hwbench = "hwbench.hwbench:main" | ||
hwgraph = "graph.hwgraph:main" | ||
|
||
[tool.hatch.build] | ||
packages = ["hwbench", "graph"] | ||
|
||
[dependency-groups] | ||
dev = [ | ||
"cachetools>=4.2.4", | ||
"mypy", | ||
"pytest>=8.3.3", | ||
"ruff>=0.7.1", | ||
"types-cachetools>=5.5.0.20240820", | ||
"uv>=0.4.27" | ||
] | ||
|
||
[project.optional-dependencies] | ||
graph = [ | ||
"numpy", | ||
"matplotlib>3.5.0", | ||
"pillow>=11.0.0", | ||
"pycairo", | ||
] |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.