From f31052670a0ef61814a8e2e2a51c81bba44e6cec Mon Sep 17 00:00:00 2001 From: Deimos Date: Fri, 9 Oct 2020 22:00:08 -0600 Subject: [PATCH] Remove "via" annotations from requirements files I should have just done this all along, these have been way more trouble than they're worth. If the information is needed, it's always possible to just do a temp run of pip-compile without --no-annotate or use a dedicated tool like pipdeptree. --- tildes/requirements-dev.txt | 144 ++++++++++++++++++------------------ tildes/requirements.txt | 78 +++++++++---------- tildes/tasks.py | 28 ++----- 3 files changed, 116 insertions(+), 134 deletions(-) diff --git a/tildes/requirements-dev.txt b/tildes/requirements-dev.txt index 7903c5d..5964fd4 100644 --- a/tildes/requirements-dev.txt +++ b/tildes/requirements-dev.txt @@ -1,79 +1,79 @@ ago==0.0.93 alembic==1.4.3 -appdirs==1.4.4 # via black +appdirs==1.4.4 argon2-cffi==20.1.0 -astroid==2.4.1 # via prospector, pylint, pylint-celery, pylint-flask, requirements-detector -attrs==20.2.0 # via pytest -backcall==0.2.0 # via ipython +astroid==2.4.1 +attrs==20.2.0 +backcall==0.2.0 beautifulsoup4==4.9.3 black==20.8b1 bleach==3.2.1 -cached-property==1.5.2 # via pygit2 -certifi==2020.6.20 # via requests, sentry-sdk -cffi==1.14.3 # via argon2-cffi, pygit2 -chardet==3.0.4 # via requests +cached-property==1.5.2 +certifi==2020.6.20 +cffi==1.14.3 +chardet==3.0.4 click==7.1.2 cornice==5.0.3 -decorator==4.4.2 # via ipython -dodgy==0.2.1 # via prospector -flake8-polyfill==1.0.2 # via pep8-naming -flake8==3.8.4 # via flake8-polyfill +decorator==4.4.2 +dodgy==0.2.1 +flake8-polyfill==1.0.2 +flake8==3.8.4 freezegun==1.0.0 gunicorn==20.0.4 html5lib==1.1 html5validator==0.3.3 -hupper==1.10.2 # via pyramid -idna==2.10 # via requests -iniconfig==1.0.1 # via pytest +hupper==1.10.2 +idna==2.10 +iniconfig==1.0.1 invoke==1.4.1 -ipython-genutils==0.2.0 # via traitlets +ipython-genutils==0.2.0 ipython==7.18.1 -isort==4.3.21 # via pylint -jedi==0.17.2 # via ipython -jinja2==2.11.2 # via pyramid-jinja2 -lazy-object-proxy==1.4.3 # via astroid -mako==1.1.3 # via alembic, pyramid-mako -markupsafe==1.1.1 # via jinja2, mako, pyramid-jinja2 +isort==4.3.21 +jedi==0.17.2 +jinja2==2.11.2 +lazy-object-proxy==1.4.3 +mako==1.1.3 +markupsafe==1.1.1 marshmallow==3.8.0 -mccabe==0.6.1 # via flake8, prospector, pylint -mypy-extensions==0.4.3 # via black, mypy +mccabe==0.6.1 +mypy-extensions==0.4.3 mypy==0.782 -packaging==20.4 # via bleach, pytest -parso==0.7.1 # via jedi -pastedeploy==2.1.0 # via plaster-pastedeploy -pathspec==0.8.0 # via black -pep8-naming==0.10.0 # via prospector -pexpect==4.8.0 # via ipython -pickleshare==0.7.5 # via ipython +packaging==20.4 +parso==0.7.1 +pastedeploy==2.1.0 +pathspec==0.8.0 +pep8-naming==0.10.0 +pexpect==4.8.0 +pickleshare==0.7.5 pillow==7.2.0 pip-tools==5.3.1 -plaster-pastedeploy==0.7 # via pyramid -plaster==1.0 # via plaster-pastedeploy, pyramid -pluggy==0.13.1 # via pytest +plaster-pastedeploy==0.7 +plaster==1.0 +pluggy==0.13.1 prometheus-client==0.8.0 -prompt-toolkit==3.0.7 # via ipython +prompt-toolkit==3.0.7 prospector==1.3.0 psycopg2==2.8.6 -ptyprocess==0.6.0 # via pexpect +ptyprocess==0.6.0 publicsuffix2==2.20160818 -py==1.9.0 # via pytest -pycodestyle==2.6.0 # via flake8, prospector -pycparser==2.20 # via cffi -pydocstyle==5.1.1 # via prospector -pyflakes==2.2.0 # via flake8, prospector +py==1.9.0 +pycodestyle==2.6.0 +pycparser==2.20 +pydocstyle==5.1.1 +pyflakes==2.2.0 pygit2==1.3.0 pygments==2.7.1 -pylint-celery==0.3 # via prospector -pylint-django==2.0.15 # via prospector -pylint-flask==0.6 # via prospector -pylint-plugin-utils==0.6 # via prospector, pylint-celery, pylint-django, pylint-flask -pylint==2.5.2 # via prospector, pylint-celery, pylint-django, pylint-flask, pylint-plugin-utils +pylint-celery==0.3 +pylint-django==2.0.15 +pylint-flask==0.6 +pylint-plugin-utils==0.6 +pylint==2.5.2 pyotp==2.4.0 -pyparsing==2.4.7 # via packaging +pyparsing==2.4.7 pyramid-debugtoolbar==4.6.1 pyramid-ipython==0.2 pyramid-jinja2==2.8 -pyramid-mako==1.1.0 # via pyramid-debugtoolbar +pyramid-mako==1.1.0 pyramid-session-redis==1.5.0 pyramid-tm==2.4 pyramid-webassets==0.10 @@ -81,43 +81,43 @@ pyramid==1.10.4 pytest-mock==3.3.1 pytest==6.1.1 python-dateutil==2.8.1 -python-editor==1.0.4 # via alembic +python-editor==1.0.4 pyyaml==5.3.1 qrcode==6.1 redis==3.5.3 -regex==2020.9.27 # via black, titlecase -repoze.lru==0.7 # via pyramid-debugtoolbar +regex==2020.9.27 +repoze.lru==0.7 requests==2.24.0 -requirements-detector==0.7 # via prospector +requirements-detector==0.7 sentry-sdk==0.18.0 -setoptconf==0.2.0 # via prospector -six==1.15.0 # via argon2-cffi, astroid, bleach, html5lib, packaging, pip-tools, pyramid-session-redis, pyramid-webassets, python-dateutil, qrcode, sqlalchemy-utils, webtest -snowballstemmer==2.0.0 # via pydocstyle -soupsieve==2.0.1 # via beautifulsoup4 +setoptconf==0.2.0 +six==1.15.0 +snowballstemmer==2.0.0 +soupsieve==2.0.1 sqlalchemy-utils==0.36.8 sqlalchemy==1.3.19 stripe==2.54.0 -testing.common.database==2.0.3 # via testing.redis +testing.common.database==2.0.3 testing.redis==1.1.1 titlecase==1.1.1 -toml==0.10.1 # via black, pylint, pytest -traitlets==5.0.4 # via ipython -transaction==3.0.0 # via pyramid-tm, zope.sqlalchemy -translationstring==1.4 # via pyramid -typed-ast==1.4.1 # via black, mypy -typing-extensions==3.7.4.3 # via black, mypy -urllib3==1.25.10 # via requests, sentry-sdk -venusian==3.0.0 # via cornice, pyramid -waitress==1.4.4 # via webtest -wcwidth==0.2.5 # via prompt-toolkit +toml==0.10.1 +traitlets==5.0.4 +transaction==3.0.0 +translationstring==1.4 +typed-ast==1.4.1 +typing-extensions==3.7.4.3 +urllib3==1.25.10 +venusian==3.0.0 +waitress==1.4.4 +wcwidth==0.2.5 webargs==6.1.1 -webassets==2.0 # via pyramid-webassets -webencodings==0.5.1 # via bleach, html5lib -webob==1.8.6 # via pyramid, webtest +webassets==2.0 +webencodings==0.5.1 +webob==1.8.6 webtest==2.0.35 wrapt==1.12.1 -zope.deprecation==4.4.0 # via pyramid, pyramid-jinja2 -zope.interface==5.1.2 # via pyramid, pyramid-webassets, transaction, zope.sqlalchemy +zope.deprecation==4.4.0 +zope.interface==5.1.2 zope.sqlalchemy==1.3 # The following packages are considered to be unsafe in a requirements file: diff --git a/tildes/requirements.txt b/tildes/requirements.txt index 6811875..bb49f7d 100644 --- a/tildes/requirements.txt +++ b/tildes/requirements.txt @@ -1,47 +1,47 @@ ago==0.0.93 alembic==1.4.3 argon2-cffi==20.1.0 -backcall==0.2.0 # via ipython +backcall==0.2.0 beautifulsoup4==4.9.3 bleach==3.2.1 -cached-property==1.5.2 # via pygit2 -certifi==2020.6.20 # via requests, sentry-sdk -cffi==1.14.3 # via argon2-cffi, pygit2 -chardet==3.0.4 # via requests +cached-property==1.5.2 +certifi==2020.6.20 +cffi==1.14.3 +chardet==3.0.4 click==7.1.2 cornice==5.0.3 -decorator==4.4.2 # via ipython +decorator==4.4.2 gunicorn==20.0.4 html5lib==1.1 -hupper==1.10.2 # via pyramid -idna==2.10 # via requests +hupper==1.10.2 +idna==2.10 invoke==1.4.1 -ipython-genutils==0.2.0 # via traitlets +ipython-genutils==0.2.0 ipython==7.18.1 -jedi==0.17.2 # via ipython -jinja2==2.11.2 # via pyramid-jinja2 -mako==1.1.3 # via alembic -markupsafe==1.1.1 # via jinja2, mako, pyramid-jinja2 +jedi==0.17.2 +jinja2==2.11.2 +mako==1.1.3 +markupsafe==1.1.1 marshmallow==3.8.0 -packaging==20.4 # via bleach -parso==0.7.1 # via jedi -pastedeploy==2.1.0 # via plaster-pastedeploy -pexpect==4.8.0 # via ipython -pickleshare==0.7.5 # via ipython +packaging==20.4 +parso==0.7.1 +pastedeploy==2.1.0 +pexpect==4.8.0 +pickleshare==0.7.5 pillow==7.2.0 pip-tools==5.3.1 -plaster-pastedeploy==0.7 # via pyramid -plaster==1.0 # via plaster-pastedeploy, pyramid +plaster-pastedeploy==0.7 +plaster==1.0 prometheus-client==0.8.0 -prompt-toolkit==3.0.7 # via ipython +prompt-toolkit==3.0.7 psycopg2==2.8.6 -ptyprocess==0.6.0 # via pexpect +ptyprocess==0.6.0 publicsuffix2==2.20160818 -pycparser==2.20 # via cffi +pycparser==2.20 pygit2==1.3.0 pygments==2.7.1 pyotp==2.4.0 -pyparsing==2.4.7 # via packaging +pyparsing==2.4.7 pyramid-ipython==0.2 pyramid-jinja2==2.8 pyramid-session-redis==1.5.0 @@ -49,32 +49,32 @@ pyramid-tm==2.4 pyramid-webassets==0.10 pyramid==1.10.4 python-dateutil==2.8.1 -python-editor==1.0.4 # via alembic +python-editor==1.0.4 pyyaml==5.3.1 qrcode==6.1 redis==3.5.3 -regex==2020.9.27 # via titlecase +regex==2020.9.27 requests==2.24.0 sentry-sdk==0.18.0 -six==1.15.0 # via argon2-cffi, bleach, html5lib, packaging, pip-tools, pyramid-session-redis, pyramid-webassets, python-dateutil, qrcode, sqlalchemy-utils -soupsieve==2.0.1 # via beautifulsoup4 +six==1.15.0 +soupsieve==2.0.1 sqlalchemy-utils==0.36.8 sqlalchemy==1.3.19 stripe==2.54.0 titlecase==1.1.1 -traitlets==5.0.4 # via ipython -transaction==3.0.0 # via pyramid-tm, zope.sqlalchemy -translationstring==1.4 # via pyramid -urllib3==1.25.10 # via requests, sentry-sdk -venusian==3.0.0 # via cornice, pyramid -wcwidth==0.2.5 # via prompt-toolkit +traitlets==5.0.4 +transaction==3.0.0 +translationstring==1.4 +urllib3==1.25.10 +venusian==3.0.0 +wcwidth==0.2.5 webargs==6.1.1 -webassets==2.0 # via pyramid-webassets -webencodings==0.5.1 # via bleach, html5lib -webob==1.8.6 # via pyramid +webassets==2.0 +webencodings==0.5.1 +webob==1.8.6 wrapt==1.12.1 -zope.deprecation==4.4.0 # via pyramid, pyramid-jinja2 -zope.interface==5.1.2 # via pyramid, pyramid-webassets, transaction, zope.sqlalchemy +zope.deprecation==4.4.0 +zope.interface==5.1.2 zope.sqlalchemy==1.3 # The following packages are considered to be unsafe in a requirements file: diff --git a/tildes/tasks.py b/tildes/tasks.py index 6d698c0..b6e6813 100644 --- a/tildes/tasks.py +++ b/tildes/tasks.py @@ -3,7 +3,6 @@ """Contains tasks that can be run through the invoke tool.""" -import re from pathlib import Path from invoke import task @@ -105,25 +104,8 @@ def type_checking(context): def update_pip_requirements(context): """Use pip-tools to update package versions in the requirements files.""" - def build_and_clean(context, name): - """Update a pip requirements file and clean up the result.""" - in_filename = Path(name).with_suffix(".in") - out_filename = Path(name).with_suffix(".txt") - - print(f"Updating package versions from {in_filename}") - context.run(f"pip-compile --no-header --quiet --upgrade {in_filename}") - - # Salt's pip module is currently broken if any comments in the requirements - # file have "-r" in them, so we need to remove all of those comments - with open(out_filename, "r") as req_file: - req_lines = req_file.readlines() - - # remove any comments that include an -r reference - # (meaning it's a package that was specifically installed, not a dependency) - cleaned_lines = [re.sub(r"\s+# via.* -r .*", "", line) for line in req_lines] - - with open(out_filename, "w") as req_file: - req_file.writelines(cleaned_lines) - - build_and_clean(context, "requirements") - build_and_clean(context, "requirements-dev") + for filename in ("requirements.in", "requirements-dev.in"): + print(f"Updating package versions from {filename}") + context.run( + f"pip-compile --no-header --no-annotate --quiet --upgrade {filename}" + )