Code and tooling improvements #408

Merged
merged 11 commits into from May 20, 2016

Projects

None yet

2 participants

@prydie
Contributor
prydie commented May 19, 2016

Small PR to start with. The main points are:

  • isort should now be run by travis
  • test results should be upload to codecov from travis
  • E302 inconsistencies fixed.
@frewsxcv
Collaborator

Looks great! Though we need to use a tool to generate code coverage. codecov just looks for the .coverage file and uploads it to the servers. Since it doesn't exist, coverage isn't working.

  _____          _
 / ____|        | |
| |     ___   __| | ___  ___ _____   __
| |    / _ \ / _` |/ _ \/ __/ _ \ \ / /
| |___| (_) | (_| |  __/ (_| (_) \ V /
 \_____\___/ \__,_|\___|\___\___/ \_/
                                0db33a1
==> Travis CI detected.
(root) .
==> Running gcov (disable via -X gcov)
  -> gcov in .
==> Searching for coverage reports
    Found 1 reports.
**> Python coverage not found
**> No coverage report found.
@frewsxcv
Collaborator

In other words, http://coverage.readthedocs.io/en/coverage-4.0.3/ will probably need to be incorporated.

@prydie
Contributor
prydie commented May 19, 2016

I'm working on it at the moment actually. The issue I'm coming up against now is that now I'm integrating it with tox it's also being run when you run tox locally. This only causes the below message to be displayed for each testenv but it's by no means ideal.

py27-1.9.x runtests: commands[1] | codecov -e TOXENV

      _____          _
     / ____|        | |
    | |     ___   __| | ___  ___ _____   __
    | |    / _ \ / _  |/ _ \/ __/ _ \ \ / /
    | |___| (_) | (_| |  __/ (_| (_) \ V /
     \_____\___/ \____|\___|\___\___/ \_/
                                    v2.0.3

==> Detecting CI provider
  -> Got branch from git/hg
  -> Got sha from git/hg
==> Preparing upload
Error: Missing repository upload token

Tip: See all example repositories: https://github.com/codecov?query=example
Support channels:
  Email:   hello@codecov.io
  IRC:     #codecov
  Gitter:  https://gitter.im/codecov/support
  Twitter: @codecov
@frewsxcv
Collaborator

I'm fine putting the codecov logic in tox, though I think it would also be okay to leave it in the Travis CI file since we only want it to upload to their servers in the CI environment.

prydie added some commits May 20, 2016
@prydie prydie django-crispy-forms inspired Makefile + py.test develop / test commands 7c8e644
@prydie prydie Fix unnecessary database access in tests 0b10e79
@prydie prydie Another overhaul of tox.ini and .travis.yml 8030603
@prydie prydie Added Andrew Pryde to AUTHORS 44002f1
@prydie prydie Fix $TOX_ENV - $TOXENV
23dc1f1
@prydie prydie Added build and coverage buttons, improved passing env vars to codecov,
and fixed additional (broken) TOXENV
5bcfdf1
@prydie
Contributor
prydie commented May 20, 2016

@frewsxcv It should now be ready for merging. I have added the coverage and build buttons to the README.rst, vastly simplified the tox.ini and coverage.io is finally working.

I'm happy to rebase the branch and create a new pull request if you'd prefer to keep the history clean (or indeed "squash and merge" may be appropriate).

@frewsxcv frewsxcv commented on the diff May 20, 2016
@@ -0,0 +1,8 @@
+.PHONY: develop test
+
@frewsxcv
frewsxcv May 20, 2016 Collaborator

I'm not really a fan of Makefiles personally. Is it possible we could just reuse the existing runtests.py file? Otherwise, it's not that big of a deal I guess

@prydie
prydie May 20, 2016 Contributor

I don't think py.test would work with the existing runtests.py code (but I may be wrong). Makefiles are used across a number of popular Django projects in this way (see wagtail, django-model-utils, django-activity-stream etc.). What about them do you dislike?

@frewsxcv
frewsxcv May 20, 2016 Collaborator

In your particular examples (and the one in this PR) I don't have many complaints since it's so simple, but I think the syntax is unintuitive at times and results in a giant mess of spaghetti (🍝 💻 ). Anyways, what you have here seems simple enough so no reason to hold this PR up.

@frewsxcv
Collaborator

This is great! Just left one comment, but then this should be good to go! 🎊

@frewsxcv
Collaborator

Thanks for your contribution!

@frewsxcv frewsxcv merged commit e6a0e19 into alex:master May 20, 2016

2 checks passed

codecov/patch 100% of diff hit (target 90.12%)
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@prydie
Contributor
prydie commented May 20, 2016

Thanks for your contribution!

My pleasure 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment