high-magician-46188
01/04/2023, 2:11 PMhigh-magician-46188
01/04/2023, 2:11 PMpants package ::, I get:
14:55:09.31 [INFO] Initializing scheduler...
14:55:09.76 [INFO] Scheduler initialized.
14:55:21.90 [INFO] stdout: "environ({'PANTS_BIN_NAME': './pants'})"
14:55:21.90 [INFO] stdout: "environ({'PANTS_BIN_NAME': './pants'})"
14:55:21.90 [ERROR] 1 Exception encountered:
Engine traceback:
in `package` goal
in Resolve transitive targets
in Resolve direct dependencies of target - package_a/package_a/main.py:../package-a-sources
InvalidFieldException: The target package_a/package_a/main.py:../package-a-sources has the `interpreter_constraints` ('==3.10.*',), which are not a subset of the `interpreter_constraints` of some of its dependencies:
* ('>=3.9,<=3.10',): package_b/file_1.py:../../package-b-sources
To fix this, you should likely adjust package_a/package_a/main.py:../package-a-sources's `interpreter_constraints` to match the narrowest range in the above list.
My pants.toml has the line: interpreter_constraints = ["CPython>=3.9,<=3.10"].
Package A's BUILD file has the line: python_sources(interpreter_constraints=["==3.10.*"],.
Package B's BUILD file has the line: python_sources(interpreter_constraints=[">=3.9,<=3.10"],.
Did I misconfigured it?high-magician-46188
01/04/2023, 2:13 PMenough-analyst-54434
01/04/2023, 5:01 PMenough-analyst-54434
01/04/2023, 5:03 PM>=3.9,<=3.10 constraints are odd. You must not mean ==3.9.* though since you use that notation elsewhere in ==3.10.*. What exactly are you trying to achieve with >=3.9,<=3.10?high-magician-46188
01/05/2023, 12:35 PM>=3.9,<=3.10 is meant to mean ==3.9.* or ==3.10.*.
I have some packages that are 3.10 only and some that support both 3.9 and 3.10.
Is there a different recommended way to support it?enough-analyst-54434
01/05/2023, 12:41 PM>=3.9,<3.11 the <=3.10 was not doing what you hoped.enough-analyst-54434
01/05/2023, 12:42 PMenough-analyst-54434
01/05/2023, 12:46 PMpex_binary or something else? Can you narrow down the :: to the problematic target in other words?high-magician-46188
01/05/2023, 1:12 PMBUILD file:
python_sources(
name="package-a-sources",
sources=["paackage_a/**/*.py"],
interpreter_constraints=[">=3.9,<=3.10"],
)
resource(name="pyproject", source="pyproject.toml")
python_distribution(
name="package-a-dist-pure-wheel",
dependencies=[
":pyproject",
":package-sources",
# Dependencies on code to be packaged into the distribution.
],
provides=python_artifact(
name="package-a",
),
wheel_config_settings={
"--global-option": ["--python-tag", "py3"]
},
generate_setup=True,
sdist=False,
wheel=True,
)high-magician-46188
01/05/2023, 3:07 PM3.9.0 and 3.10.999 in pants.toml fixed it.
Should I submit it as a bug?enough-analyst-54434
01/05/2023, 3:10 PMhigh-magician-46188
01/05/2023, 3:11 PM3.9 > 3.10 due to string comparison?enough-analyst-54434
01/05/2023, 3:12 PMenough-analyst-54434
01/05/2023, 3:13 PMenough-analyst-54434
01/05/2023, 3:14 PMenough-analyst-54434
01/05/2023, 3:15 PMhigh-magician-46188
01/05/2023, 3:17 PMhigh-magician-46188
01/05/2023, 3:17 PM