Skip to content

Commit

Permalink
Merge pull request fluidattacks#1245 from dsalaza4/main
Browse files Browse the repository at this point in the history
feat(back): fluidattacks#1171 use new builtin
  • Loading branch information
dsalaza4 authored Jan 9, 2024
2 parents ec6d3e6 + f3024ad commit 2a0481c
Show file tree
Hide file tree
Showing 6 changed files with 130 additions and 37 deletions.
5 changes: 1 addition & 4 deletions docs/src/api/builtins/test.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,7 @@ Example:
```nix
{
testPython = {
example = {
python = "3.9";
src = "/test/test-python";
};
example.src = "/test/test-python";
};
}
```
Expand Down
2 changes: 0 additions & 2 deletions makes.nix
Original file line number Diff line number Diff line change
Expand Up @@ -252,11 +252,9 @@
};
testPython = {
example = {
python = "3.12";
src = "/test/test-python";
};
cliMain = {
python = "3.10";
extraFlags = [
"--cov=main"
"--cov-branch"
Expand Down
47 changes: 20 additions & 27 deletions src/args/test-python/default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
makePythonPypiEnvironment,
makePythonEnvironment,
makeSearchPaths,
makeScript,
toBashArray,
Expand All @@ -10,32 +10,25 @@
extraSrcs,
name,
project,
python,
searchPaths,
src,
}: let
pythonPypiEnvironment = makePythonPypiEnvironment {
inherit name;
sourcesYaml =
{
"3.9" = ./pypi-sources-3.9.yaml;
"3.10" = ./pypi-sources-3.10.yaml;
"3.11" = ./pypi-sources-3.11.yaml;
"3.12" = ./pypi-sources-3.12.yaml;
}
.${python};
}:
makeScript {
name = "test-python-for-${name}";
replace = {
__argExtraFlags__ = toBashArray extraFlags;
__argExtraSrcs__ = toBashMap extraSrcs;
__argProject__ = project;
__argSrc__ = src;
};
in
makeScript {
name = "test-python-for-${name}";
replace = {
__argExtraFlags__ = toBashArray extraFlags;
__argExtraSrcs__ = toBashMap extraSrcs;
__argProject__ = project;
__argSrc__ = src;
};
entrypoint = ./entrypoint.sh;
searchPaths = {
source = [pythonPypiEnvironment (makeSearchPaths searchPaths)];
};
}
entrypoint = ./entrypoint.sh;
searchPaths = {
source = [
(makePythonEnvironment {
pythonProjectDir = ./.;
pythonVersion = "3.11";
})
(makeSearchPaths searchPaths)
];
};
}
94 changes: 94 additions & 0 deletions src/args/test-python/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions src/args/test-python/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[tool.poetry]
name = "lint-python-imports"
version = "0.1.0"
description = ""
authors = ["Your Name <[email protected]>"]
readme = "README.md"

[tool.poetry.dependencies]
python = "^3.11"
pytest = "7.2.0"


[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
4 changes: 0 additions & 4 deletions src/evaluator/modules/test-python/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
inherit (args) extraSrcs;
inherit (args) extraFlags;
project = projectPath "/";
inherit (args) python;
inherit (args) searchPaths;
inherit (args) src;
};
Expand All @@ -34,9 +33,6 @@ in {
default = [];
type = lib.types.listOf lib.types.str;
};
python = lib.mkOption {
type = lib.types.enum ["3.9" "3.10" "3.11" "3.12"];
};
searchPaths = lib.mkOption {
default = {};
type = lib.types.attrs;
Expand Down

0 comments on commit 2a0481c

Please sign in to comment.