Skip to content

Commit f51836b

Browse files
fix: Remove poetry2nix (#58)
* fix: Remove poetry2nix * version number --------- Co-authored-by: lou lecrivain <[email protected]>
1 parent cbadbc8 commit f51836b

File tree

6 files changed

+75
-71
lines changed

6 files changed

+75
-71
lines changed

cosmo/log.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,9 @@ def formatMessage(self, m: M) -> str:
105105
color = "red"
106106
case _:
107107
color = "white"
108-
log_level_colored = colored(log_level, color)
108+
109+
# Type Ignore is fixed with termcolor v3.
110+
log_level_colored = colored(log_level, color) # type: ignore
109111
default_log = f"[{log_level_colored}] {message}"
110112
match obj:
111113
case AbstractNetboxType():

flake.lock

Lines changed: 22 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,14 @@
33

44
inputs.flake-utils.url = "github:numtide/flake-utils";
55
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable-small";
6-
inputs.poetry2nix = {
7-
url = "github:nix-community/poetry2nix";
8-
inputs.nixpkgs.follows = "nixpkgs";
9-
};
106

117
outputs = { self, nixpkgs, flake-utils, poetry2nix }:
128
{
139
# Nixpkgs overlay providing the application
1410
overlay = nixpkgs.lib.composeManyExtensions [
15-
poetry2nix.overlays.default
1611
(final: prev: {
1712
# The application
18-
cosmo = prev.poetry2nix.mkPoetryApplication {
19-
projectDir = ./.;
20-
21-
# This disables the build of mypy, which just takes too long.
22-
check = false;
23-
checkGroups = [];
24-
};
13+
cosmo = final.callPackage ./package.nix {};
2514
})
2615
];
2716
} // (flake-utils.lib.eachDefaultSystem (system:
@@ -38,15 +27,21 @@
3827
};
3928

4029
devShell = pkgs.mkShell {
41-
buildInputs = with pkgs; [
42-
black
43-
poetry
44-
(pkgs.poetry2nix.mkPoetryEnv {
45-
projectDir = ./.;
46-
editablePackageSources = {
47-
cosmo = ./cosmo;
48-
};
49-
})
30+
buildInputs = [
31+
(pkgs.python3.withPackages (python-pkgs: with python-pkgs; [
32+
requests
33+
pyyaml
34+
packaging
35+
deepmerge
36+
termcolor
37+
# Dev Dependencies
38+
mypy
39+
pytest
40+
pytest-cov
41+
pytest-mock
42+
types-pyyaml
43+
types-requests
44+
]))
5045
];
5146
};
5247
}));

package.nix

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{ python3Packages, ... }:
2+
3+
python3Packages.buildPythonApplication rec {
4+
pname = "cosmo";
5+
version = "0.10.1";
6+
pyproject = true;
7+
8+
src = ./.;
9+
10+
build-system = with python3Packages; [
11+
poetry-core
12+
];
13+
14+
dependencies = with python3Packages; [
15+
requests
16+
pyyaml
17+
packaging
18+
deepmerge
19+
termcolor
20+
];
21+
}

poetry.lock

Lines changed: 12 additions & 39 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ requests = ">2.26.0"
1414
PyYAML = ">5.1"
1515
packaging = "^24"
1616
deepmerge = "^2.0"
17-
termcolor = "^3.0.1"
17+
termcolor = "^2.4.0"
1818

1919
[tool.poetry.dev-dependencies]
2020

0 commit comments

Comments
 (0)