plain-summer-72727
09/02/2022, 9:58 PM[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))
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.busy-vase-39202
09/02/2022, 10:26 PMnice-florist-55958
09/03/2022, 3:51 AMflat-zoo-31952
09/03/2022, 11:14 AMancient-rose-27306
09/04/2022, 3:18 AMbumpy-spoon-55438
09/04/2022, 5:38 PMhandsome-sunset-98068
09/05/2022, 9:43 AM./pants
fmt
::
...
✓ black made no changes.
✓ docformatter made no changes.
✓ isort made no changes. <--- HERE
% ./pants
fmt
projects/appsflyer/appsflyer/apps/appsflyer/views.py
...
✓ black made no changes.
✓ docformatter made no changes.
+ isort made changes. <--- HERE
% ./pants
list
::
...
projects/appsflyer/appsflyer/apps/appsflyer/views.py <-- THE TARGET IS PRESENT
...acoustic-pizza-19869
09/06/2022, 10:31 AMable-television-91310
09/06/2022, 12:46 PMpy.typed
file or adding it implicitly for mypy and packaging?bland-father-19717
09/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-66337
09/06/2022, 2:38 PMModuleNotFoundError: No module named 'main'
Are there any ways to debug this? Open up a Pex??bitter-ability-32190
09/06/2022, 5:15 PMlittle-train-28371
09/06/2022, 5:50 PM./pants test ::
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’tbitter-ability-32190
09/06/2022, 5:52 PMawscli
(happens in any layout
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-44003
09/06/2022, 10:07 PMplain-summer-72727
09/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.
I have pillow ~= 9.2.0
and matplotlib==3.5.1
as dependencies in my requirements.txt file. When I build my Lambda pacakge locally, I see Pillow-9.2.0-cp38-cp38-manylinux_2_28_x86_64.whl
in my .deps directory. I figured Pillow ~= 9.2.0 would match matplotlib's Pillow version requirements? What am I doing wrong?high-yak-85899
09/07/2022, 3:48 AMpants.toml
to specify a default for an env var if it's not set in the caller's environment?purple-umbrella-89891
09/07/2022, 8:01 AMmypkg/
subpkg1/
__init__.py
subpkg2/
__init__.py
Notice the missing __init__.py
under mypkg
, which makes it an implicit namespace package (PEP-420). Now the test I wrote looks like this:
# tests/test_namespace.py
import mypkg
def test_namespace():
assert mypkg.__file__ is None
While this test runs successfully in pytest, it fails in the hermetic environment of pants, because the dependency on mypkg
does not include any files. The directory mypkg
itself is not created in the local environment, so mypkg
is not importable.
I know there are a couple of trivial solutions to this (import mypkg.subpkg1
in the test, specifying a dependency manually or checking for the absence of mypkg/__init__.py
in pre-commit hooks), but is there any solution in pants that I'm missing, e.g. some configuration option?busy-vase-39202
09/07/2022, 4:11 PMproud-dentist-22844
09/07/2022, 4:38 PM./pants help goals
but it scrolls by too quickly.loud-coat-45270
09/07/2022, 8:30 PMnice-florist-55958
09/08/2022, 12:18 AMhappy-kitchen-89482
09/08/2022, 12:42 AMincalculable-hydrogen-44003
09/08/2022, 4:51 AMhandsome-sunset-98068
09/08/2022, 1:54 PM./pants fmt ::
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?happy-kitchen-89482
09/08/2022, 7:46 PMcold-sugar-54376
09/08/2022, 8:51 PMfreezing-vegetable-92896
09/08/2022, 9:17 PMpython_distribution
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::
into the dependencies
field?refined-addition-53644
09/09/2022, 12:52 PMsome-farmer-97614
09/09/2022, 1:33 PMnix
and pants
? I’d be interested in that, what did you do and how did it work out for you?