-
Notifications
You must be signed in to change notification settings - Fork 234
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
fix: minor touchups based on stricter mypy settings #1060
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,7 +31,7 @@ repos: | |
hooks: | ||
- id: pycln | ||
args: [--all] | ||
additional_dependencies: [click<8.1] # temporary workaround until typer updates | ||
stages: [manual] | ||
|
||
- repo: https://github.com/PyCQA/isort | ||
rev: 5.10.1 | ||
|
@@ -54,7 +54,7 @@ repos: | |
- id: mypy | ||
name: mypy 3.6 on cibuildwheel/ | ||
exclude: ^(bin|cibuildwheel/resources|docs)/.*py$ | ||
args: ["--python-version=3.6", "--show-error-codes"] | ||
args: ["--python-version=3.6"] | ||
additional_dependencies: &mypy-dependencies | ||
- nox | ||
- packaging>=21.0 | ||
|
@@ -72,11 +72,11 @@ repos: | |
- id: mypy | ||
name: mypy 3.7+ on bin/ | ||
files: ^((bin|docs)/.*py)$ | ||
args: ["--python-version=3.7", "--show-error-codes"] | ||
args: ["--python-version=3.7"] | ||
additional_dependencies: *mypy-dependencies | ||
- id: mypy | ||
name: mypy 3.10 | ||
args: ["--python-version=3.10", "--show-error-codes"] | ||
args: ["--python-version=3.10"] | ||
additional_dependencies: *mypy-dependencies | ||
|
||
- repo: https://github.com/asottile/yesqa | ||
|
@@ -98,8 +98,6 @@ repos: | |
hooks: | ||
- id: python-check-blanket-noqa | ||
stages: [manual] | ||
- id: python-check-blanket-type-ignore | ||
stages: [manual] | ||
Comment on lines
-101
to
-102
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In MyPy 0.940, this is now an option, and using MyPy, it not only tells you that you need an error code, it suggests the correct one! :) |
||
- id: python-no-log-warn | ||
- id: python-no-eval | ||
- id: python-use-type-annotations | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -96,7 +96,7 @@ def architectures(self) -> Set[Architecture]: | |
return self.globals.architectures | ||
|
||
|
||
Setting = Union[Dict[str, str], List[str], str] | ||
Setting = Union[Dict[str, str], List[str], str, int] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Discovered by the unreachable check. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice. |
||
|
||
|
||
class Override(NamedTuple): | ||
|
@@ -482,21 +482,20 @@ def build_options(self, identifier: Optional[str]) -> BuildOptions: | |
|
||
if not config_value: | ||
# default to manylinux2014 | ||
image = pinned_images.get("manylinux2014") | ||
image = pinned_images["manylinux2014"] | ||
elif config_value in pinned_images: | ||
image = pinned_images[config_value] | ||
else: | ||
image = config_value | ||
|
||
assert image is not None | ||
manylinux_images[build_platform] = image | ||
|
||
for build_platform in MUSLLINUX_ARCHS: | ||
pinned_images = all_pinned_docker_images[build_platform] | ||
|
||
config_value = self.reader.get(f"musllinux-{build_platform}-image") | ||
|
||
if config_value is None: | ||
if not config_value: | ||
Comment on lines
-499
to
+498
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @mayeut The original version should be impossible to reach - Discovered by unreachability. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (Going to mark this draft until verified) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Seems right. Not sure why it wasn't checked like manylinux here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's another difference between musllinux & manylinux.
while musllinux has (after the change):
Not sure why I've not been through the entire history so there might be some historic reasons for this being written this way but might not make sense anymore. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd guess it's a historical thing, perhaps from the days that manylinux2010 was the default on some platforms and manylinux2014 on others.
Agreed. |
||
image = pinned_images["musllinux_1_1"] | ||
elif config_value in pinned_images: | ||
image = pinned_images[config_value] | ||
|
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.
Moving this to manual, since it's still very handy, but can get in the way.