-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Remove runtests.py #5274
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
Remove runtests.py #5274
Conversation
8722b57
to
1b03518
Compare
I'm not completely sure what is the ideal workflow. I've separated the tests from the self check, but it is one of the tests that one should run before opening a PR.
(Or maybe you meant something entirely different? @gvanrossum @ilevkivskyi) |
I personally would prefer to leave the self check under pytest, as it is a bit of a lengthy command to type out the entire command, and not very memorable. However I defer to the judgement of others, I can always use tox :) |
I don't have a strong preference about whether to run self check under pytest, but if it's not being run under pytest, we should definitely have a simple, consistent way of running self check locally instead of running a long command line. It would be good to have an easy way of self checking using dmypy as well. |
I would rather keep all three separate: tests, self-check, and flake8 (but this is also not a strong preference). For self-check I am mostly using
|
I would actually prefer to have everything (including self-check and lint) run under pytest, so that it's easy to run all tests locally without having to remember a lot of commands. |
Looks like the simplest solution is to keep runtests as a simple scripts that executes pytest, self check and lint. |
This is still worse that the legacy script since it will be harder to run just lint or self check. Whatever solution we use to replace runtests should make all of these easy (i.e. no need to remember complex command lines):
Nice to haves, for extra credit:
|
Ok. Here's another suggestion:
Passing arguments to self check will be performed manually. Possibly use |
Maybe even simpler, only use `runtests.py [lint] [self] [pytest]` -- for
test selection it's best to directly call `pytest -k ...`.
|
502b55e
to
aafab7a
Compare
Done. The commands are |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few minor points. Overall looks great!
runtests.py
Outdated
import os | ||
from os.path import join, isdir | ||
from sys import exit | ||
from os import system | ||
import sys |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: maybe fold this and the sys.exit import into one import?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
runtests.py
Outdated
for arg in args: | ||
cmd = cmds[arg] | ||
print('$', cmd) | ||
res = (system(cmd) & 0x7F00) >> 8 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the bit twiddling here? Wouldn't it be better to use subrocess.call
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want to have the full command copy-pastable in the source. To clarify that this is a shorthand script, and that nothing more is going on than a mere execution of a command.
.travis.yml
Outdated
- if [[ $TRAVIS_PYTHON_VERSION == '3.6' ]]; then flake8; fi | ||
- if [[ $TRAVIS_PYTHON_VERSION == '3.5.1' ]]; then python runtests.py package; fi | ||
- pytest -n12 | ||
- if [[ $TRAVIS_PYTHON_VERSION == '3.6' ]]; then flake8 -j0; fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps we should have j12 here too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no idea.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, because why not.
tox.ini
Outdated
|
||
[testenv:type] | ||
description = type check ourselves | ||
basepython = python3.6 | ||
commands = python runtests.py self-check -p '-n0' -p '-v' | ||
commands = python3 -m mypy -p mypy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For consistency, we should point to the self-check config here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@ethanhs do you approve now? |
You have a merge conflict, but otherwise I approve. |
I have no idea what's this conflict is about. It does not show up in my local merge, and the "resolve conflicts" key is disabled. |
Moreover, the conflict said to be in a file that should be removed completely. |
It is listed when I merge master as |
But it does not exist. ~/workspace/mypy$ git status
On branch pytest-complete
Your branch is up to date with 'origin/pytest-complete'.
nothing to commit, working tree clean
~/workspace/mypy$ git rm waiter.py
fatal: pathspec 'waiter.py' did not match any files |
Ah, if it doesn't exist on disk you need |
The conflict is presumably that somebody else modified waiter.py on master, and you deleted it. The way to fix it would be to run |
|
Sorry guys I'm so amazingly stupid. I've merged upstream/master but forgot |
@ethanhs -- just to check, we can merge this now, right? |
@Michael0x2a yes, this should be good to go. |
Thanks for all the work on tests @elazarg! |
Yes, thanks Elazar!
On Wed, Jul 18, 2018 at 4:39 PM Ivan Levkivskyi ***@***.***> wrote:
Thanks for all the work on tests @elazarg <https://github.com/elazarg>!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#5274 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ACwrMpljctPPpxV0MIyRwAbRFzr_PTveks5uH8clgaJpZM4U1mgo>
.
--
--Guido (mobile)
|
This is great! Thanks Elazar! |
runtests.py
with agentle reminder to use pytestscript that executes pytest+lint+self check.waiter.py
python3 -m mypy --config-file mypy_self_check.ini -p mypy
flake8 -j0
This is work-in-progress, here for review and testing. I tried to implement what I understood from the comments in #5270, but I'm not sure I got it right.
TODO: fix test run in typeshed.
Concludes #1673.