Skip to content

Move isort/lint commands out of test runner #5819

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from

Conversation

rpkilby
Copy link
Member

@rpkilby rpkilby commented Feb 7, 2018

In general, it doesn't seem necessary to integrate linting and sorting into the test runner. This method complicates running isort with specific options, such as --diff. Moving the command into tox simplifies this, and options can be provided after the -- options separator. eg,

$ tox -e isort -- --diff

Note that the lint travis build runs both the isort and lint builds.

@rpkilby
Copy link
Member Author

rpkilby commented Feb 7, 2018

I don't know if anyone is particularly attached to running isort/flake8 through the test runner.

@rpkilby rpkilby force-pushed the lint-commands branch 2 times, most recently from e0e5a24 to fa2392e Compare February 7, 2018 20:22
Copy link
Contributor

@blueyed blueyed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense.
In the long run we should get completely rid of runtests.py.

@blueyed blueyed mentioned this pull request Feb 7, 2018
@xordoquy
Copy link
Collaborator

xordoquy commented Feb 7, 2018

In the long run we should get completely rid of runtests.py.

We have had this talk before and @tomchristie said no. Can't remember the argument though.

I don't know if anyone is particularly attached to running isort/flake8 through the test runner.

Yes I am. Removing it seems a good way to just discard it simply.

@carltongibson
Copy link
Collaborator

TBH I don't really see the point of this change (or the problem with runtests.py).

Let me close this for now. But I'm happy to discuss it a bit here so we can air the pros and cons. It's easy enough to re-open. (OK?)

@blueyed
Copy link
Contributor

blueyed commented Feb 8, 2018

I really like this change, since it removes an unnecessary wrapper (the custom runtests.py).
It is easier to run it through tox, which has a well-known interface.

@xordoquy

Removing it seems a good way to just discard it simply.

Do you mean that isort gets not checked then anymore?
There would be flake8-isort which could be used (so that it's done with the flake8 run), and runtests.py could be changed (in this PR) to still run isort via the new tox env, possibly through flake8-isort then.

@rpkilby
Copy link
Member Author

rpkilby commented Feb 9, 2018

The intent was to fix a minor annoyance with running isort. The test runner doesn't pass command line arguments to isort, so if you want to use --diff or other options, you either need to invoke isort directly and remember the appropriate arguments, or temporarily modify runtests.py to include those options.

Alternatively, We could add the --diff argument to the test runner, but $ tox -e isort -- --diff seems a little cleaner. Then again, I don't usually invoke the test runner directly and prefer to run the tests via tox, so I'm predisposed to the latter. Again, a small change to fix to a minor annoyance - I don't have particularly strong opinions on this.

@rpkilby rpkilby deleted the lint-commands branch June 23, 2018 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants