From 4de7e5b5e1cab4d9da8177ebc230b7a4e0556fa5 Mon Sep 17 00:00:00 2001 From: Max Date: Sun, 18 Dec 2022 15:52:49 +0100 Subject: [PATCH] packages/reflex-cache: convert to buildPythonPackage --- packages/projects.nix | 19 +- packages/servers/reflex-cache/poetry.lock | 206 ---------------------- packages/servers/reflex-cache/project.nix | 38 ++++ 3 files changed, 39 insertions(+), 224 deletions(-) delete mode 100644 packages/servers/reflex-cache/poetry.lock create mode 100644 packages/servers/reflex-cache/project.nix diff --git a/packages/projects.nix b/packages/projects.nix index 3750edb..9e4212d 100644 --- a/packages/projects.nix +++ b/packages/projects.nix @@ -29,6 +29,7 @@ ./networking/hyprspace/project.nix ./networking/ipfs-cluster/project.nix + ./servers/reflex-cache/project.nix ./websites/landing/project.nix ./websites/stop-using-nix-env/project.nix ]; @@ -71,11 +72,6 @@ privatevoid-smart-card-ca-bundle = pkgs.callPackage ./data/privatevoid-smart-card-certificate-authority-bundle.nix { }; - reflex-cache = poetry2nix.mkPoetryApplication { - projectDir = ./servers/reflex-cache; - meta.mainProgram = "reflex"; - }; - searxng = pkgs.callPackage ./web-apps/searxng { inherit pins; }; sips = pkgs.callPackage ./servers/sips { }; @@ -99,19 +95,6 @@ env.NPINS_DIRECTORY.eval = "$REPO_ROOT/packages/sources"; }; - reflex-cache = let - inherit (self'.packages) reflex-cache; - in { - packages = [ - reflex-cache.dependencyEnv - ]; - - tools = [ - pkgs.poetry - ]; - - env.PYTHON = reflex-cache.dependencyEnv.interpreter; - }; }; }; } \ No newline at end of file diff --git a/packages/servers/reflex-cache/poetry.lock b/packages/servers/reflex-cache/poetry.lock deleted file mode 100644 index 535c374..0000000 --- a/packages/servers/reflex-cache/poetry.lock +++ /dev/null @@ -1,206 +0,0 @@ -[[package]] -name = "base58" -version = "2.1.1" -description = "Base58 and Base58Check implementation." -category = "main" -optional = false -python-versions = ">=3.5" - -[package.extras] -tests = ["PyHamcrest (>=2.0.2)", "mypy", "pytest (>=4.6)", "pytest-benchmark", "pytest-cov", "pytest-flake8"] - -[[package]] -name = "certifi" -version = "2022.5.18.1" -description = "Python package for providing Mozilla's CA Bundle." -category = "main" -optional = false -python-versions = ">=3.6" - -[[package]] -name = "charset-normalizer" -version = "2.0.12" -description = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet." -category = "main" -optional = false -python-versions = ">=3.5.0" - -[package.extras] -unicode_backport = ["unicodedata2"] - -[[package]] -name = "idna" -version = "3.3" -description = "Internationalized Domain Names in Applications (IDNA)" -category = "main" -optional = false -python-versions = ">=3.5" - -[[package]] -name = "morphys" -version = "1.0" -description = "Smart conversions between unicode and bytes types for common cases" -category = "main" -optional = false -python-versions = "*" - -[[package]] -name = "multiaddr" -version = "0.0.9" -description = "Python implementation of jbenet's multiaddr" -category = "main" -optional = false -python-versions = ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*" - -[package.dependencies] -base58 = "*" -netaddr = "*" -six = "*" -varint = "*" - -[[package]] -name = "netaddr" -version = "0.8.0" -description = "A network address manipulation library for Python" -category = "main" -optional = false -python-versions = "*" - -[[package]] -name = "py-multibase" -version = "1.0.3" -description = "Multibase implementation for Python" -category = "main" -optional = false -python-versions = "*" - -[package.dependencies] -morphys = ">=1.0,<2.0" -python-baseconv = ">=1.2.0,<2.0" -six = ">=1.10.0,<2.0" - -[[package]] -name = "python-baseconv" -version = "1.2.2" -description = "Convert numbers from base 10 integers to base X strings and back again." -category = "main" -optional = false -python-versions = "*" - -[[package]] -name = "requests" -version = "2.28.1" -description = "Python HTTP for Humans." -category = "main" -optional = false -python-versions = ">=3.7, <4" - -[package.dependencies] -certifi = ">=2017.4.17" -charset-normalizer = ">=2,<3" -idna = ">=2.5,<4" -urllib3 = ">=1.21.1,<1.27" - -[package.extras] -socks = ["PySocks (>=1.5.6,!=1.5.7)"] -use_chardet_on_py3 = ["chardet (>=3.0.2,<6)"] - -[[package]] -name = "requests-unixsocket" -version = "0.3.0" -description = "Use requests to talk HTTP via a UNIX domain socket" -category = "main" -optional = false -python-versions = "*" - -[package.dependencies] -requests = ">=1.1" - -[[package]] -name = "six" -version = "1.16.0" -description = "Python 2 and 3 compatibility utilities" -category = "main" -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*" - -[[package]] -name = "urllib3" -version = "1.26.9" -description = "HTTP library with thread-safe connection pooling, file post, and more." -category = "main" -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <4" - -[package.extras] -brotli = ["brotli (>=1.0.9)", "brotlicffi (>=0.8.0)", "brotlipy (>=0.6.0)"] -secure = ["certifi", "cryptography (>=1.3.4)", "idna (>=2.0.0)", "ipaddress", "pyOpenSSL (>=0.14)"] -socks = ["PySocks (>=1.5.6,!=1.5.7,<2.0)"] - -[[package]] -name = "varint" -version = "1.0.2" -description = "Simple python varint implementation" -category = "main" -optional = false -python-versions = "*" - -[metadata] -lock-version = "1.1" -python-versions = "^3.9" -content-hash = "1aca01c6fbf7de9a1b0713ad1cab2892c705c19f48c546c3013a405ae5b01737" - -[metadata.files] -base58 = [ - {file = "base58-2.1.1-py3-none-any.whl", hash = "sha256:11a36f4d3ce51dfc1043f3218591ac4eb1ceb172919cebe05b52a5bcc8d245c2"}, - {file = "base58-2.1.1.tar.gz", hash = "sha256:c5d0cb3f5b6e81e8e35da5754388ddcc6d0d14b6c6a132cb93d69ed580a7278c"}, -] -certifi = [ - {file = "certifi-2022.5.18.1-py3-none-any.whl", hash = "sha256:f1d53542ee8cbedbe2118b5686372fb33c297fcd6379b050cca0ef13a597382a"}, - {file = "certifi-2022.5.18.1.tar.gz", hash = "sha256:9c5705e395cd70084351dd8ad5c41e65655e08ce46f2ec9cf6c2c08390f71eb7"}, -] -charset-normalizer = [ - {file = "charset-normalizer-2.0.12.tar.gz", hash = "sha256:2857e29ff0d34db842cd7ca3230549d1a697f96ee6d3fb071cfa6c7393832597"}, - {file = "charset_normalizer-2.0.12-py3-none-any.whl", hash = "sha256:6881edbebdb17b39b4eaaa821b438bf6eddffb4468cf344f09f89def34a8b1df"}, -] -idna = [ - {file = "idna-3.3-py3-none-any.whl", hash = "sha256:84d9dd047ffa80596e0f246e2eab0b391788b0503584e8945f2368256d2735ff"}, - {file = "idna-3.3.tar.gz", hash = "sha256:9d643ff0a55b762d5cdb124b8eaa99c66322e2157b69160bc32796e824360e6d"}, -] -morphys = [ - {file = "morphys-1.0-py2.py3-none-any.whl", hash = "sha256:76d6dbaa4d65f597e59d332c81da786d83e4669387b9b2a750cfec74e7beec20"}, -] -multiaddr = [ - {file = "multiaddr-0.0.9-py2.py3-none-any.whl", hash = "sha256:5c0f862cbcf19aada2a899f80ef896ddb2e85614e0c8f04dd287c06c69dac95b"}, - {file = "multiaddr-0.0.9.tar.gz", hash = "sha256:30b2695189edc3d5b90f1c303abb8f02d963a3a4edf2e7178b975eb417ab0ecf"}, -] -netaddr = [ - {file = "netaddr-0.8.0-py2.py3-none-any.whl", hash = "sha256:9666d0232c32d2656e5e5f8d735f58fd6c7457ce52fc21c98d45f2af78f990ac"}, - {file = "netaddr-0.8.0.tar.gz", hash = "sha256:d6cc57c7a07b1d9d2e917aa8b36ae8ce61c35ba3fcd1b83ca31c5a0ee2b5a243"}, -] -py-multibase = [ - {file = "py-multibase-1.0.3.tar.gz", hash = "sha256:d28a20efcbb61eec28f55827a0bf329c7cea80fffd933aecaea6ae8431267fe4"}, - {file = "py_multibase-1.0.3-py2.py3-none-any.whl", hash = "sha256:2677c1fafcc0ae15ddb9c7f444c5becc2530b3889124fd4fa2959ddfefb8c15b"}, -] -python-baseconv = [ - {file = "python-baseconv-1.2.2.tar.gz", hash = "sha256:0539f8bd0464013b05ad62e0a1673f0ac9086c76b43ebf9f833053527cd9931b"}, -] -requests = [ - {file = "requests-2.28.1-py3-none-any.whl", hash = "sha256:8fefa2a1a1365bf5520aac41836fbee479da67864514bdb821f31ce07ce65349"}, - {file = "requests-2.28.1.tar.gz", hash = "sha256:7c5599b102feddaa661c826c56ab4fee28bfd17f5abca1ebbe3e7f19d7c97983"}, -] -requests-unixsocket = [ - {file = "requests-unixsocket-0.3.0.tar.gz", hash = "sha256:28304283ea9357d45fff58ad5b11e47708cfbf5806817aa59b2a363228ee971e"}, - {file = "requests_unixsocket-0.3.0-py2.py3-none-any.whl", hash = "sha256:c685c680f0809e1b2955339b1e5afc3c0022b3066f4f7eb343f43a6065fc0e5d"}, -] -six = [ - {file = "six-1.16.0-py2.py3-none-any.whl", hash = "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254"}, - {file = "six-1.16.0.tar.gz", hash = "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926"}, -] -urllib3 = [ - {file = "urllib3-1.26.9-py2.py3-none-any.whl", hash = "sha256:44ece4d53fb1706f667c9bd1c648f5469a2ec925fcf3a776667042d645472c14"}, - {file = "urllib3-1.26.9.tar.gz", hash = "sha256:aabaf16477806a5e1dd19aa41f8c2b7950dd3c746362d7e3223dbe6de6ac448e"}, -] -varint = [ - {file = "varint-1.0.2.tar.gz", hash = "sha256:a6ecc02377ac5ee9d65a6a8ad45c9ff1dac8ccee19400a5950fb51d594214ca5"}, -] diff --git a/packages/servers/reflex-cache/project.nix b/packages/servers/reflex-cache/project.nix new file mode 100644 index 0000000..3453f05 --- /dev/null +++ b/packages/servers/reflex-cache/project.nix @@ -0,0 +1,38 @@ +{ config, drv-backends, inputs, lib, pkgs, ... }: + +let + deps = with config.dependencySets.python3Packages; [ + poetry-core + requests-unixsocket + py-multibase + py-multiaddr + ]; + + pythonForDev = pkgs.python3.withPackages (lib.const deps); +in +{ + projectShells.reflex-cache = { + tools = [ + pythonForDev + ]; + env.PYTHON = pythonForDev.interpreter; + commands.reflex.command = "${pythonForDev.interpreter} -m reflex_cache.main"; + }; + drvs.reflex-cache = { dependencySets, ... }: { + imports = [ + drv-backends.buildPythonPackage + ]; + pyprojectToml = ./pyproject.toml; + inherit (pkgs) stdenv; + + propagatedBuildInputs = deps; + + src = with inputs.nix-filter.lib; filter { + root = ./.; + include = [ + "pyproject.toml" + (inDirectory "reflex_cache") + ]; + }; + }; +}