diff --git a/projects/reqman/src/python/reqman/__main__.py b/projects/reqman/src/python/reqman/__main__.py index 8473032..13c92b0 100644 --- a/projects/reqman/src/python/reqman/__main__.py +++ b/projects/reqman/src/python/reqman/__main__.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python3 - """ReqMan; the Requirements Manager. Reqman is a quick and dirty tool that knows about Bazel, rules_python and requirements.txt files. It @@ -114,7 +112,7 @@ def install(requirements, upgrade): """ - + raise RuntimeError("Sorry, not implemented yet.") @cli.command() @@ -146,7 +144,8 @@ def clean(requirements): unused = set(_unused()) reqs = _load(requirements) usedreqs = [r for r in reqs if sort_key(r) not in unused] - _write(requirements, usedreqs) + cleanreqs = [r for r in usedreqs if r not in SHITLIST] + _write(requirements, cleanreqs) if usedreqs != reqs: exit(1) @@ -158,7 +157,8 @@ def sort(requirements): reqs = _load(requirements) sortedreqs = sorted(reqs, key=sort_key) - _write(requirements, sortedreqs) + cleanreqs = [r for r in sortedreqs if r not in SHITLIST] + _write(requirements, cleanreqs) if reqs != sortedreqs: exit(1) diff --git a/setup.cfg b/setup.cfg index d4c627e..6f36468 100644 --- a/setup.cfg +++ b/setup.cfg @@ -14,6 +14,9 @@ combine_as_imports=1 [distutils] index-servers = pypi +[reqman] +shitlist=pip,pkg_resources,setuptools + [pypi] repository = https://pypi.python.org/pypi username = $pypi_user diff --git a/tools/python/bzl_pytest_shim.py b/tools/python/bzl_pytest_shim.py index 8d2dcec..5a65b98 100644 --- a/tools/python/bzl_pytest_shim.py +++ b/tools/python/bzl_pytest_shim.py @@ -7,4 +7,5 @@ import pytest if __name__ == "__main__": cmdline = ["--ignore=external"] + sys.argv[1:] + print(cmdline, file=sys.stderr) sys.exit(pytest.main(cmdline)) diff --git a/tools/python/defs.bzl b/tools/python/defs.bzl index ca586b8..edc4a91 100644 --- a/tools/python/defs.bzl +++ b/tools/python/defs.bzl @@ -201,7 +201,7 @@ def py_project(name=None, for src in test_srcs: if "test_" in src: py_pytest( - name=name + ".test." + str(hash(src)).replace("-", "") + "." + src.split("/")[-1], + name=src.split("/")[-1], srcs=[src] + [f for f in test_srcs if "test_" not in f], deps=[name] + (test_deps or []), data=test_data, diff --git a/tools/python/requirements.txt b/tools/python/requirements.txt index e1ac2b9..f3d493b 100644 --- a/tools/python/requirements.txt +++ b/tools/python/requirements.txt @@ -5,7 +5,6 @@ attrs==20.3.0 autoflake==1.4 Babel==2.9.0 beautifulsoup4==4.9.3 -bleach==4.0.0 certifi==2020.12.5 chardet==4.0.0 click==7.1.2 @@ -24,6 +23,7 @@ itsdangerous==2.0.1 jedi==0.18.0 Jinja2==3.0.1 jsonschema==3.2.0 +lark==0.11.1 livereload==2.6.3 lxml==4.6.3 m2r==0.2.1 @@ -38,7 +38,6 @@ openapi-spec-validator==0.3.0 packaging==20.9 parso==0.8.2 pathspec==0.8.1 -pep517==0.11.0 pip-tools==6.2.0 pluggy==0.13.1 port-for==0.6.1 @@ -78,7 +77,6 @@ sphinxcontrib-programoutput==0.17 sphinxcontrib-qthelp==1.0.3 sphinxcontrib-serializinghtml==1.1.4 toml==0.10.2 -tomli==1.2.1 tornado==6.1 typed-ast==1.4.2 typing-extensions==3.7.4.3 @@ -87,9 +85,7 @@ untokenize==0.1.1 urllib3==1.26.4 urwid==2.1.2 wcwidth==0.2.5 -webencodings==0.5.1 Werkzeug==2.0.1 yamllint==1.26.1 yarl==1.6.3 yaspin==1.5.0 -zipp==3.5.0