Skip to content
This repository has been archived by the owner on Dec 4, 2024. It is now read-only.

Python cleanup #308

Merged
merged 9 commits into from
Sep 9, 2016
Merged

Python cleanup #308

merged 9 commits into from
Sep 9, 2016

Conversation

JayH5
Copy link
Contributor

@JayH5 JayH5 commented Sep 9, 2016

General cleanup of Python code, mostly around imports and the test runner.

  • Apply PEP-8 guidelines to imports: https://www.python.org/dev/peps/pep-0008/#imports
  • Split development requirements into requirements-dev.txt
  • Add note to README about how to run tests
  • Use pytest to run tests
  • Use pytest-cov for coverage tests
  • Use pytest-pep8 for pep8 style check
  • Fix some duplicated test names (this was causing at least 2 tests not to run)

This will obviously need someone to update the CI settings so that requirements are installed properly and all the tests are run.

There is one more problem with the code that I picked up running flake8: this method doesn't actually set ip_cache as it sets ip_cache local to the method, not the module. I'd recommend running a linter like flake8 as part of the build, but it's a separate command that would need to be added to the CI so I can't do that.

* Conform to PEP8: stdlib -> 3rd party -> local ordering
* Alphabetise imports
* Remove some unused imports
* Don't use * imports so that linters can check for missing imports
* Sort requirements alphabetically
* Add nose as it seems to be what is used to run tests
@mesosphere-ci
Copy link

Can one of the admins verify this patch?

@brndnmtthws
Copy link
Contributor

test this please

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants