From c0e3d0e72d9d636728a5171511e3ce1003203567 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 10 Apr 2023 20:56:16 +0200 Subject: bump --- overlays/smartprom/default.nix | 36 ++++++++++++++++++------------------ overlays/smartprom/poetry.lock | 21 +++++++++++++++++++++ overlays/smartprom/pyproject.toml | 16 ++++++++++++++++ overlays/smartprom/setup.py | 11 ----------- 4 files changed, 55 insertions(+), 29 deletions(-) create mode 100644 overlays/smartprom/poetry.lock create mode 100644 overlays/smartprom/pyproject.toml delete mode 100644 overlays/smartprom/setup.py (limited to 'overlays/smartprom') diff --git a/overlays/smartprom/default.nix b/overlays/smartprom/default.nix index 807f3f84..57ab6f11 100644 --- a/overlays/smartprom/default.nix +++ b/overlays/smartprom/default.nix @@ -1,21 +1,21 @@ -{ final, prev, flakeInputs, sources, ... }: -let - inherit (prev.stdenv.targetPlatform) system; -in { - smartprom = flakeInputs.mach-nix.lib.${system}.buildPythonPackage rec { - inherit (sources.smartprom) src pname version; - ignoreDataOutdated = true; +{ prev, sources, ... }: +{ + smartprom = + with prev.poetry2nix; + mkPoetryApplication { + inherit (sources.smartprom) pname version; + projectDir = cleanPythonSources { + src = prev.runCommand "sources" {} '' + mkdir $out + cp -r ${sources.smartprom.src}/. $out - prePatch = '' - mkdir smartprom - mv smartprom.py smartprom/__main__.py - echo >> smartprom/__init__.py + mkdir $out/smartprom + mv $out/smartprom.py $out/smartprom/__main__.py + echo >> $out/smartprom/__init__.py - substituteAll ${./setup.py} ./setup.py - ''; - - requirements = '' - prometheus_client - ''; - }; + cp ${./pyproject.toml} $out/pyproject.toml + cp ${./poetry.lock} $out/poetry.lock + ''; + }; + }; } diff --git a/overlays/smartprom/poetry.lock b/overlays/smartprom/poetry.lock new file mode 100644 index 00000000..de8be1f8 --- /dev/null +++ b/overlays/smartprom/poetry.lock @@ -0,0 +1,21 @@ +# This file is automatically @generated by Poetry and should not be changed by hand. + +[[package]] +name = "prometheus-client" +version = "0.16.0" +description = "Python client for the Prometheus monitoring system." +category = "main" +optional = false +python-versions = ">=3.6" +files = [ + {file = "prometheus_client-0.16.0-py3-none-any.whl", hash = "sha256:0836af6eb2c8f4fed712b2f279f6c0a8bbab29f9f4aa15276b91c7cb0d1616ab"}, + {file = "prometheus_client-0.16.0.tar.gz", hash = "sha256:a03e35b359f14dd1630898543e2120addfdeacd1a6069c1367ae90fd93ad3f48"}, +] + +[package.extras] +twisted = ["twisted"] + +[metadata] +lock-version = "2.0" +python-versions = ">=3.10.0,<3.12" +content-hash = "a84309056a73a8051b1c506324a43036ecfa6e4584882d2ec30ef1d6e030b1a1" diff --git a/overlays/smartprom/pyproject.toml b/overlays/smartprom/pyproject.toml new file mode 100644 index 00000000..ad58bd51 --- /dev/null +++ b/overlays/smartprom/pyproject.toml @@ -0,0 +1,16 @@ +[tool.poetry] +name = "smartprom" +version = "2.2.0" +authors = [] +description = "" + +[tool.poetry.scripts] +smartprom = "smartprom.__main__:main" + +[tool.poetry.dependencies] +python = ">=3.10.0,<3.12" +prometheus-client = "^0.16.0" + +[build-system] +requires = ["poetry-core>=1.0.0"] +build-backend = "poetry.core.masonry.api" \ No newline at end of file diff --git a/overlays/smartprom/setup.py b/overlays/smartprom/setup.py deleted file mode 100644 index c30fc557..00000000 --- a/overlays/smartprom/setup.py +++ /dev/null @@ -1,11 +0,0 @@ -from setuptools import setup - -setup(name='@pname@', - version='@version@', - packages=['@pname@'], - entry_points={ - 'console_scripts': [ - '@pname@=@pname@.__main__:main', - ], - } -) -- cgit v1.2.3