Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
__pycache__/
venv/
.direnv
.venv/
.idea/
.vscode/
.DS_Store
results/
benchkit.egg-info/
.envrc
79 changes: 79 additions & 0 deletions .nix/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
{
config,
lib,
dream2nix,
pkgs,
pythainer,
...
}: let
pyproject = lib.importTOML (config.mkDerivation.src + /pyproject.toml);
in {

imports = [
dream2nix.modules.dream2nix.pip
];

# package dependencies
deps = { nixpkgs, pythainer, ... } : {

python = nixpkgs.python3;
pythainerPackage = pythainer.default;
inherit
(nixpkgs)
stress-ng
tmux
git
;
};

inherit (pyproject.project) name version;

mkDerivation = {
nativeBuildInputs = [];

propagatedBuildInputs = [
config.deps.pythainerPackage
config.deps.stress-ng
config.deps.git
];

src = lib.cleanSourceWith {
src = lib.cleanSource ./..;
filter = name : type:
!(builtins.any (x: x) [
(lib.hasSuffix ".nix" name) # do not package nix files
(lib.hasPrefix "." (builtins.baseNameOf name)) # do not package hidden files
(lib.hasSuffix "flake.lock" name) # do not include the flake lock
]);
};
};

buildPythonPackage = {
pyproject = true;
pythonImportsCheck = [ # checks that python can import pythainer
"benchkit"
"pythainer"
];
};

pip = {
# concatenate both the build system (above) and the requirements.txt
requirementsList =
pyproject.build-system.requires or []
++ pyproject.project.dependencies or [];
flattenDependencies = true;

# this is required as the pypi version of docopt makes the build fail
overrides.docopt = {
buildPythonPackage.pyproject = true;
mkDerivation.buildInputs = [config.deps.python.pkgs.setuptools];
};

overrides.wget = {
buildPythonPackage.pyproject = true;
mkDerivation.buildInputs = [config.deps.python.pkgs.setuptools];
};
};


}
101 changes: 101 additions & 0 deletions .nix/lock.x86_64-linux.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
{
"fetchPipMetadata": {
"sources": {
"docopt": {
"is_direct": false,
"sha256": "49b3a825280bd66b3aa83585ef59c4a8c82f2c8a522dbe754a8bc8d08c85c491",
"type": "url",
"url": "https://files.pythonhosted.org/packages/a2/55/8f8cab2afd404cf578136ef2cc5dfb50baa1761b68c9da1fb1e4eed343c9/docopt-0.6.2.tar.gz",
"version": "0.6.2"
},
"hatchling": {
"is_direct": false,
"sha256": "dc48722b68b3f4bbfa3ff618ca07cdea6750e7d03481289ffa8be1521d18a961",
"type": "url",
"url": "https://files.pythonhosted.org/packages/0d/a5/48cb7efb8b4718b1a4c0c331e3364a3a33f614ff0d6afd2b93ee883d3c47/hatchling-1.28.0-py3-none-any.whl",
"version": "1.28.0"
},
"markdown-it-py": {
"is_direct": false,
"sha256": "87327c59b172c5011896038353a81343b6754500a08cd7a4973bb48c6d578147",
"type": "url",
"url": "https://files.pythonhosted.org/packages/94/54/e7d793b573f298e1c9013b8c4dade17d481164aa517d1d7148619c2cedbf/markdown_it_py-4.0.0-py3-none-any.whl",
"version": "4.0.0"
},
"mdurl": {
"is_direct": false,
"sha256": "84008a41e51615a49fc9966191ff91509e3c40b939176e643fd50a5c2196b8f8",
"type": "url",
"url": "https://files.pythonhosted.org/packages/b3/38/89ba8ad64ae25be8de66a6d463314cf1eb366222074cfda9ee839c56a4b4/mdurl-0.1.2-py3-none-any.whl",
"version": "0.1.2"
},
"packaging": {
"is_direct": false,
"sha256": "29572ef2b1f17581046b3a2227d5c611fb25ec70ca1ba8554b24b0e69331a484",
"type": "url",
"url": "https://files.pythonhosted.org/packages/20/12/38679034af332785aac8774540895e234f4d07f7545804097de4b666afd8/packaging-25.0-py3-none-any.whl",
"version": "25.0"
},
"pathspec": {
"is_direct": false,
"sha256": "1373719036e64a2b9de3b8ddd9e30afb082a915619f07265ed76d9ae507800ae",
"type": "url",
"url": "https://files.pythonhosted.org/packages/05/bb/39e6768529454cc2b57e1e2fa0a0a18ff64397a16303270e215a3e03285f/pathspec-1.0.0-py3-none-any.whl",
"version": "1.0.0"
},
"pluggy": {
"is_direct": false,
"sha256": "e920276dd6813095e9377c0bc5566d94c932c33b27a3e3945d8389c374dd4746",
"type": "url",
"url": "https://files.pythonhosted.org/packages/54/20/4d324d65cc6d9205fabedc306948156824eb9f0ee1633355a8f7ec5c66bf/pluggy-1.6.0-py3-none-any.whl",
"version": "1.6.0"
},
"pygments": {
"is_direct": false,
"sha256": "86540386c03d588bb81d44bc3928634ff26449851e99741617ecb9037ee5ec0b",
"type": "url",
"url": "https://files.pythonhosted.org/packages/c7/21/705964c7812476f378728bdf590ca4b771ec72385c533964653c68e86bdc/pygments-2.19.2-py3-none-any.whl",
"version": "2.19.2"
},
"rich": {
"is_direct": false,
"sha256": "76bc51fe2e57d2b1be1f96c524b890b816e334ab4c1e45888799bfaab0021edd",
"type": "url",
"url": "https://files.pythonhosted.org/packages/25/7a/b0178788f8dc6cafce37a212c99565fa1fe7872c70c6c9c1e1a372d9d88f/rich-14.2.0-py3-none-any.whl",
"version": "14.2.0"
},
"trove-classifiers": {
"is_direct": false,
"sha256": "a8206978ede95937b9959c3aff3eb258bbf7b07dff391ddd4ea7e61f316635ab",
"type": "url",
"url": "https://files.pythonhosted.org/packages/4f/7e/bc19996fa86cad8801e8ffe6f1bba5836ca0160df76d0410d27432193712/trove_classifiers-2025.12.1.14-py3-none-any.whl",
"version": "2025.12.1.14"
}
},
"targets": {
"default": {
"docopt": [],
"hatchling": [
"packaging",
"pathspec",
"pluggy",
"trove-classifiers"
],
"markdown-it-py": [
"mdurl"
],
"mdurl": [],
"packaging": [],
"pathspec": [],
"pluggy": [],
"pygments": [],
"rich": [
"markdown-it-py",
"pygments"
],
"trove-classifiers": []
}
}
},
"invalidationHash": "156fe21e28238080e9b7e35e84dfb16761c3a17d21291acf0487ba850888dd18"
}
Loading