+ validation schema
This commit is contained in:
161
flake.nix
161
flake.nix
@@ -6,93 +6,96 @@
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, flake-utils }:
|
||||
flake-utils.lib.eachDefaultSystem (system:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
pythonPackages = pkgs.python311Packages;
|
||||
outputs = {
|
||||
self,
|
||||
nixpkgs,
|
||||
flake-utils,
|
||||
}:
|
||||
flake-utils.lib.eachDefaultSystem (system: let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
pythonPackages = pkgs.python311Packages;
|
||||
|
||||
# factur-x package - not available in nixpkgs, so we package it inline
|
||||
factur-x = pythonPackages.buildPythonPackage rec {
|
||||
pname = "factur_x";
|
||||
version = "3.8";
|
||||
format = "pyproject";
|
||||
# factur-x package - not available in nixpkgs, so we package it inline
|
||||
factur-x = pythonPackages.buildPythonPackage rec {
|
||||
pname = "factur_x";
|
||||
version = "3.8";
|
||||
format = "pyproject";
|
||||
|
||||
src = pythonPackages.fetchPypi {
|
||||
inherit pname version;
|
||||
hash = "sha256-/pNY5w09pxcGAFFh3USTkLlkGr+JOTUqhglYzNMByks=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = with pythonPackages; [
|
||||
hatchling
|
||||
hatch-requirements-txt
|
||||
];
|
||||
|
||||
dependencies = with pythonPackages; [ pypdf lxml ];
|
||||
|
||||
pythonRelaxDeps = true;
|
||||
|
||||
meta = {
|
||||
description =
|
||||
"Python library to generate and read Factur-X invoices";
|
||||
license = pkgs.lib.licenses.mit;
|
||||
};
|
||||
src = pythonPackages.fetchPypi {
|
||||
inherit pname version;
|
||||
hash = "sha256-/pNY5w09pxcGAFFh3USTkLlkGr+JOTUqhglYzNMByks=";
|
||||
};
|
||||
|
||||
zugferd-service = pythonPackages.buildPythonApplication {
|
||||
pname = "zugferd-service";
|
||||
version = "1.0.0";
|
||||
pyproject = true;
|
||||
src = ./.;
|
||||
nativeBuildInputs = with pythonPackages; [
|
||||
hatchling
|
||||
hatch-requirements-txt
|
||||
];
|
||||
|
||||
pythonRelaxDeps = true;
|
||||
dependencies = with pythonPackages; [pypdf lxml];
|
||||
|
||||
build-system = [ pythonPackages.hatchling ];
|
||||
pythonRelaxDeps = true;
|
||||
|
||||
dependencies = with pythonPackages; [
|
||||
fastapi
|
||||
uvicorn
|
||||
pydantic
|
||||
python-multipart
|
||||
factur-x
|
||||
pypdf
|
||||
lxml
|
||||
];
|
||||
|
||||
nativeCheckInputs = with pythonPackages; [
|
||||
pytestCheckHook
|
||||
pytest-asyncio
|
||||
httpx
|
||||
];
|
||||
|
||||
passthru = { mainProgram = "zugferd-service"; };
|
||||
|
||||
meta = {
|
||||
description = "REST API for ZUGFeRD invoice extraction";
|
||||
license = pkgs.lib.licenses.mit;
|
||||
};
|
||||
meta = {
|
||||
description = "Python library to generate and read Factur-X invoices";
|
||||
license = pkgs.lib.licenses.mit;
|
||||
};
|
||||
in {
|
||||
packages.default = zugferd-service;
|
||||
packages.zugferd-service = zugferd-service;
|
||||
};
|
||||
|
||||
devShells.default = pkgs.mkShell {
|
||||
packages = [
|
||||
(pkgs.python311.withPackages (ps:
|
||||
with ps; [
|
||||
fastapi
|
||||
uvicorn
|
||||
pydantic
|
||||
python-multipart
|
||||
pypdf
|
||||
lxml
|
||||
pytest
|
||||
pytest-asyncio
|
||||
httpx
|
||||
# factur-x - install via pip if not available
|
||||
]))
|
||||
pkgs.python311Packages.pip
|
||||
];
|
||||
zugferd-service = pythonPackages.buildPythonApplication {
|
||||
pname = "zugferd-service";
|
||||
version = "1.0.0";
|
||||
pyproject = true;
|
||||
src = ./.;
|
||||
|
||||
pythonRelaxDeps = true;
|
||||
|
||||
build-system = [pythonPackages.hatchling];
|
||||
|
||||
dependencies = with pythonPackages; [
|
||||
fastapi
|
||||
uvicorn
|
||||
pydantic
|
||||
python-multipart
|
||||
factur-x
|
||||
pypdf
|
||||
lxml
|
||||
];
|
||||
|
||||
nativeCheckInputs = with pythonPackages; [
|
||||
pytestCheckHook
|
||||
pytest-asyncio
|
||||
httpx
|
||||
];
|
||||
|
||||
passthru = {mainProgram = "zugferd-service";};
|
||||
|
||||
meta = {
|
||||
description = "REST API for ZUGFeRD invoice extraction";
|
||||
license = pkgs.lib.licenses.mit;
|
||||
};
|
||||
});
|
||||
};
|
||||
in {
|
||||
packages.default = zugferd-service;
|
||||
packages.zugferd-service = zugferd-service;
|
||||
|
||||
devShells.default = pkgs.mkShell {
|
||||
packages = [
|
||||
(pkgs.python311.withPackages (ps:
|
||||
with ps; [
|
||||
fastapi
|
||||
uvicorn
|
||||
pydantic
|
||||
python-multipart
|
||||
pypdf
|
||||
lxml
|
||||
pytest
|
||||
pytest-asyncio
|
||||
httpx
|
||||
factur-x
|
||||
# factur-x - install via pip if not available
|
||||
]))
|
||||
pkgs.python311Packages.pip
|
||||
];
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user