Skip to content

Commit

Permalink
[requirements] Added pipenv tasks to Pipfile
Browse files Browse the repository at this point in the history
Implemented pipenv scripts to the relevant section of the Pipfile, to
replace existing files. "runflake8" is replaced by "pipenv run lint",
and "runisort" is replaced by "pipenv run isort". Since it's difficult
to implement runtests.py as a single one-liner, I've added "pipenv run
test", which is an alias to "pipenv run python runtests.py".
  • Loading branch information
Jeremiah Boby authored and jerbob committed Nov 5, 2018
1 parent 87c42ce commit e3014d1
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 23 deletions.
12 changes: 6 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: python
sudo: false
#cache: pip
cache: pip

addons:
apt:
Expand Down Expand Up @@ -30,10 +30,10 @@ branches:

before_install:
- pip install -U pipenv
- pipenv install --skip-lock https://github.com/openwisp/django-netjsonconfig/tarball/master
- pipenv install --dev --skip-lock
- pipenv run ./runflake8
- pipenv run ./runisort
- pipenv run pip freeze
- pipenv run lint
- pipenv run isort

install:
- pipenv install $DJANGO
Expand All @@ -42,12 +42,12 @@ install:
- pipenv install --skip-lock "six>=1.11.0"
# TODO: temporary, remove when django-netjsonconfig 0.9.0 is released
- if [[ $TRAVIS_PYTHON_VERSION == "2.7" ]]; then pipenv install git+git://github.com/tinio/pysqlite.git@extension-enabled#egg=pysqlite; fi
# TODO: temporary, remove when django-x509 is released with the passphrase add-on
- pipenv install --skip-lock https://github.com/openwisp/django-x509/tarball/master
- pipenv run pip install https://github.com/openwisp/django-x509/tarball/master

script:
# for some reason the migrations check is failing only on django 2.0
- if [[ $TRAVIS_PYTHON_VERSION == 3.4 ]]; then pipenv run ./tests/manage.py makemigrations config pki --dry-run | grep "No changes detected"; fi
- pipenv run pip freeze
- pipenv run coverage run --source=openwisp_controller runtests.py

after_success:
Expand Down
6 changes: 6 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,15 @@ name = "pypi"
[packages]
"e1839a8" = {editable = true, path = "."}
"2e72db2" = {file = "https://github.com/openwisp/django-netjsonconfig/tarball/master"}
"e81041b" = {file = "https://github.com/openwisp/django-x509/tarball/master"}

[dev-packages]
coverage = "*"
coveralls = "*"
isort = "*"
flake8 = "*"

[scripts]
lint = "python -m flake8"
isort = "python -m isort"
test = "python runtests.py"
27 changes: 17 additions & 10 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions runflake8

This file was deleted.

3 changes: 0 additions & 3 deletions runisort

This file was deleted.

6 changes: 6 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,15 @@ known_first_party = openwisp_users, openwisp_utils
line_length=110
default_section = THIRDPARTY
skip = migrations
diff = 1
check_only = 1
recursive = 1


[flake8]
# W503: line break before or after operator
# W504: line break after or after operator
# W605: invalid escape sequence
exclude = migrations,./tests/*settings*.py
ignore = W605, W503, W504
max-line-length = 110

0 comments on commit e3014d1

Please sign in to comment.