Skip to content
Permalink
Browse files

[IMPROVEMENT] Add Setup For Initiating Python 3.7 Compatibility (#298)

* Update python version to 3.7 in Pipfile

- It is required since we are moving onto Python 3.7 as default
- The pipfile will not give warning on systems with Python version<3.7

* Add monkeytype.sqlite3 to .gitignore

- We will be using monkeytype which creates an intermediate database to store traces.
- Git ignores the file and does not commit it

* Add monkeytype to Pipfile

* Update readme to include instructions to add annotations

* Add E701 to pep8 check skipping

- It is required since we will be using variable annotations which violate E701

* Update install instructions for developers in README.md

* Add pytype for adding annotations

- MyType is not able to parse annotations for all files
- PyType does for all files but is not very accurate
- A mix of both would be best

* Add annontations and typing to root

- It is easier to check for breaking changes
- Each function takes in a defined static arguments and returns a static argument
- This also takes care that it is not an all-or-nothing case and Python's dynamic typing is used where-ever convenient.

* Allow travis to fail builds for 3.4, 3.5, 3.6

* Move PEP8 from unit-test to standalone execution

- It gets very confusing when unit-tests fail but the error is because of PEP8
- Now, PEP8 is separate and build will still fail but unit-tests will not

* Move test requirements to test-requirements.txt

- Instead of a lot of install commands, it's better to have them all at one place

* Update .pep8speaks.yml

Add reason for why E701 is ignored.

* Drop all versions but 3.7, Add nightly to travis

Dropping all versions but 3.7 and adding nightly python to travis builds. We will allow failing on Nightly.
  • Loading branch information...
thealphadollar authored and canihavesomecoffee committed Jun 10, 2019
1 parent fc170d9 commit bac70b898908c3d1e0c69198ef9b2af05e844263
Showing with 280 additions and 128 deletions.
  1. +2 −0 .gitignore
  2. +2 −1 .pep8speaks.yml
  3. +1 −0 .pycodestylerc
  4. +7 −16 .travis.yml
  5. +4 −1 Pipfile
  6. +119 −23 Pipfile.lock
  7. +70 −11 README.md
  8. +3 −1 config_parser.py
  9. +21 −15 database.py
  10. +8 −3 decorators.py
  11. +7 −4 log_configuration.py
  12. +5 −2 mailer.py
  13. +22 −16 run.py
  14. +9 −0 test-requirements.txt
  15. +0 −35 tests/TestPEP8.py
@@ -43,3 +43,5 @@ venv/
.vscode/
.idea/
.mypy_cache/
monkeytype.sqlite3
.pytype/
@@ -12,6 +12,7 @@ scanner:

pycodestyle:
max-line-length: 120 # Default PEP8 is 79, but allow 120 because a lot of people use wider screens nowadays...
ignore: E701 # We now use the syntax `x: int = 9` in typing

only_mention_files_with_errors: True
descending_issues_order: False
descending_issues_order: False
@@ -2,3 +2,4 @@
count = True
max-line-length = 120
exclude=TestDiff.py
ignore = E701
@@ -1,36 +1,27 @@
dist: xenial
language: python
python:
- 3.4
- 3.5
- 3.6
- 3.7
- nightly

matrix:
# allow failing builds on specified python versions
allow_failures:
- python: 3.4
- python: nightly

# environment variables
env:
- TESTING=True

install:
- sudo apt-get install libvirt-dev
- pip install codecov
- pip install nose-cov
- pip install pycodestyle
- pip install pydocstyle
- pip install dodgy
- pip install isort
- pip install mypy
- pip install -r test-requirements.txt
- pip install -r requirements.txt
- pip install Flask-Testing
- pip install blinker
script:
- dodgy
- mypy mod_*
- pydocstyle --config=./.pydocstylerc
- isort -rc --check-only
- pydocstyle --config=./.pydocstylerc
- mypy mod_*
- pycodestyle ./ --config=./.pycodestylerc
- nosetests --nocapture --with-cov --cov-config .coveragerc
after_success:
- codecov
@@ -15,6 +15,9 @@ isort = "*"
dodgy = "*"
mypy = "*"
blinker = "*"
monkeytype = "*"
pytype = "*"
merge-pyi = "*"

[packages]
flask = "*"
@@ -37,4 +40,4 @@ SQLAlchemy = "*"
markdown2 = "*"

[requires]
python_version = "3.6"
python_version = "3.7"

Some generated files are not rendered by default. Learn more.

0 comments on commit bac70b8

Please sign in to comment.
You can’t perform that action at this time.