59 lines
1.7 KiB
Nix
59 lines
1.7 KiB
Nix
{
|
|
description = "DCOS — Distributed Cognitive Operating System";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
|
flake-utils.url = "github:numtide/flake-utils";
|
|
};
|
|
|
|
outputs = { self, nixpkgs, flake-utils }:
|
|
flake-utils.lib.eachDefaultSystem (system:
|
|
let
|
|
pkgs = nixpkgs.legacyPackages.${system};
|
|
python = pkgs.python312;
|
|
pythonPackages = pkgs.python312Packages;
|
|
in {
|
|
packages.default = pythonPackages.buildPythonPackage {
|
|
pname = "dcos";
|
|
version = "1.0.0";
|
|
src = ./.;
|
|
nativeBuildInputs = with pythonPackages; [
|
|
python
|
|
setuptools
|
|
wheel
|
|
pytest
|
|
pytest-asyncio
|
|
];
|
|
propagatedBuildInputs = with pythonPackages; [
|
|
pyyaml
|
|
pydantic
|
|
];
|
|
doCheck = true;
|
|
checkPhase = ''
|
|
export PYTHONPATH="${toString ./src}:$PYTHONPATH"
|
|
python -m pytest tests/ -x --tb=short -q
|
|
'';
|
|
pyproject = true;
|
|
pyprojectFiles = [ "pyproject.toml" ];
|
|
makeWheel = true;
|
|
packageDir = "src";
|
|
};
|
|
|
|
devShells.default = pkgs.mkShell {
|
|
packages = with pkgs; [
|
|
python
|
|
pythonPackages.pip
|
|
pythonPackages.pytest
|
|
pythonPackages.pytest-asyncio
|
|
pythonPackages.pyyaml
|
|
pythonPackages.pydantic
|
|
pythonPackages.ruff
|
|
];
|
|
shellHook = ''
|
|
export PYTHONPATH="${toString ./src}:$PYTHONPATH"
|
|
echo "DCOS dev shell — Python 3.12, pytest, pyyaml, pydantic"
|
|
'';
|
|
};
|
|
});
|
|
}
|