WIP poetry

This commit is contained in:
Andreas Zweili 2022-11-15 22:04:13 +01:00
parent 681ac2999c
commit c07bc5268b
6 changed files with 1567 additions and 168 deletions

View File

@ -17,11 +17,11 @@
},
"flake-utils_2": {
"locked": {
"lastModified": 1642700792,
"narHash": "sha256-XqHrk7hFb+zBvRg6Ghl+AZDq03ov6OshJLiSWOoX5es=",
"lastModified": 1667395993,
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "846b2ae0fc4cc943637d3d1def4454213e203cba",
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
"type": "github"
},
"original": {
@ -30,30 +30,6 @@
"type": "github"
}
},
"mach-nix": {
"inputs": {
"flake-utils": "flake-utils_2",
"nixpkgs": [
"nixpkgs"
],
"pypi-deps-db": [
"pypi"
]
},
"locked": {
"lastModified": 1654084003,
"narHash": "sha256-j/XrVVistvM+Ua+0tNFvO5z83isL+LBgmBi9XppxuKA=",
"owner": "DavHau",
"repo": "mach-nix",
"rev": "7e14360bde07dcae32e5e24f366c83272f52923f",
"type": "github"
},
"original": {
"id": "mach-nix",
"ref": "3.5.0",
"type": "indirect"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1668189330,
@ -70,28 +46,32 @@
"type": "github"
}
},
"pypi": {
"flake": false,
"poetry2nix": {
"inputs": {
"flake-utils": "flake-utils_2",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1668327102,
"narHash": "sha256-LNwIk1BgJVrwtQWRAoAx1IaFRVpuMfpTvGx0C83Zr7A=",
"owner": "DavHau",
"repo": "pypi-deps-db",
"rev": "82718a1368ff4aa263b36d80a58fbc7085f367cc",
"lastModified": 1668394823,
"narHash": "sha256-UJqW+Zp1boVhTKfWel2WTi7Qn0R9hfpVeSRdJYPJwXQ=",
"owner": "nix-community",
"repo": "poetry2nix",
"rev": "3cc82ca6ccca2a06dbb05cb0b74efd5d50e60d48",
"type": "github"
},
"original": {
"owner": "DavHau",
"repo": "pypi-deps-db",
"owner": "nix-community",
"repo": "poetry2nix",
"type": "github"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"mach-nix": "mach-nix",
"nixpkgs": "nixpkgs",
"pypi": "pypi"
"poetry2nix": "poetry2nix"
}
}
},

View File

@ -5,53 +5,43 @@
flake-utils = {
url = github:numtide/flake-utils;
};
pypi = {
url = "github:DavHau/pypi-deps-db";
flake = false;
};
mach-nix = {
inputs.pypi-deps-db.follows = "pypi";
url = "mach-nix/3.5.0";
poetry2nix = {
url = "github:nix-community/poetry2nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, flake-utils, mach-nix, ... }@inputs:
flake-utils.lib.eachDefaultSystem (system:
outputs = { self, nixpkgs, flake-utils, poetry2nix }:
{
# Nixpkgs overlay providing the application
overlay = nixpkgs.lib.composeManyExtensions [
poetry2nix.overlay
(final: prev: {
# The application
network_inventory = prev.poetry2nix.mkPoetryApplication {
projectDir = ./.;
};
})
];
} // (flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
machNix = mach-nix.lib."${system}";
devEnvironment = machNix.mkPython {
requirements = builtins.readFile ./requirements/local.txt;
_.pytest-cov.propagatedBuildInputs.mod = pySelf: self: oldVal: oldVal ++ [ pySelf.tomli ];
pkgs = import nixpkgs {
inherit system;
overlays = [ self.overlay ];
};
in
{
apps = {
network_inventory = pkgs.network_inventory;
};
defaultApp = pkgs.network_inventory;
devShell = pkgs.mkShell {
buildInputs = [
devEnvironment
pkgs.gnumake
pkgs.python39Packages.autopep8
pkgs.python39Packages.black
pkgs.python39Packages.flake8
pkgs.python39Packages.jedi
pkgs.python39Packages.pip
pkgs.python39Packages.yapf
pkgs.python39Packages.poetry
pkgs.network_inventory
];
shellHook = ''
export DJANGO_SETTINGS_MODULE=network_inventory.settings.local
'';
};
packages.venv = devEnvironment;
defaultPackage = (machNix.mkDockerImage {
packagesExtra = with pkgs;
[ pkgs.bash ];
requirements = builtins.readFile ./requirements/docker.txt;
_.pytest-cov.propagatedBuildInputs.mod = pySelf: self: oldVal: oldVal ++ [ pySelf.tomli ];
}).override
(oldAttrs: {
name = "network-inventory";
config.Cmd = [ "run.sh" ];
});
});
}));
}

1482
poetry.lock generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,2 +1,42 @@
[tool.black]
line-length = 79
[tool.poetry]
name = "network_inventory"
version = "0.1.0"
description = ""
authors = ["Andreas Zweili <andreas@zweili.ch>"]
license = "GPLv3"
[tool.poetry.dependencies]
python = "^3.9"
Django = "^4.1.3"
django-crispy-forms = "^1.14.0"
django-filter = "^22.1"
django-floppyforms = "^1.9.0"
django-guardian = "^2.4.0"
django-htmx = "^1.13.0"
django-model-utils = "^4.2.0"
django-nested-admin = "^4.0.2"
django-tables2 = "^2.4.1"
gunicorn = "^20.1.0"
psycopg2-binary = "^2.9.5"
pdm = "^2.2.1"
[tool.poetry.dev-dependencies]
coverage = "^6.5.0"
flake8 = "^5.0.4"
mixer = "^7.2.2"
pep8 = "^1.7.1"
pylint = "^2.15.5"
pytest = "^7.2.0"
pytest-cov = "^4.0.0"
pytest-django = "^4.5.2"
pytest-forked = "^1.4.0"
pytest-xdist = "^3.0.2"
rope = "^1.4.0"
yapf = "^0.32.0"
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

View File

@ -1,37 +0,0 @@
asgiref==3.5.2
attrs==22.1.0
coverage==6.5.0
Django==4.1.3
django-crispy-forms==1.14.0
django-filter==21.1
django-floppyforms==1.9.0
django-guardian==2.4.0
django-htmx==1.12.2
django-model-utils==4.2.0
django-nested-admin==3.4.0
django-tables2==2.4.1
execnet==1.9.0
Faker==11.3.0
gunicorn==20.1.0
iniconfig==1.1.1
mixer==7.2.0
packaging==21.3
pluggy==1.0.0
psycopg2-binary==2.9.5
py==1.11.0
pyaml==21.10.1
pyparsing==3.0.7
pytest==6.2.5
pytest-cov==3.0.0
pytest-django==4.5.2
pytest-forked==1.4.0
pytest-xdist==3.0.2
python-dateutil==2.8.2
python-monkey-business==1.0.0
pytz==2021.3
PyYAML==6.0
six==1.16.0
sqlparse==0.4.3
text-unidecode==1.3
toml==0.10.2
tomli==2.0.0

View File

@ -1,56 +0,0 @@
asgiref==3.5.2
astroid==2.9.0
attrs==22.1.0
autopep8
black==21.12b0
click==8.0.3
coverage==6.5.0
Django==4.1.3
django-crispy-forms==1.14.0
django-filter==21.1
django-floppyforms==1.9.0
django-guardian==2.4.0
django-htmx==1.12.2
django-model-utils==4.2.0
django-nested-admin==3.4.0
django-tables2==2.4.1
execnet==1.9.0
Faker==11.1.0
flake8
iniconfig==1.1.1
isort==5.10.1
jedi==0.18.1
lazy-object-proxy==1.7.1
mccabe==0.6.1
mixer==7.2.0
mypy-extensions==0.4.3
packaging==21.3
parso==0.8.3
pathspec==0.9.0
pep8==1.7.1
platformdirs==2.4.1
pluggy==1.0.0
py==1.11.0
pyaml==21.10.1
pyflakes==2.4.0
pylint==2.12.2
pyparsing==3.0.6
psycopg2-binary==2.9.5
pytest==6.2.5
pytest-cov==3.0.0
pytest-django==4.5.2
pytest-forked==1.4.0
pytest-xdist==3.0.2
python-dateutil==2.8.2
python-monkey-business==1.0.0
pytz==2021.3
PyYAML==6.0
rope==0.22.0
six==1.16.0
sqlparse==0.4.3
text-unidecode==1.3
toml==0.10.2
tomli==1.2.3
typing-extensions==4.4.0
wrapt==1.13.3
yapf==0.32.0