Skip to content

Commit

Permalink
pep427: Fix support for multiple dot-delimited language tags in filen…
Browse files Browse the repository at this point in the history
…ame parsing
  • Loading branch information
adisbladis committed Oct 26, 2023
1 parent 13db812 commit 76a88b9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/pep427.nix
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ in
distribution = mAt 0;
version = mAt 1;
buildTag = mAt 3;
languageTag = mAt 4;
languageTags = filter isString (split "\\." (mAt 4));
abiTag = mAt 5;
platformTags = filter isString (split "\\." (mAt 6));
};
Expand Down
16 changes: 14 additions & 2 deletions lib/test_pep427.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ in
abiTag = "none";
buildTag = "1";
distribution = "distribution";
languageTag = "py27";
languageTags = [ "py27" ];
platformTags = [ "any" ];
version = "1.0";
};
Expand All @@ -22,11 +22,23 @@ in
abiTag = "abi3";
buildTag = null;
distribution = "cryptography";
languageTag = "cp37";
languageTags = [ "cp37" ];
platformTags = [ "manylinux_2_17_aarch64" "manylinux2014_aarch64" ];
version = "41.0.1";
};
};

testMultipleLanguageTags = {
expr = parseFileName "Werkzeug-1.0.0-py2.py3-none-any.whl";
expected = {
abiTag = "none";
buildTag = null;
distribution = "Werkzeug";
languageTags = [ "py2" "py3" ];
platformTags = [ "any" ];
version = "1.0.0";
};
};
};

isWheelFileName = {
Expand Down

0 comments on commit 76a88b9

Please sign in to comment.