diff --git a/default.nix b/default.nix index f9190fb..05aa0d8 100644 --- a/default.nix +++ b/default.nix @@ -19,6 +19,7 @@ pkgs.python3Packages.buildPythonPackage rec { cryptography ]; + # nativeCheckInputs = [ pkgs.python3Packages.pytestCheckHook ]; pythonImportsCheck = [ "smtprd_ng" ]; meta = { diff --git a/devenv.nix b/devenv.nix index 72b3f9c..4618f7b 100644 --- a/devenv.nix +++ b/devenv.nix @@ -5,20 +5,20 @@ , ... }: +let + req = pkgs.concatText "req" [ + ./requirements.txt + ./requirements-dev.txt + ]; +in + { - # https://devenv.sh/basics/ - # env.GREET = "devenv"; - # https://devenv.sh/packages/ - packages = [ pkgs.file pkgs.swig4 pkgs.openssl ]; - - # https://devenv.sh/scripts/ - # scripts.hello.exec = "echo hello from $GREET"; - - # enterShell = '' - # hello - # git --version - # ''; + packages = [ + pkgs.file + pkgs.swig4 + pkgs.openssl + ]; # https://devenv.sh/tests/ # enterTest = '' @@ -35,7 +35,7 @@ enable = true; venv = { enable = true; - requirements = ./requirements.txt; + requirements = builtins.readFile req; }; }; @@ -54,7 +54,6 @@ pylint.enable = true; detect-private-keys.enable = true; - }; # https://devenv.sh/processes/ diff --git a/pyproject.toml b/pyproject.toml index d0e1a42..18bd41e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,14 +7,11 @@ name = "smtprd-ng" version = "0.0.1" description = "SMTP forwarding relay daemon with signing and encryption" authors = [{ name = "Florian Brandes", email = "dev@mail.flo-the.dev" }] -classifiers = ["License :: OSI Approved :: GNU Affero General Public License v3" ] -license = { text = "MIT License" } -dependencies = [ - "aiosmtpd", - "aiosmtplib", - "M2Crypto", - "cryptography", +classifiers = [ + "License :: OSI Approved :: GNU Affero General Public License v3", ] +license = { text = "MIT License" } +dependencies = ["aiosmtpd", "aiosmtplib", "M2Crypto", "cryptography"] requires-python = ">=3.10" keywords = ["smtp", "smime"] @@ -23,3 +20,6 @@ smtprd-ng = "smtprd_ng.smtprd:main" [project.urls] Repository = "https://app.radicle.xyz/nodes/seed.radicle.garden/rad:z3gWc1qgaeZaoGwL4WTstLNoqjayM" + +[project.optional-dependencies] +tests = ["pytest", "pytest-cov"] diff --git a/requirements-dev.txt b/requirements-dev.txt new file mode 100644 index 0000000..cffeec6 --- /dev/null +++ b/requirements-dev.txt @@ -0,0 +1,2 @@ +pytest +pytest-cov \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index b997fad..d396786 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ aiosmtpd aiosmtplib M2Crypto -cryptography \ No newline at end of file +cryptography