diff --git a/projects/reqsort/BUILD b/projects/reqsort/BUILD new file mode 100644 index 0000000..7db9662 --- /dev/null +++ b/projects/reqsort/BUILD @@ -0,0 +1,7 @@ +py_binary( + name = "reqsort", + main = "__main__.py", + deps = [ + py_requirement("click"), + ] +) diff --git a/projects/reqsort/README.md b/projects/reqsort/README.md new file mode 100644 index 0000000..b4d4f87 --- /dev/null +++ b/projects/reqsort/README.md @@ -0,0 +1,3 @@ +# reqsort + +A `requirements.txt` formatter and sorter. diff --git a/tools/python/reqsort.py b/projects/reqsort/__main__.py similarity index 99% rename from tools/python/reqsort.py rename to projects/reqsort/__main__.py index cc66717..6d86da9 100644 --- a/tools/python/reqsort.py +++ b/projects/reqsort/__main__.py @@ -6,6 +6,7 @@ import re import click + REQ_PATTERN = re.compile( r"(?P[a-zA-Z0-9_-]+)(?P\[.*?\])?==(?P[^\s;#]+)|(.*?#egg=(?P[a-zA-Z0-9_-]+))" )