Skip to content

Commit

Permalink
feat(back): #0 allow mypy 0.971
Browse files Browse the repository at this point in the history
- In this version of mypy, mypy is able to pick
  the type stubs from the PYTHONPATH,
- Allow picking the new version as a feature flag
  so that we can migrate universe to the latest
  version product by product
- Dont document this feature as I plan to remove
  it before the next makes release
  • Loading branch information
kamadorueda committed Sep 15, 2022
1 parent a7a0b98 commit d8d09fb
Show file tree
Hide file tree
Showing 12 changed files with 1,040 additions and 9 deletions.
16 changes: 9 additions & 7 deletions src/args/lint-python/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
makeSearchPaths,
...
}: {
mypyVersion ? "0.910",
name,
python,
searchPaths,
Expand All @@ -31,13 +32,14 @@ makeDerivation {
bin = listOptional isDarwin __nixpkgs__.clang;
};
sourcesYaml =
{
"3.7" = ./pypi-sources-3.7.yaml;
"3.8" = ./pypi-sources-3.8.yaml;
"3.9" = ./pypi-sources-3.9.yaml;
"3.10" = ./pypi-sources-3.10.yaml;
}
.${python};
./.
+ ({
"3.7" = "/mypy-${mypyVersion}/pypi-sources-3.7.yaml";
"3.8" = "/mypy-${mypyVersion}/pypi-sources-3.8.yaml";
"3.9" = "/mypy-${mypyVersion}/pypi-sources-3.9.yaml";
"3.10" = "/mypy-${mypyVersion}/pypi-sources-3.10.yaml";
}
.${python});
withSetuptools_57_4_0 = true;
withSetuptoolsScm_5_0_2 = true;
withWheel_0_37_0 = true;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions src/args/lint-python/mypy-0.971/pypi-deps.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
mypy: '0.971'
prospector: 1.5.1
pylint: 2.11.1
253 changes: 253 additions & 0 deletions src/args/lint-python/mypy-0.971/pypi-sources-3.10.yaml

Large diffs are not rendered by default.

257 changes: 257 additions & 0 deletions src/args/lint-python/mypy-0.971/pypi-sources-3.7.yaml

Large diffs are not rendered by default.

250 changes: 250 additions & 0 deletions src/args/lint-python/mypy-0.971/pypi-sources-3.8.yaml

Large diffs are not rendered by default.

253 changes: 253 additions & 0 deletions src/args/lint-python/mypy-0.971/pypi-sources-3.9.yaml

Large diffs are not rendered by default.

16 changes: 14 additions & 2 deletions src/evaluator/modules/lint-python/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,14 @@
};
};
makeModule = name: {
mypyVersion,
searchPaths,
python,
src,
}: {
name = "/lintPython/module/${name}";
value = lintPython {
inherit mypyVersion;
inherit searchPaths;
inherit name;
inherit python;
Expand All @@ -40,6 +42,7 @@
};
};
makeDirOfModules = name: {
mypyVersion,
searchPaths,
python,
src,
Expand All @@ -50,6 +53,7 @@
name = "/lintPython/dirOfModules/${name}/${moduleName}";
value =
(makeModule moduleName {
inherit mypyVersion;
inherit searchPaths;
inherit python;
src = "${src}/${moduleName}";
Expand All @@ -74,8 +78,12 @@ in {
default = {};
type = lib.types.attrsOf (lib.types.submodule (_: {
options = {
mypyVersion = lib.mkOption {
default = "0.910";
type = lib.types.enum ["0.910" "0.971"];
};
python = lib.mkOption {
type = lib.types.enum ["3.7" "3.8" "3.9"];
type = lib.types.enum ["3.7" "3.8" "3.9" "3.10"];
};
searchPaths = lib.mkOption {
default = {};
Expand Down Expand Up @@ -108,8 +116,12 @@ in {
default = {};
type = lib.types.attrsOf (lib.types.submodule (_: {
options = {
mypyVersion = lib.mkOption {
default = "0.910";
type = lib.types.enum ["0.910" "0.971"];
};
python = lib.mkOption {
type = lib.types.enum ["3.7" "3.8" "3.9"];
type = lib.types.enum ["3.7" "3.8" "3.9" "3.10"];
};
searchPaths = lib.mkOption {
default = {};
Expand Down

0 comments on commit d8d09fb

Please sign in to comment.