-
Notifications
You must be signed in to change notification settings - Fork 308
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
Tidy mypy and tox config #614
Conversation
Ah, interesting. mypy failed with:
Which I didn't catch, because I've been using py38 locally. I'll fix that. |
98671cb
to
516ccce
Compare
I tweaked the Travis configuration to do type checking with the latest and oldest supported Python versions. @jaraco what do you think? |
Thanks for putting this together and including me. I have a slight preference to make the CI routines as generic as possible and the tox.ini as portable as possible. By adding separate build steps across different python versions but only on Travis, it adds to the complication of those builds, raising the bar for moving to another platform. It additionally increases the variance of this project's Travis file compared to other projects. That said, this project isn't part of any collection of projects, and the typing stage is already a deviation from the procedures I follow on other projects, so it's really not a big deal. Moreover, I don't have a lot of experience with typing or mypy, so I don't have any better recommendation to make at this point. You have my endorsement. I do have one question regarding the typing - is it the case that there are situations where testing on latest would catch errors not on oldest and vice versa? If one could reasonably expect just one of those runs to catch 99.9% of issues, I'd prefer to use just that one. |
For an example of how I approach this need in my other projects, I've committed jaraco/skeleton@7455f2f. Note how this few-line change will enable mypy testing for users running |
057f766
to
8f59023
Compare
8f59023
to
3f6c6aa
Compare
Yes. In our case,
I still prefer to use tools like mypy and black directly, but these comments got me thinking about ways to simplify. To that end, I've reworked Due to the scope of these changes, I'm going to request review from the other maintainers. Open questions:
One alternative to including mypy in
This seems to work regardless of the |
a5637d7
to
7ff608c
Compare
Alrighty, I've reverted my experiment. Thanks for indulging me; I've got better insight into how y'all use tox. Remaining changes for approval: |
@jaraco @sigmavirus24 Any more thoughts before I merge this? Specifically re: #614 (comment). |
Ship it |
No objections. |
Thanks, y'all. A potential future enhancement would be to use tox's new support for generative section names: diff --git a/tox.ini b/tox.ini
index 14738c2..e330d4a 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,6 +1,6 @@
[tox]
minversion = 2.4
-envlist = lint,types,py{36,37,38},docs
+envlist = lint,types-py{36,38},py{36,37,38},docs
[testenv]
deps =
@@ -46,7 +46,7 @@ commands =
black --check --diff twine/ tests/
flake8 twine/ tests/
-[testenv:types]
+[testenv:types-py{36,38}]
skip_install = True
deps =
mypy |
Towards #231
Use explicit
ignore_missing_imports
. I think this could help us keep an eye on projects that might add annotations in the future. It will also cause mypy to fail if somebody adds a library that's missing them, which seems like an opportunity to make a thoughtful choice about how to proceed.Remove monketype from tox.ini, since it's no longer needed
Add
skip_install = True
to formatting and linting tox environments, to speed them upReworked tox and Travis config: Tidy mypy and tox config #614 (comment)