gentle-guitar-84783
09/15/2022, 5:56 PMgentle-guitar-84783
09/15/2022, 5:57 PM./pants publish
but I can push and pull manually with no problemssparse-lifeguard-95737
09/15/2022, 6:02 PMsparse-lifeguard-95737
09/15/2022, 6:02 PMsparse-lifeguard-95737
09/15/2022, 6:03 PMpants.toml
we set:
[docker]
tools = ["docker-credential-ecr-login", "sh"]
env_vars = [
"HOME",
# AWS auth vars.
"AWS_PROFILE",
"AWS_DEFAULT_REGION",
"AWS_ACCESS_KEY_ID",
"AWS_SECRET_ACCESS_KEY",
"AWS_SESSION_TOKEN",
"AWS_ROLE_ARN",
"AWS_WEB_IDENTITY_TOKEN_FILE",
]
gentle-guitar-84783
09/15/2022, 6:03 PMgentle-guitar-84783
09/15/2022, 6:06 PMtools
seems to be an invalid option, might have to upgrade pants I guesssparse-lifeguard-95737
09/15/2022, 6:06 PMancient-wall-52690
09/15/2022, 7:09 PMpackage
goal after upgrading from 2.11.1
to 2.13.0
. I’ve searched through my config and build files, but I’m really not sure where this is coming from. No other code changes besides updating the version number in pants.toml
.
NoSourceRootError: No source root found for `3rdparty`
Any suggestions how to troubleshoot this?handsome-sunset-98068
09/16/2022, 8:18 AMFailed to resolve all requirements for abbreviated platform cp39-cp39-linux_x86_64 from 3rdparty/python/default.lock:
Configured with:
build: False
use_wheel: True
Dependency on img2pdf not satisfied, 1 incompatible candidate found:
1.) img2pdf 0.4.4 (via: img2pdf==0.4.4) does not have any compatible artifacts:
<https://files.pythonhosted.org/packages/95/b5/f933f482a811fb9a7b3707f60e28f2925fed84726e5a6283ba07fdd54f49/img2pdf-0.4.4.tar.gz>
enough-queen-60902
09/16/2022, 8:22 AMCreateDigest
handsome-sunset-98068
09/16/2022, 8:36 AMpython_sources()
python_awslambda(
name="img2pdf-lambda",
runtime="python3.9",
handler="./handler.py:lambda_handler",
)
handler.py
import img2pdf
def lambda_handler(event, context):
print('hello world')
refined-addition-53644
09/16/2022, 9:17 AM```Configured with:
build: False
use_wheel: True```To me it seems like since pants is not allowing the build and the wheels don’t exist, it fails But I didn’t know you can configure this. EDIT: This is from pants logs
handsome-sunset-98068
09/16/2022, 9:19 AMrefined-addition-53644
09/16/2022, 9:22 AMhandsome-sunset-98068
09/16/2022, 9:40 AM[GLOBAL]
pants_version = "2.12.0"
backend_packages.add = [
'pants.backend.python',
"pants.backend.python.mixed_interpreter_constraints",
"pants.backend.awslambda.python",
'pants.backend.python.lint.docformatter',
'pants.backend.python.lint.black',
'pants.backend.python.lint.flake8',
'pants.backend.python.lint.isort',
'pants.backend.python.typecheck.mypy',
]
[anonymous-telemetry]
enabled = false
[source]
root_patterns = ["/", "projects"]
[python]
interpreter_constraints = ["CPython>=3.9"]
enable_resolves = true
lockfile_generator = "pex"
[python-infer]
string_imports = true
[pytest]
lockfile = "3rdparty/python/pytest.txt"
version = "pytest>=7.1.2,<7.2"
extra_requirements.add = [
"pytest-django>=4.5.2,<5",
]
execution_slot_var = "PANTS_EXECUTION_SLOT" # (controlling (test) parallelism) If a non-empty string, the process execution slot id (an integer) will be exposed to tests under this environment variable name.
args = ["-s"]
bitter-tiger-53933
09/16/2022, 10:23 AMhigh-energy-55500
09/16/2022, 12:58 PM./pants run
on a shell command? the docs recommend the following template:
experimental_shell_command(
name="my-script",
command="./my-script.sh --flag",
dependencies=[":scripts"],
)
which i can the call with e.g. ./pants run src:my-script
. but the command
here appears to be static, what if I wanted to pass in a variable? ./pants run src:my-script -- foo
doesn’t seem to workhigh-energy-55500
09/16/2022, 1:06 PMhappy-kitchen-89482
09/16/2022, 3:50 PMhappy-kitchen-89482
09/16/2022, 3:50 PMenough-queen-60902
09/16/2022, 4:08 PMhappy-kitchen-89482
09/16/2022, 5:51 PMbusy-vase-39202
09/16/2022, 5:55 PMbusy-vase-39202
09/16/2022, 5:55 PMenough-analyst-54434
09/16/2022, 6:54 PMConfigured with:
build: False
use_wheel: True
That's really just Pex's reaction to pants passing --platform linux_x86_64-cp-39-cp39
which is what it does to tell Pex - "Hey, I know we're on Mac, but try to build a venv that works on Linux". Since we're on Mac, we cannot build sdists into Linux wheels without cross-building. Pex does not support cross-building and so it only allows pre-built wheels. The resolve fails since there is no pre-built wheel for img2pdf
. You need to build one for Linux and then make it available in a --find-links
repo for Pex to find. When using Pants you configure this with `[python-repos] repos = ...`: https://www.pantsbuild.org/docs/reference-python-repos#reposenough-analyst-54434
09/16/2022, 6:55 PMrich-london-74860
09/16/2022, 7:58 PMextras
) and within that library, a file imports another module from the same library plus some 3rd party dependencies like:
from extras.foo import bar
from pyspark.sql import functions as F
pylint
correctly identifies this as wrong-import-order
since 3rd party libraries should come first, but if we manually change the import order, isort
incorrectly identifies both as 3rd party libraries and puts extras
ahead of pyspark
. It seems like isort
does not know when something is a local import.bumpy-spoon-55438
09/16/2022, 8:44 PMhappy-kitchen-89482
09/16/2022, 9:02 PMoutput_directories
and output_files
tell the Process where to gather outputs from when it finishes running and has to return outputs to the engine.