Tooling work

This commit is contained in:
Reid 'arrdem' McKenzie 2021-08-21 11:49:56 -06:00
parent 7342bb3991
commit 6156cc2e4f
5 changed files with 11 additions and 11 deletions

View file

@ -1,5 +1,3 @@
#!/usr/bin/env python3
"""ReqMan; the Requirements Manager. """ReqMan; the Requirements Manager.
Reqman is a quick and dirty tool that knows about Bazel, rules_python and requirements.txt files. It 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() @cli.command()
@ -146,7 +144,8 @@ def clean(requirements):
unused = set(_unused()) unused = set(_unused())
reqs = _load(requirements) reqs = _load(requirements)
usedreqs = [r for r in reqs if sort_key(r) not in unused] 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: if usedreqs != reqs:
exit(1) exit(1)
@ -158,7 +157,8 @@ def sort(requirements):
reqs = _load(requirements) reqs = _load(requirements)
sortedreqs = sorted(reqs, key=sort_key) 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: if reqs != sortedreqs:
exit(1) exit(1)

View file

@ -14,6 +14,9 @@ combine_as_imports=1
[distutils] [distutils]
index-servers = pypi index-servers = pypi
[reqman]
shitlist=pip,pkg_resources,setuptools
[pypi] [pypi]
repository = https://pypi.python.org/pypi repository = https://pypi.python.org/pypi
username = $pypi_user username = $pypi_user

View file

@ -7,4 +7,5 @@ import pytest
if __name__ == "__main__": if __name__ == "__main__":
cmdline = ["--ignore=external"] + sys.argv[1:] cmdline = ["--ignore=external"] + sys.argv[1:]
print(cmdline, file=sys.stderr)
sys.exit(pytest.main(cmdline)) sys.exit(pytest.main(cmdline))

View file

@ -201,7 +201,7 @@ def py_project(name=None,
for src in test_srcs: for src in test_srcs:
if "test_" in src: if "test_" in src:
py_pytest( 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], srcs=[src] + [f for f in test_srcs if "test_" not in f],
deps=[name] + (test_deps or []), deps=[name] + (test_deps or []),
data=test_data, data=test_data,

View file

@ -5,7 +5,6 @@ attrs==20.3.0
autoflake==1.4 autoflake==1.4
Babel==2.9.0 Babel==2.9.0
beautifulsoup4==4.9.3 beautifulsoup4==4.9.3
bleach==4.0.0
certifi==2020.12.5 certifi==2020.12.5
chardet==4.0.0 chardet==4.0.0
click==7.1.2 click==7.1.2
@ -24,6 +23,7 @@ itsdangerous==2.0.1
jedi==0.18.0 jedi==0.18.0
Jinja2==3.0.1 Jinja2==3.0.1
jsonschema==3.2.0 jsonschema==3.2.0
lark==0.11.1
livereload==2.6.3 livereload==2.6.3
lxml==4.6.3 lxml==4.6.3
m2r==0.2.1 m2r==0.2.1
@ -38,7 +38,6 @@ openapi-spec-validator==0.3.0
packaging==20.9 packaging==20.9
parso==0.8.2 parso==0.8.2
pathspec==0.8.1 pathspec==0.8.1
pep517==0.11.0
pip-tools==6.2.0 pip-tools==6.2.0
pluggy==0.13.1 pluggy==0.13.1
port-for==0.6.1 port-for==0.6.1
@ -78,7 +77,6 @@ sphinxcontrib-programoutput==0.17
sphinxcontrib-qthelp==1.0.3 sphinxcontrib-qthelp==1.0.3
sphinxcontrib-serializinghtml==1.1.4 sphinxcontrib-serializinghtml==1.1.4
toml==0.10.2 toml==0.10.2
tomli==1.2.1
tornado==6.1 tornado==6.1
typed-ast==1.4.2 typed-ast==1.4.2
typing-extensions==3.7.4.3 typing-extensions==3.7.4.3
@ -87,9 +85,7 @@ untokenize==0.1.1
urllib3==1.26.4 urllib3==1.26.4
urwid==2.1.2 urwid==2.1.2
wcwidth==0.2.5 wcwidth==0.2.5
webencodings==0.5.1
Werkzeug==2.0.1 Werkzeug==2.0.1
yamllint==1.26.1 yamllint==1.26.1
yarl==1.6.3 yarl==1.6.3
yaspin==1.5.0 yaspin==1.5.0
zipp==3.5.0