Skip to content

Commit

Permalink
Absolute pins on linting dependencies.
Browse files Browse the repository at this point in the history
- Use completely pinned and hashed dependencies for more consistent, reproducible linting.
- Leverage the awesomeness of pipenv to automate updating these.
- These will always be locked now so builds don't break randomly on other people updating their software. When we finally have the bot up and running that forward merges fixes for Galaxy we can add another if statement that runs this check against dev once a day and opens a PR if needed.
  • Loading branch information
jmchilton committed Oct 26, 2017
1 parent 862212a commit ccb5f61
Show file tree
Hide file tree
Showing 8 changed files with 68 additions and 22 deletions.
14 changes: 14 additions & 0 deletions .ci/tox_envs/flake8/Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[[source]]

url = "https://pypi.python.org/simple"
verify_ssl = true
name = "pypi"


[dev-packages]



[packages]

"flake8" = "*"
6 changes: 6 additions & 0 deletions .ci/tox_envs/flake8/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
mccabe==0.6.1 --hash=sha256:ab8a6258860da4b6677da4bd2fe5dc2c659cff31b3ee4f7f5d64e79735b80d42 --hash=sha256:dd8d182285a0fe56bace7f45b5e7d1a6ebcbf524e8f3bd87eb0f125271b8831f
pycodestyle==2.3.1 --hash=sha256:6c4245ade1edfad79c3446fadfc96b0de2759662dc29d07d80a6f27ad1ca6ba9 --hash=sha256:682256a5b318149ca0d2a9185d365d8864a768a28db66a84a2ea946bcc426766
pyflakes==1.6.0 --hash=sha256:08bd6a50edf8cffa9fa09a463063c425ecaaf10d1eb0335a7e8b1401aef89e6f --hash=sha256:8d616a382f243dbf19b54743f280b80198be0bca3a5396f1d2e1fca6223e8805
enum34==1.1.6; python_version < '3.4' --hash=sha256:6bd0f6ad48ec2aa117d3d141940d484deccda84d4fcd884f5c3d93c23ecd8c79 --hash=sha256:644837f692e5f550741432dd3f223bbb9852018674981b1664e5dc339387588a --hash=sha256:8ad8c4783bf61ded74527bffb48ed9b54166685e4230386a9ed9b1279e2df5b1 --hash=sha256:2d81cbbe0e73112bdfe6ef8576f2238f2ba27dd0d55752a776c41d38b7da2850
flake8==3.5.0 --hash=sha256:c7841163e2b576d435799169b78703ad6ac1bbb0f199994fc05f700b2a90ea37 --hash=sha256:7253265f7abd8b313e3892944044a365e3f4ac3fcdcfb4298f55ee9ddf188ba0
configparser==3.5.0; python_version < '3.2' --hash=sha256:5308b47021bc2340965c371f0f058cc6971a04502638d4244225c49d80db273a
15 changes: 15 additions & 0 deletions .ci/tox_envs/flake8_imports/Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[[source]]

url = "https://pypi.python.org/simple"
verify_ssl = true
name = "pypi"


[dev-packages]



[packages]

"flake8" = "*"
"flake8-import-order" = "*"
7 changes: 7 additions & 0 deletions .ci/tox_envs/flake8_imports/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
mccabe==0.6.1 --hash=sha256:ab8a6258860da4b6677da4bd2fe5dc2c659cff31b3ee4f7f5d64e79735b80d42 --hash=sha256:dd8d182285a0fe56bace7f45b5e7d1a6ebcbf524e8f3bd87eb0f125271b8831f
pycodestyle==2.3.1 --hash=sha256:6c4245ade1edfad79c3446fadfc96b0de2759662dc29d07d80a6f27ad1ca6ba9 --hash=sha256:682256a5b318149ca0d2a9185d365d8864a768a28db66a84a2ea946bcc426766
pyflakes==1.6.0 --hash=sha256:08bd6a50edf8cffa9fa09a463063c425ecaaf10d1eb0335a7e8b1401aef89e6f --hash=sha256:8d616a382f243dbf19b54743f280b80198be0bca3a5396f1d2e1fca6223e8805
enum34==1.1.6; python_version < '3.4' --hash=sha256:6bd0f6ad48ec2aa117d3d141940d484deccda84d4fcd884f5c3d93c23ecd8c79 --hash=sha256:644837f692e5f550741432dd3f223bbb9852018674981b1664e5dc339387588a --hash=sha256:8ad8c4783bf61ded74527bffb48ed9b54166685e4230386a9ed9b1279e2df5b1 --hash=sha256:2d81cbbe0e73112bdfe6ef8576f2238f2ba27dd0d55752a776c41d38b7da2850
flake8-import-order==0.14 --hash=sha256:69aa93a5bdb526310a0bd994e3603122673d1103d8063d3505e45118005044b3 --hash=sha256:77271feabb17d7cc286e9156531bb94781fdf2bbc1690e2fd6fa2776580b2209
flake8==3.5.0 --hash=sha256:c7841163e2b576d435799169b78703ad6ac1bbb0f199994fc05f700b2a90ea37 --hash=sha256:7253265f7abd8b313e3892944044a365e3f4ac3fcdcfb4298f55ee9ddf188ba0
configparser==3.5.0; python_version < '3.2' --hash=sha256:5308b47021bc2340965c371f0f058cc6971a04502638d4244225c49d80db273a
14 changes: 14 additions & 0 deletions .ci/tox_envs/update.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh

THIS_DIRECTORY="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
ENVS=(flake8 flake8_imports)

for env in "${ENVS[@]}"
do
cd "$THIS_DIRECTORY/$env"
pipenv lock
pipenv lock -r > requirements.txt
done

git add -u "$THIS_DIRECTORY"
git commit -m "Rev and re-lock linting dependencies."
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@ release-check-blocking-prs: ## Check github for release blocking PRs
release-bootstrap-history: ## bootstrap history for a new release
$(IN_VENV) python scripts/bootstrap_history.py --release $(RELEASE_CURR)

update-linting-requirements: ## update linting dependencies
sh .ci/tox_envs/update.sh

node-deps: ## Install NodeJS dependencies.
cd client && yarn install --check-files

Expand Down
1 change: 0 additions & 1 deletion scripts/bootstrap_history.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@
make release-create-rc RELEASE_CURR=${version} RELEASE_NEXT=${next_version}
- [ ] Open PRs from your fork of branch ``version-${version}`` to upstream ``release_${version}`` and of ``version-${next_version}.dev`` to ``dev``.
- [ ] Open PR against ``release_${version}`` branch to pin flake8 deps in tox.ini to the latest available version. See [example](/~https://github.com/galaxyproject/galaxy/pull/3476).
- [ ] Update ``next_milestone`` in [P4's configuration](/~https://github.com/galaxyproject/p4) to `${next_version}` so it properly tags new PRs.
- [ ] Set the ``release_${version}`` branch in GitHub [settings](/~https://github.com/galaxyproject/galaxy/settings/branches) as protected.
Expand Down
30 changes: 9 additions & 21 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,23 @@ skipsdist = True
[testenv:py27-lint]
commands = bash .ci/flake8_wrapper.sh
whitelist_externals = bash
deps =
flake8>=3.4.1
flake8-docstrings>=1.1.0
pydocstyle>=2.1.1
deps = -r.ci/tox_envs/flake8/requirements.txt

[testenv:py33-lint]
commands = bash .ci/flake8_wrapper.sh
whitelist_externals = bash
deps = flake8>=3.4.1
deps = -r.ci/tox_envs/flake8/requirements.txt


[testenv:py34-lint]
commands = bash .ci/flake8_wrapper.sh
whitelist_externals = bash
deps = flake8>=3.4.1
deps = -r.ci/tox_envs/flake8/requirements.txt

[testenv:py35-lint]
commands = bash .ci/flake8_wrapper.sh
whitelist_externals = bash
deps = flake8>=3.4.1
deps = -r.ci/tox_envs/flake8/requirements.txt

[testenv:py27-unit]
commands = bash run_tests.sh --no-create-venv -u
Expand All @@ -43,17 +41,13 @@ deps =
commands = bash .ci/flake8_wrapper.sh
whitelist_externals = bash
skip_install = True
deps =
flake8>=3.4.1
flake8-import-order>=0.14
deps = -r.ci/tox_envs/flake8_imports/requirements.txt

[testenv:py27-lint-imports-include-list]
commands = bash .ci/flake8_wrapper_imports.sh
whitelist_externals = bash
skip_install = True
deps =
flake8>=3.4.1
flake8-import-order>=0.14
deps = -r.ci/tox_envs/flake8_imports/requirements.txt

[testenv:qunit]
commands = bash run_tests.sh -q
Expand All @@ -79,19 +73,13 @@ whitelist_externals = bash
commands = bash .ci/flake8_wrapper_docstrings.sh --exclude
whitelist_externals = bash
skip_install = True
deps =
flake8>=3.4.1
flake8-docstrings>=1.1.0
pydocstyle>=2.1.1
deps = -r.ci/tox_envs/flake8/requirements.txt

[testenv:py27-lint-docstring-include-list]
commands = bash .ci/flake8_wrapper_docstrings.sh --include
whitelist_externals = bash
skip_install = True
deps =
flake8>=3.4.1
flake8-docstrings>=1.1.0
pydocstyle>=2.1.1
deps = -r.ci/tox_envs/flake8/requirements.txt

[testenv:check-python-dependencies]
commands = make list-dependency-updates # someday change exit code on this.
Expand Down

0 comments on commit ccb5f61

Please sign in to comment.