wide-midnight-78598
05/08/2023, 3:55 PMenough-analyst-54434
05/08/2023, 6:52 PMwide-midnight-78598
05/08/2023, 7:01 PM__main__.py
would have python3.9 at the top, when I've specified 3.11 interpreter constraints and platforms?
#!/usr/bin/env python3.9
import os
import sys
__INSTALLED_FROM__ = '__PEX_EXE__'
pants.toml
[python]
enable_resolves = true
interpreter_constraints = [">=3.11"]
#requirement_constraints = "requirements.constraints.txt"
[python.resolves]
pants-plugins = "build-support/pants-plugins/lock.txt"
python-default = "build-support/python/default_lock.txt"
[python.resolves_to_interpreter_constraints]
pants-plugins = [">=3.9,<3.10"]
# BUILD.pants
pex_binary(
name="apigateway",
dependencies=[
":libapigateway",
"//:reqs#uvicorn",
],
interpreter_constraints = [">=3.11"],
output_path="backend/apigateway/apigateway.pex",
include_tools=True,
platforms=["linux-x86_64-cp-311-cp311", "macosx-13.3-arm64-cp-311-cp311",]
)
__ main__.py
enough-analyst-54434
05/09/2023, 1:42 PMwide-midnight-78598
05/09/2023, 1:44 PMenough-analyst-54434
05/09/2023, 1:44 PMwide-midnight-78598
05/09/2023, 1:46 PMSet the generated PEX to use this shebang, rather than the default of PEX choosing a shebang based on the interpreter constraints.It's not choosing a default based on the interpreter_constraints when called via Pants
enough-analyst-54434
05/09/2023, 1:57 PMwide-midnight-78598
05/09/2023, 2:01 PMscie
- but now I have to try pex
level to get this working in an Azure container controlled by not-me, which is why I'm even fiddling around with this