Merge remote-tracking branch 'origin/poetry' into dev

This commit is contained in:
Andreas Zweili 2022-11-21 11:10:29 +01:00
commit fe1f233f2f
8 changed files with 1157 additions and 104 deletions

View File

@ -59,7 +59,7 @@ clean:
.PHONY: cleanall
cleanall: clean
docker-compose -f docker-compose-development.yml down -v --rmi local
rm venv
rm -r .venv
.PHONY: init
init:

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,68 +30,49 @@
"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": 1668766498,
"narHash": "sha256-UjZlIrbHGlL3H3HZNPTxPSwJfr49jIfbPWCYxk0EQm4=",
"lastModified": 1668765800,
"narHash": "sha256-rC40+/W6Hio7b/RsY8SvQPKNx4WqNcTgfYv8cUMAvJk=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "f42a45c015f28ac3beeb0df360e50cdbf495d44b",
"rev": "52b2ac8ae18bbad4374ff0dd5aeee0fdf1aea739",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-22.05",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"pypi": {
"flake": false,
"poetry2nix": {
"inputs": {
"flake-utils": "flake-utils_2",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1668846799,
"narHash": "sha256-f7wWF5RG7nKIdDU7rgE501O3G6mawVATCEoM3xuvduI=",
"owner": "DavHau",
"repo": "pypi-deps-db",
"rev": "b5d66d987817d01d1f5e7bf883d11d762776bbe8",
"lastModified": 1668892083,
"narHash": "sha256-AKK36evl0fHsOIAgKmtwon1LfH0WKn55+J2Yv2dXGPk=",
"owner": "Nebucatnetzer",
"repo": "poetry2nix",
"rev": "283a1398ee9c080c8c3310c8fd1aa937f6e84b62",
"type": "github"
},
"original": {
"owner": "DavHau",
"repo": "pypi-deps-db",
"owner": "Nebucatnetzer",
"repo": "poetry2nix",
"rev": "283a1398ee9c080c8c3310c8fd1aa937f6e84b62",
"type": "github"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"mach-nix": "mach-nix",
"nixpkgs": "nixpkgs",
"pypi": "pypi"
"poetry2nix": "poetry2nix"
}
}
},

View File

@ -1,42 +1,51 @@
{
description = "A Python API for various tools I use at work.";
inputs = {
nixpkgs.url = github:NixOS/nixpkgs/nixos-22.05;
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";
nixpkgs.url = github:NixOS/nixpkgs/nixos-unstable;
flake-utils.url = github:numtide/flake-utils;
poetry2nix = {
url = "github:Nebucatnetzer/poetry2nix?rev=283a1398ee9c080c8c3310c8fd1aa937f6e84b62";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, flake-utils, mach-nix, ... }@inputs:
flake-utils.lib.eachDefaultSystem (system:
};
outputs = { self, nixpkgs, flake-utils, poetry2nix }:
{
overlay = nixpkgs.lib.composeManyExtensions [
poetry2nix.overlay
(final: prev: {
inventory = prev.poetry2nix.mkPoetryEnv {
projectDir = ./.;
overrides = prev.poetry2nix.defaultPoetryOverrides.extend
(self: super: {
python-monkey-business = super.python-monkey-business.overridePythonAttrs
(
old: {
buildInputs = (old.buildInputs or [ ]) ++ [ super.setuptools ];
}
);
});
};
})
];
} // (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
{
devShell = pkgs.mkShell {
buildInputs = [
devEnvironment
pkgs.gnumake
pkgs.python39Packages.pip
pkgs.inventory
pkgs.poetry
];
shellHook = ''
export DJANGO_SETTINGS_MODULE=network_inventory.settings.local
'';
};
packages.venv = devEnvironment;
});
packages.venv = pkgs.inventory;
}));
}

1059
poetry.lock generated Normal file

File diff suppressed because it is too large Load Diff

2
poetry.toml Normal file
View File

@ -0,0 +1,2 @@
[virtualenvs]
in-project = true

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"
PyYAML = "^6.0"
[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,12 +0,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.13.0
django-model-utils==4.2.0
django-nested-admin==3.4.0
django-tables2==2.4.1
gunicorn==20.1.0
psycopg2-binary==2.9.5
PyYAML==6.0

View File

@ -1,26 +0,0 @@
autopep8
black==21.12b0
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.13.0
django-model-utils==4.2.0
django-nested-admin==3.4.0
django-tables2==2.4.1
Faker==12.0.0
flake8
jedi
mixer==7.2.0
pep8==1.7.1
psycopg2-binary==2.9.5
pylint==2.15.5
pytest==6.2.5
pytest-cov==3.0.0
pytest-django==4.5.2
pytest-xdist==3.0.2
PyYAML==6.0
setuptools==61.2.0
yapf