revbank-inflatinator/flake.nix
polyfloyd ef8d85d388
All checks were successful
Test / test (push) Successful in 1m22s
flake: Remove flake-utils
2025-07-18 14:22:03 +02:00

52 lines
1.8 KiB
Nix

{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
};
outputs = { self, nixpkgs }:
let
pyprojecttoml = nixpkgs.lib.importTOML ./pyproject.toml;
supermarktconnector = { python3Packages, fetchFromGitHub }:
python3Packages.buildPythonPackage {
pname = "supermarktconnector";
version = "0.8.1-2";
format = "setuptools";
src = fetchFromGitHub {
owner = "bartmachielsen";
repo = "SupermarktConnector";
rev = "393c8698a34393f233a0bef45022954bfabe4247";
hash = "sha256-OuCcwh58HdEsA2h6WGEgKDcyw4RH4NzHlVr7kY3DEHE=";
};
};
in {
packages = builtins.mapAttrs (system: pkgs: rec {
default = pkgs.python3Packages.buildPythonApplication {
pname = pyprojecttoml.project.name;
version = pyprojecttoml.project.version;
pyproject = true;
src = self;
dependencies = with pkgs.python3Packages; [ pyquery pytest requests ]
++ [ (pkgs.callPackage supermarktconnector {}) ];
nativeBuildInputs = with pkgs.python3Packages; [ setuptools ];
nativeCheckInputs = with pkgs.python3Packages; [ pytest ]
++ [ pkgs.ruff ];
dontCheck = true; # Makes network requests.
checkPhase = ''
runHook preCheck
# No pytest, there are tests that make network requests.
ruff check
runHook postCheck
'';
};
editable = pkgs.python3Packages.mkPythonEditablePackage {
inherit (default) pname version dependencies;
scripts = pyprojecttoml.project.scripts;
root = "$PWD/src";
passthru = { inherit (default) nativeCheckInputs; };
};
}) nixpkgs.legacyPackages;
};
}