This commit is contained in:
parent
9d16212e2e
commit
1699e672dc
5 changed files with 127 additions and 16 deletions
54
flake.nix
Normal file
54
flake.nix
Normal file
|
@ -0,0 +1,54 @@
|
|||
{
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, flake-utils }:
|
||||
flake-utils.lib.eachDefaultSystem (system:
|
||||
let
|
||||
pkgs = import nixpkgs { system = system; };
|
||||
pyprojecttoml = nixpkgs.lib.importTOML ./pyproject.toml;
|
||||
|
||||
supermarktconnector = pkgs.python3Packages.buildPythonPackage {
|
||||
pname = "supermarktconnector";
|
||||
version = "0.8.1-2";
|
||||
format = "setuptools";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "bartmachielsen";
|
||||
repo = "SupermarktConnector";
|
||||
rev = "393c8698a34393f233a0bef45022954bfabe4247";
|
||||
hash = "sha256-OuCcwh58HdEsA2h6WGEgKDcyw4RH4NzHlVr7kY3DEHE=";
|
||||
};
|
||||
};
|
||||
|
||||
in rec {
|
||||
|
||||
packages.default = pkgs.python3Packages.buildPythonPackage {
|
||||
pname = pyprojecttoml.project.name;
|
||||
version = pyprojecttoml.project.version;
|
||||
pyproject = true;
|
||||
src = self;
|
||||
dependencies = with pkgs.python3Packages; [ pyquery pytest requests ]
|
||||
++ [ 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
|
||||
'';
|
||||
};
|
||||
|
||||
packages.editable = pkgs.python3Packages.mkPythonEditablePackage {
|
||||
inherit (packages.default) name version dependencies;
|
||||
root = "$PWD/src";
|
||||
passthru = { inherit (packages.default) nativeCheckInputs; };
|
||||
};
|
||||
|
||||
}
|
||||
);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue