refactor(coloryou): properly package with hatchling
All checks were successful
Discord / discord commits (push) Has been skipped

This commit is contained in:
matt1432 2025-03-22 16:36:57 -04:00
parent 8720d95e76
commit 4128141cb7
4 changed files with 27 additions and 24 deletions

View file

@ -1,25 +1,30 @@
{python3Packages, ...}: let
inherit (builtins.fromTOML (builtins.readFile ./pyproject.toml)) project;
{
# nix build inputs
lib,
buildPythonApplication,
# deps
hatchling,
material-color-utilities,
...
}: let
inherit (builtins) fromTOML readFile;
inherit (fromTOML (readFile ./pyproject.toml)) project;
in
python3Packages.buildPythonPackage {
buildPythonApplication rec {
pname = project.name;
inherit (project) version;
pyproject = true;
format = "pyproject";
src = ./.;
nativeBuildInputs = with python3Packages; [
setuptools
];
propagatedBuildInputs = with python3Packages; [material-color-utilities];
postInstall = ''
mv -v $out/bin/coloryou.py $out/bin/coloryou
'';
build-system = [hatchling];
dependencies = [material-color-utilities];
meta = {
inherit (project) description;
mainProgram = pname;
license = lib.licenses.mit;
homepage = "https://git.nelim.org/matt1432/nixos-configs/src/branch/master/packages/coloryou";
inherit (project) description;
};
}

View file

@ -1,7 +1,3 @@
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"
[project]
name = "coloryou"
description="Get Material You colors from an image."
@ -10,3 +6,10 @@ version = "0.1.0"
dependencies = [
"material_color_utilities_python",
]
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project.scripts]
coloryou = "coloryou:main"

View file

@ -1,5 +0,0 @@
from distutils.core import setup
setup(
scripts=['coloryou.py',],
)

View file

@ -4,7 +4,7 @@
...
}: (final: prev: {
selfPackages = {
coloryou = final.callPackage ./coloryou {};
coloryou = final.python3Packages.callPackage ./coloryou {};
fcft = final.callPackage ./fcft {};