From 06414049de6cbe5d0533cd7614cb91e6e7065f50 Mon Sep 17 00:00:00 2001 From: CM Lubinski Date: Sun, 23 Apr 2017 11:49:08 -0400 Subject: [PATCH 1/3] Use pip-tools to pin all dependencies. We had been pinning the top-level dependency, but that allows transitive dependencies to change, which can lead to version errors (notably, ipython shipped a new version which is not compatible with Python 2). --- .travis.yml | 3 +- docs/dev_tasks.rst | 4 +- .../web/management/commands/async_eregs.py | 9 +-- requirements.txt | 40 +++++++--- requirements_dev.in | 20 +++++ requirements_dev.txt | 74 +++++++++++++++++++ requirements_test.txt | 18 ----- requirements_web.txt | 2 - setup.py | 4 + 9 files changed, 136 insertions(+), 38 deletions(-) create mode 100644 requirements_dev.in create mode 100644 requirements_dev.txt delete mode 100644 requirements_test.txt delete mode 100644 requirements_web.txt diff --git a/.travis.yml b/.travis.yml index 6baa78a2..e9cab5ec 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,8 +6,7 @@ python: - "3.5" cache: pip install: - - pip install -r requirements.txt - - pip install -r requirements_test.txt + - pip install -r requirements_dev.txt - pip install coveralls env: - INTEGRATION_TARGET= diff --git a/docs/dev_tasks.rst b/docs/dev_tasks.rst index 864ba362..83ef0494 100644 --- a/docs/dev_tasks.rst +++ b/docs/dev_tasks.rst @@ -27,11 +27,11 @@ Running Tests ============= As the parser is a complex beast, it has several hundred unit tests to help catch regressions. To run those tests, make sure you have first added all of -the testing requirements: +the development requirements: .. code-block:: bash - pip install -r requirements_test.txt + pip install -r requirements_dev.txt Then, run py.test on all of the available unit tests: diff --git a/regparser/web/management/commands/async_eregs.py b/regparser/web/management/commands/async_eregs.py index 8c0c8c7d..7530d50b 100644 --- a/regparser/web/management/commands/async_eregs.py +++ b/regparser/web/management/commands/async_eregs.py @@ -61,14 +61,13 @@ class Command(BaseCommand): help = ( # noqa """ Asynchronous `eregs` commands. To run, - 1. pip install -r requirements_web.txt - 2. start redis. For example, with docker: + 1. start redis. For example, with docker: docker run -p 6379:6379 -d redis - 3. start a worker process + 2. start a worker process python manage.py rqworker - 4. run an asynchronous command + 3. run an asynchronous command python manage.py async_eregs pipeline 27 479 async_output_dir - 5. check the status of your jobs: + 4. check the status of your jobs: python manage.py async_eregs # no parameters """ ) diff --git a/requirements.txt b/requirements.txt index 59cc9093..5056a666 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,26 +1,48 @@ -pip==8.1.2 +# +# This file is autogenerated by pip-compile +# To update, run: +# +# pip-compile --output-file requirements.txt setup.py +# +-e . +-e interpparser +git+https://github.com/python-constraint/python-constraint.git@1.3.1#egg=python-constraint attrs==16.3.0 cached-property==1.3.0 click==6.6 coloredlogs==5.0 -Django==1.9.10 +decorator==4.0.11 # via ipython, networkx, traitlets dj-database-url==0.4.1 django-click==1.2.0 -django_rq==0.9.1 +django-rq==0.9.1 +django==1.9.10 djangorestframework==3.4 -GitPython==2.0.2 +gitdb==0.6.4 # via gitpython +gitpython==2.0.2 +humanfriendly==2.4 # via coloredlogs inflection==0.3.1 ipdb==0.10.0 +ipython-genutils==0.2.0 # via traitlets +ipython==6.0.0 # via ipdb +jedi==0.10.2 # via ipython json-delta==2.0 lxml==3.6.0 networkx==1.11 +pbr==3.0.0 # via stevedore +pexpect==4.2.1 # via ipython +pickleshare==0.7.4 # via ipython +prompt-toolkit==1.0.14 # via ipython +ptyprocess==0.5.1 # via pexpect +pygments==2.2.0 # via ipython pyparsing==2.1.4 -git+https://github.com/python-constraint/python-constraint.git -requests==2.10.0 +redis==2.10.5 # via rq requests-cache==0.4.12 +requests==2.10.0 roman==2.0.0 -setuptools==21.1.0 +rq==0.7.1 # via django-rq +simplegeneric==0.8.1 # via ipython six==1.10.0 +smmap==0.9.0 # via gitdb stevedore==1.13.0 --e . --e interpparser +traitlets==4.3.2 # via ipython +wcwidth==0.1.7 # via prompt-toolkit diff --git a/requirements_dev.in b/requirements_dev.in new file mode 100644 index 00000000..0ada851b --- /dev/null +++ b/requirements_dev.in @@ -0,0 +1,20 @@ +-r requirements.txt + +cov-core +coverage +flake8 +flake8-blind-except +flake8-builtins +flake8-comprehensions +flake8-isort +flake8-pep3101 +flake8-print +flake8-string-format +flake8-tuple +freezegun +httpretty +mock +pep8-naming +pytest +pytest-cov +pytest-django diff --git a/requirements_dev.txt b/requirements_dev.txt new file mode 100644 index 00000000..d53bc5d9 --- /dev/null +++ b/requirements_dev.txt @@ -0,0 +1,74 @@ +# +# This file is autogenerated by pip-compile +# To update, run: +# +# pip-compile --output-file requirements_dev.txt requirements_dev.in +# +-e . +-e interpparser +git+https://github.com/python-constraint/python-constraint.git@1.3.1#egg=python-constraint +attrs==16.3.0 +cached-property==1.3.0 +click==6.6 +coloredlogs==5.0 +cov-core==1.15.0 +coverage==4.1 +decorator==4.0.11 +dj-database-url==0.4.1 +django-click==1.2.0 +django-rq==0.9.1 +django==1.9.10 +djangorestframework==3.4 +flake8-blind-except==0.1.1 +flake8-builtins==0.2 +flake8-comprehensions==1.2.1 +flake8-isort==2.1.3 +flake8-pep3101==1.0 +flake8-polyfill==1.0.1 # via flake8-isort +flake8-print==2.0.2 +flake8-string-format==0.2.3 +flake8-tuple==0.2.12 +flake8==3.2.1 +freezegun==0.3.8 +gitdb==0.6.4 +gitpython==2.0.2 +httpretty==0.8.14 +humanfriendly==2.4 +inflection==0.3.1 +ipdb==0.10.0 +ipython-genutils==0.2.0 +ipython==6.0.0 +isort==4.2.5 # via flake8-isort +jedi==0.10.2 +json-delta==2.0 +lxml==3.6.0 +mccabe==0.5.3 # via flake8 +mock==2.0.0 +networkx==1.11 +pbr==3.0.0 +pep8-naming==0.4.1 +pexpect==4.2.1 +pickleshare==0.7.4 +prompt-toolkit==1.0.14 +ptyprocess==0.5.1 +py==1.4.33 # via pytest +pycodestyle==2.2.0 # via flake8 +pyflakes==1.3.0 # via flake8 +pygments==2.2.0 +pyparsing==2.1.4 +pytest-cov==2.4.0 +pytest-django==2.9.1 +pytest==3.0.6 +python-dateutil==2.6.0 # via freezegun +redis==2.10.5 +requests-cache==0.4.12 +requests==2.10.0 +roman==2.0.0 +rq==0.7.1 +simplegeneric==0.8.1 +six==1.10.0 +smmap==0.9.0 +stevedore==1.13.0 +testfixtures==4.13.5 # via flake8-isort +traitlets==4.3.2 +wcwidth==0.1.7 diff --git a/requirements_test.txt b/requirements_test.txt deleted file mode 100644 index 7a5687a1..00000000 --- a/requirements_test.txt +++ /dev/null @@ -1,18 +0,0 @@ -cov-core==1.15.0 -coverage==4.1 -flake8==3.2.1 -flake8-blind-except==0.1.1 -flake8-builtins==0.2 -flake8-comprehensions==1.2.1 -flake8-isort==2.1.3 -flake8-pep3101==1.0 -flake8-print==2.0.2 -flake8-string-format==0.2.3 -flake8-tuple==0.2.12 -freezegun==0.3.8 -httpretty==0.8.14 -mock==2.0.0 -pep8-naming==0.4.1 -pytest==3.0.6 -pytest-cov==2.4.0 -pytest-django==2.9.1 diff --git a/requirements_web.txt b/requirements_web.txt deleted file mode 100644 index cc1b6b6c..00000000 --- a/requirements_web.txt +++ /dev/null @@ -1,2 +0,0 @@ -redis==2.10.5 -rq==0.6.0 diff --git a/setup.py b/setup.py index 3de471bc..351233cf 100644 --- a/setup.py +++ b/setup.py @@ -32,6 +32,10 @@ "six", "stevedore" ], + dependency_links=[ + "http://github.com/python-constraint/python-constraint/" + "archive/1.3.1.tar.gz#egg=python-constraint", + ], entry_points={ "console_scripts": "eregs=eregs:main", "eregs_ns.parser.amendment.content": [ From 2fb167cced3e24c0428bd51e512ce58efbc310b9 Mon Sep 17 00:00:00 2001 From: CM Lubinski Date: Sun, 23 Apr 2017 16:17:45 +0000 Subject: [PATCH 2/3] Update to Django 1.11. Support for 1.9 ended earlier this month; migrate to the latest LTS. --- requirements.txt | 3 ++- requirements_dev.txt | 3 ++- setup.py | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/requirements.txt b/requirements.txt index 5056a666..43686736 100644 --- a/requirements.txt +++ b/requirements.txt @@ -15,7 +15,7 @@ decorator==4.0.11 # via ipython, networkx, traitlets dj-database-url==0.4.1 django-click==1.2.0 django-rq==0.9.1 -django==1.9.10 +django==1.11 djangorestframework==3.4 gitdb==0.6.4 # via gitpython gitpython==2.0.2 @@ -35,6 +35,7 @@ prompt-toolkit==1.0.14 # via ipython ptyprocess==0.5.1 # via pexpect pygments==2.2.0 # via ipython pyparsing==2.1.4 +pytz==2017.2 # via django redis==2.10.5 # via rq requests-cache==0.4.12 requests==2.10.0 diff --git a/requirements_dev.txt b/requirements_dev.txt index d53bc5d9..2fa9657d 100644 --- a/requirements_dev.txt +++ b/requirements_dev.txt @@ -17,7 +17,7 @@ decorator==4.0.11 dj-database-url==0.4.1 django-click==1.2.0 django-rq==0.9.1 -django==1.9.10 +django==1.11 djangorestframework==3.4 flake8-blind-except==0.1.1 flake8-builtins==0.2 @@ -60,6 +60,7 @@ pytest-cov==2.4.0 pytest-django==2.9.1 pytest==3.0.6 python-dateutil==2.6.0 # via freezegun +pytz==2017.2 redis==2.10.5 requests-cache==0.4.12 requests==2.10.0 diff --git a/setup.py b/setup.py index 351233cf..c775ac22 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ "cached-property", "click", "coloredLogs", - "Django==1.9.*", + "django", "dj-database-url", "django-click", "django_rq", From 486692da8ce74987a273d68607fcd641717764e5 Mon Sep 17 00:00:00 2001 From: CM Lubinski Date: Sun, 23 Apr 2017 12:33:35 -0400 Subject: [PATCH 3/3] Downgrade ipython. 6.0.0 dropped support for Python 2. --- requirements.txt | 2 +- requirements_dev.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index 43686736..a8401b8b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -23,7 +23,7 @@ humanfriendly==2.4 # via coloredlogs inflection==0.3.1 ipdb==0.10.0 ipython-genutils==0.2.0 # via traitlets -ipython==6.0.0 # via ipdb +ipython==5.3.0 # via ipdb jedi==0.10.2 # via ipython json-delta==2.0 lxml==3.6.0 diff --git a/requirements_dev.txt b/requirements_dev.txt index 2fa9657d..11e33e91 100644 --- a/requirements_dev.txt +++ b/requirements_dev.txt @@ -37,7 +37,7 @@ humanfriendly==2.4 inflection==0.3.1 ipdb==0.10.0 ipython-genutils==0.2.0 -ipython==6.0.0 +ipython==5.3.0 isort==4.2.5 # via flake8-isort jedi==0.10.2 json-delta==2.0