Skip to content

Commit

Permalink
Eric's feedback.
Browse files Browse the repository at this point in the history
# Rust tests and lints will be skipped. Delete if not intended.
[ci skip-rust]

# Building wheels and fs_util will be skipped. Delete if not intended.
[ci skip-build-wheels]
  • Loading branch information
jsirois committed Feb 16, 2021
1 parent 15035b0 commit b513652
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
6 changes: 6 additions & 0 deletions src/python/pants/backend/codegen/protobuf/python/rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,12 @@ async def generate_python_from_protobuf(
output_filename="mypy_protobuf.pex",
internal_only=True,
requirements=PexRequirements([python_protobuf_subsystem.mypy_plugin_version]),
# TODO(John Sirois): Fix these interpreter constraints to track the actual
# python requirement of the mypy_plugin_version or else plumb an option for
# manually setting the constraint to track what mypy_plugin_version needs:
# https://github.com/pantsbuild/pants/issues/11565
# Here we guess a constraint that will likely work with any mypy_plugin_version
# selected.
interpreter_constraints=PexInterpreterConstraints(["CPython>=3.5"]),
),
),
Expand Down
16 changes: 8 additions & 8 deletions src/python/pants/backend/python/util_rules/pex_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import textwrap
import zipfile
from dataclasses import dataclass
from typing import Dict, Iterable, Iterator, List, Mapping, Optional, Tuple, cast
from typing import Dict, Iterable, Iterator, List, Mapping, Tuple, cast

import pytest
from pkg_resources import Requirement
Expand Down Expand Up @@ -222,7 +222,7 @@ class MockFieldSet(FieldSet):
interpreter_constraints: InterpreterConstraintsField

@classmethod
def create_for_test(cls, address: Address, compat: Optional[str]) -> MockFieldSet:
def create_for_test(cls, address: Address, compat: str | None) -> MockFieldSet:
return cls(
address=address,
interpreter_constraints=InterpreterConstraintsField(
Expand Down Expand Up @@ -326,14 +326,14 @@ def create_pex_and_get_all_data(
*,
pex_type: type[Pex | VenvPex] = Pex,
requirements: PexRequirements = PexRequirements(),
entry_point: Optional[str] = None,
entry_point: str | None = None,
interpreter_constraints: PexInterpreterConstraints = PexInterpreterConstraints(),
platforms: PexPlatforms = PexPlatforms(),
sources: Optional[Digest] = None,
additional_inputs: Optional[Digest] = None,
sources: Digest | None = None,
additional_inputs: Digest | None = None,
additional_pants_args: Tuple[str, ...] = (),
additional_pex_args: Tuple[str, ...] = (),
env: Optional[Mapping[str, str]] = None,
env: Mapping[str, str] | None = None,
internal_only: bool = True,
) -> Dict:
request = PexRequest(
Expand Down Expand Up @@ -376,10 +376,10 @@ def create_pex_and_get_pex_info(
*,
pex_type: type[Pex | VenvPex] = Pex,
requirements: PexRequirements = PexRequirements(),
entry_point: Optional[str] = None,
entry_point: str | None = None,
interpreter_constraints: PexInterpreterConstraints = PexInterpreterConstraints(),
platforms: PexPlatforms = PexPlatforms(),
sources: Optional[Digest] = None,
sources: Digest | None = None,
additional_pants_args: Tuple[str, ...] = (),
additional_pex_args: Tuple[str, ...] = (),
internal_only: bool = True,
Expand Down

0 comments on commit b513652

Please sign in to comment.