This commit is contained in:
Jeffrey C. Ollie 2023-08-29 15:42:03 -05:00
parent a5d5c91303
commit df62d68e15
Signed by: jeff
GPG key ID: 6F86035A6D97044E
4 changed files with 870 additions and 776 deletions

View file

@ -1,12 +1,30 @@
{ {
"nodes": { "nodes": {
"flake-utils": { "bash": {
"locked": { "locked": {
"lastModified": 1678901627, "lastModified": 1678247195,
"narHash": "sha256-U02riOqrKKzwjsxc/400XnElV+UtPUQWpANPlyazjH0=", "narHash": "sha256-m/wSwlSket+hob3JED4XUvoWJLtW7yhtOiZrlRDMShs=",
"ref": "refs/heads/main",
"rev": "e7a00dcc0e75bc3ef6856bdd94d7d809245f5636",
"revCount": 1,
"type": "git",
"url": "https://git.ocjtech.us/jeff/nixos-bash-prompt-builder.git"
},
"original": {
"type": "git",
"url": "https://git.ocjtech.us/jeff/nixos-bash-prompt-builder.git"
}
},
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1692799911,
"narHash": "sha256-3eihraek4qL744EvQXsK1Ha6C3CR7nnT8X2qWap4RNk=",
"owner": "numtide", "owner": "numtide",
"repo": "flake-utils", "repo": "flake-utils",
"rev": "93a2b84fc4b70d9e089d029deacc3583435c2ed6", "rev": "f9e7cf818399d17d347f847525c5a5a8032e4e44",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -15,25 +33,134 @@
"type": "github" "type": "github"
} }
}, },
"flake-utils_2": {
"inputs": {
"systems": "systems_2"
},
"locked": {
"lastModified": 1689068808,
"narHash": "sha256-6ixXo3wt24N/melDWjq70UuHQLxGV8jZvooRanIHXw0=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "919d646de7be200f3bf08cb76ae1f09402b6f9b4",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"make-shell": {
"locked": {
"lastModified": 1634940815,
"narHash": "sha256-P69OmveboXzS+es1vQGS4bt+ckwbeIExqxfGLjGuJqA=",
"owner": "ursi",
"repo": "nix-make-shell",
"rev": "8add91681170924e4d0591b22f294aee3f5516f9",
"type": "github"
},
"original": {
"owner": "ursi",
"repo": "nix-make-shell",
"type": "github"
}
},
"nix-github-actions": {
"inputs": {
"nixpkgs": [
"poetry2nix",
"nixpkgs"
]
},
"locked": {
"lastModified": 1688870561,
"narHash": "sha256-4UYkifnPEw1nAzqqPOTL2MvWtm3sNGw1UTYTalkTcGY=",
"owner": "nix-community",
"repo": "nix-github-actions",
"rev": "165b1650b753316aa7f1787f3005a8d2da0f5301",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nix-github-actions",
"type": "github"
}
},
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1679944645, "lastModified": 1693231525,
"narHash": "sha256-e5Qyoe11UZjVfgRfwNoSU57ZeKuEmjYb77B9IVW7L/M=", "narHash": "sha256-Zmh8m0HHcgGBDth6jdJPmc4UAAP0L4jQmqIztywF1Iw=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "4bb072f0a8b267613c127684e099a70e1f6ff106", "rev": "c540061ac8d72d6e6d99345bd2d590c82b2f58c1",
"type": "github" "type": "github"
}, },
"original": { "original": {
"id": "nixpkgs", "id": "nixpkgs",
"ref": "nixos-unstable", "ref": "nixos-23.05",
"type": "indirect" "type": "indirect"
} }
}, },
"poetry2nix": {
"inputs": {
"flake-utils": "flake-utils_2",
"nix-github-actions": "nix-github-actions",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1693051011,
"narHash": "sha256-HNbuVCS/Fnl1YZOjBk9/MlIem+wM8fvIzTH0CVQrLSQ=",
"owner": "nix-community",
"repo": "poetry2nix",
"rev": "5b3a5151cf212021ff8d424f215fb030e4ff2837",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "poetry2nix",
"type": "github"
}
},
"root": { "root": {
"inputs": { "inputs": {
"bash": "bash",
"flake-utils": "flake-utils", "flake-utils": "flake-utils",
"nixpkgs": "nixpkgs" "make-shell": "make-shell",
"nixpkgs": "nixpkgs",
"poetry2nix": "poetry2nix"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"systems_2": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
} }
} }
}, },

107
flake.nix
View file

@ -3,45 +3,69 @@
inputs = { inputs = {
nixpkgs = { nixpkgs = {
url = "nixpkgs/nixos-unstable"; url = "nixpkgs/nixos-23.05";
};
poetry2nix = {
url = "github:nix-community/poetry2nix";
inputs.nixpkgs.follows = "nixpkgs";
}; };
flake-utils = { flake-utils = {
url = "github:numtide/flake-utils"; url = "github:numtide/flake-utils";
}; };
bash = {
url = "git+https://git.ocjtech.us/jeff/nixos-bash-prompt-builder.git";
}; };
outputs = { self, nixpkgs, flake-utils, ... }@inputs: make-shell = {
url = "github:ursi/nix-make-shell";
};
};
outputs = { self, nixpkgs, poetry2nix, flake-utils, bash, make-shell, ... }@inputs:
flake-utils.lib.eachDefaultSystem flake-utils.lib.eachDefaultSystem
(system: (system:
let let
inherit (poetry2nix.legacyPackages.${system}) mkPoetryApplication overrides;
pkgs = import nixpkgs { pkgs = import nixpkgs {
inherit system; inherit system;
}; };
in in
{ {
devShells.default = devShells.default =
# let let
# python = pkgs.python310.withPackages (ps: with ps; [ make-shell = import inputs.make-shell {
# poetry-core inherit system;
# ]); pkgs = pkgs;
# in };
pkgs.mkShell { python = pkgs.python311.withPackages (ps: with ps; [
buildInputs = [ poetry-core
#python ]);
project = "greendeck";
prompt = (
bash.build_prompt
bash.ansi_normal_blue
"${project} - ${bash.username}@${bash.hostname_short}: ${bash.current_working_directory}"
"${project}:${bash.current_working_directory}"
);
in
make-shell {
packages = [
python
pkgs.poetry pkgs.poetry
pkgs.hidapi pkgs.hidapi
pkgs.libusb1 pkgs.libusb1
]; ];
shellHook = '' env = {
export HIDAPI_HOME=${pkgs.hidapi} HIDAPI_HOME = pkgs.hidapi;
export MAGICK_HOME=${pkgs.imagemagickBig} MAGICK_HOME = pkgs.imagemagickBig;
export POETRY_VIRTUALENVS_IN_PROJECT=true POETRY_VIRTUALENVS_IN_PROJECT = "true";
export PS1='\[\033[1;34m\][greendeck:\w]\$\[\033[0m\] ' PS1 = prompt;
};
setup = ''
export PATH=''$(pwd)/.venv/bin:$PATH export PATH=''$(pwd)/.venv/bin:$PATH
''; '';
}; };
packages = { packages = {
greendeck = pkgs.poetry2nix.mkPoetryApplication { greendeck = mkPoetryApplication {
python = pkgs.python310; python = pkgs.python311;
projectDir = ./.; projectDir = ./.;
propagatedBuildInputs = [ propagatedBuildInputs = [
pkgs.hidapi pkgs.hidapi
@ -52,7 +76,7 @@
'os.getenv("HIDAPI_LIBRARY")' \ 'os.getenv("HIDAPI_LIBRARY")' \
'"${pkgs.hidapi}/lib/libhidapi-libusb.so.0"' '"${pkgs.hidapi}/lib/libhidapi-libusb.so.0"'
''; '';
overrides = pkgs.poetry2nix.overrides.withDefaults overrides = overrides.withDefaults
( (
self: super: { self: super: {
wand = super.wand.overridePythonAttrs wand = super.wand.overridePythonAttrs
@ -67,36 +91,41 @@
propagatedBuildInputs = old.propagatedBuildInputs ++ [ pkgs.imagemagickBig ]; propagatedBuildInputs = old.propagatedBuildInputs ++ [ pkgs.imagemagickBig ];
} }
); );
types-deprecated = super.types-deprecated.overridePythonAttrs ( # types-deprecated = super.types-deprecated.overridePythonAttrs (
old: { # old: {
buildInputs = old.buildInputs ++ [ pkgs.python3Packages.setuptools ]; # buildInputs = old.buildInputs ++ [ pkgs.python3Packages.setuptools ];
} # }
); # );
pydantic-yaml = super.pydantic-yaml.overridePythonAttrs ( pydantic-yaml = super.pydantic-yaml.overridePythonAttrs (
old: { old: {
buildInputs = old.buildInputs ++ [ pkgs.python3Packages.setuptools ]; buildInputs = old.buildInputs ++ [ pkgs.python311Packages.setuptools ];
} }
); );
pydocstyle = super.pydocstyle.overridePythonAttrs ( # pydocstyle = super.pydocstyle.overridePythonAttrs (
old: { # old: {
buildInputs = old.buildInputs ++ [ # buildInputs = old.buildInputs ++ [
# # pkgs.python3Packages.poetry-core
# ];
# }
# );
# pydocstringformatter = super.pydocstringformatter.overridePythonAttrs (
# old: {
# buildInputs = old.buildInputs ++ [
# pkgs.python3Packages.poetry-core # pkgs.python3Packages.poetry-core
]; # pkgs.python3Packages.setuptools
} # ];
); # }
pydocstringformatter = super.pydocstringformatter.overridePythonAttrs ( # );
old: {
buildInputs = old.buildInputs ++ [
pkgs.python3Packages.poetry-core
pkgs.python3Packages.setuptools
];
}
);
asyncdbus = super.asyncdbus.overridePythonAttrs ( asyncdbus = super.asyncdbus.overridePythonAttrs (
old: { old: {
buildInputs = old.buildInputs ++ [ pkgs.python3Packages.setuptools-scm ]; buildInputs = old.buildInputs ++ [ pkgs.python311Packages.setuptools-scm ];
} }
); );
# Pillow = super.Pillow.overridePythonAttrs (
# old: {
# buildInputs = old.buildInputs ++ [ pkgs.python311Packages.setuptools-scm ];
# }
# );
} }
); );
}; };

1359
poetry.lock generated

File diff suppressed because it is too large Load diff

View file

@ -5,18 +5,18 @@ description = ""
authors = ["Jeffrey C. Ollie <jeff@ocjtech.us>"] authors = ["Jeffrey C. Ollie <jeff@ocjtech.us>"]
[tool.poetry.dependencies] [tool.poetry.dependencies]
python = "^3.10" python = "^3.11"
pydantic = "^1.10.2" pydantic = "<2"
hyperlink = "^21.0.0" hyperlink = "^21.0.0"
websockets = "^10.4" websockets = "^11.0.3"
Pillow = "^9.3.0" Pillow = "^10.0.0"
Wand = "^0.6.7" Wand = "^0.6.11"
aiohttp = "^3.8.3" aiohttp = "^3.8.5"
pydantic-yaml = { extras = ["ruamel"], version = "^0.8.1" } pydantic-yaml = "<2"
xdg = "^5.1.1" xdg = "^6.0.0"
aiopath = "^0.6.11" aiopath = "^0.6.11"
arrow = "^1.2.3" arrow = "^1.2.3"
click = "^8.1.3" click = "^8.1.7"
asyncdbus = "^0.6.1" asyncdbus = "^0.6.1"
outcome = "^1.2.0" outcome = "^1.2.0"
@ -25,16 +25,15 @@ greendeck = "greendeck.main:main"
test = "greendeck.mpristest:main" test = "greendeck.mpristest:main"
[tool.poetry.group.dev.dependencies] [tool.poetry.group.dev.dependencies]
pylint = "^2.15.8" pylint = "^2.17.5"
pydocstringformatter = "^0.7.2" pydocstyle = "^6.3.0"
pydocstyle = { extras = ["toml"], version = "^6.1.1" } black = "^23.7.0"
black = "^22.12.0" flake8 = "^6.1.0"
flake8 = "^6.0.0" flake8-pyproject = "^1.2.3"
flake8-pyproject = "^1.2.2" isort = "^5.12.0"
isort = "^5.11.1"
[build-system] [build-system]
requires = ["poetry-core==1.5.1"] requires = ["poetry-core==1.6.1"]
build-backend = "poetry.core.masonry.api" build-backend = "poetry.core.masonry.api"
[tool.black] [tool.black]