plain-summer-7272709/02/2022, 9:58 PM
Has anyone seen this before? There must be some kind of Python versioning issue, but I'm not sure what's going on. Our Lambda runtime is running Python 3.9.
[ERROR] TypeError: the 'package' argument is required to perform a relative import for '.app.lambdex_handler' Traceback (most recent call last): File "/usr/local/lib/python3.9/importlib/__init__.py", line 122, in import_module raise TypeError(msg.format(name))
busy-vase-3920209/02/2022, 10:26 PM
nice-florist-5595809/03/2022, 3:51 AM
flat-zoo-3195209/03/2022, 11:14 AM
ancient-rose-2730609/04/2022, 3:18 AM
bumpy-spoon-5543809/04/2022, 5:38 PM
handsome-sunset-9806809/05/2022, 9:43 AM
... ✓ black made no changes. ✓ docformatter made no changes. ✓ isort made no changes. <--- HERE %
... ✓ black made no changes. ✓ docformatter made no changes. + isort made changes. <--- HERE %
... projects/appsflyer/appsflyer/apps/appsflyer/views.py <-- THE TARGET IS PRESENT ...
acoustic-pizza-1986909/06/2022, 10:31 AM
able-television-9131009/06/2022, 12:46 PM
file or adding it implicitly for mypy and packaging?
bland-father-1971709/06/2022, 2:18 PM
$ ./pants package path/to/pex:bin ... 1. cp38-cp38-manylinux_2_27_x86_64: Failed to resolve all requirements for complete platform cp38-cp38-manylinux_2_27_x86_64 from thirdparty/python/lockfiles/python_default.txt: Configured with: build: False use_wheel: True Dependency on promise not satisfied, 1 incompatible candidate found: 1.) promise 2.3 (via: tensorflow-datasets<5.0.0,>=4.6.0 -> promise) does not have any compatible artifacts: <https://files.pythonhosted.org/packages/cf/9c/fb5d48abfe5d791cd496e4242ebcf87a4bb2e0c3dcd6e0ae68c11426a528/promise-2.3.tar.gz>
green-match-6633709/06/2022, 2:38 PM
Are there any ways to debug this? Open up a Pex??
ModuleNotFoundError: No module named 'main'
bitter-ability-3219009/06/2022, 5:15 PM
little-train-2837109/06/2022, 5:50 PM
I am running into an issue with protocol buffers that require me to lock them to 3.20.x, I already do in one requirements file at the root level. packages inside src/ pick the dependency, but tests don’t
./pants test ::
bitter-ability-3219009/06/2022, 5:52 PM
(happens in any
mode). Pex attached...
$ python3.8 aws.pex Traceback (most recent call last): File "/home/joshuacannon/.pex/venvs/55691004f59e3a2b4d0b5c07b229db01742aa7db/779eb2cc0ca9e2fdd204774cbc41848e4e7c5055/bin/aws", line 21, in <module> import awscli.clidriver ModuleNotFoundError: No module named 'awscli'
incalculable-hydrogen-4400309/06/2022, 10:07 PM
plain-summer-7272709/06/2022, 11:15 PM
[ERROR] ResolveError: Failed to resolve requirements from PEX environment @ /app. Needed cp38-cp38-manylinux_2_26_x86_64 compatible dependencies for: 1: pillow>=6.2.0 Required by: matplotlib 3.5.1 But this pex had no ProjectName(raw='pillow', normalized='pillow') distributions. 2: pillow~=9.2.0 raise ResolveError(/pex/environment.py", line 589, in resolve_distsp_pex_envions.
pillow ~= 9.2.0
as dependencies in my requirements.txt file. When I build my Lambda pacakge locally, I see
in my .deps directory. I figured Pillow ~= 9.2.0 would match matplotlib's Pillow version requirements? What am I doing wrong?
high-yak-8589909/07/2022, 3:48 AM
to specify a default for an env var if it's not set in the caller's environment?
purple-umbrella-8989109/07/2022, 8:01 AM
Notice the missing
mypkg/ subpkg1/ __init__.py subpkg2/ __init__.py
, which makes it an implicit namespace package (PEP-420). Now the test I wrote looks like this:
While this test runs successfully in pytest, it fails in the hermetic environment of pants, because the dependency on
# tests/test_namespace.py import mypkg def test_namespace(): assert mypkg.__file__ is None
does not include any files. The directory
itself is not created in the local environment, so
is not importable. I know there are a couple of trivial solutions to this (
in the test, specifying a dependency manually or checking for the absence of
in pre-commit hooks), but is there any solution in pants that I'm missing, e.g. some configuration option?
busy-vase-3920209/07/2022, 4:11 PM
proud-dentist-2284409/07/2022, 4:38 PM
but it scrolls by too quickly.
./pants help goals
loud-coat-4527009/07/2022, 8:30 PM
nice-florist-5595809/08/2022, 12:18 AM
happy-kitchen-8948209/08/2022, 12:42 AM
incalculable-hydrogen-4400309/08/2022, 4:51 AM
handsome-sunset-9806809/08/2022, 1:54 PM
192207.29 [INFO] Completed: Format with docformatter - docformatter made no changes. 192207.29 [WARN] Completed: Format with isort - isort made changes. /path/to/file1 /path/to/file2 192207.29 [WARN] Completed: Format with Black - black made changes. /path/to/file1 /path/to/file2 + black made changes. ✓ docformatter made no changes. + isort made changes. But I can't see any files changing in the git in vscode?
./pants fmt ::
happy-kitchen-8948209/08/2022, 7:46 PM
cold-sugar-5437609/08/2022, 8:51 PM
freezing-vegetable-9289609/08/2022, 9:17 PM
with all the files (recursively) in a directory as contents. Is there a more maintainable way to do that than just injecting the contents of
pants list dir::
refined-addition-5364409/09/2022, 12:52 PM
some-farmer-9761409/09/2022, 1:33 PM
? I’d be interested in that, what did you do and how did it work out for you?