fancy-policeman-6755
03/27/2024, 4:26 PMattrs
which looks like hasn't been touched for 2 years
https://github.com/pex-tool/pex/blob/main/pex/vendor/_vendored/attrs/attr/__init__.py
Meanwhile, attrs
itself has changed, and in particular added an AttrsInstance
in here
https://github.com/python-attrs/attrs/blob/main/src/attrs/__init__.py
We have a dependency that transitively depends on this attrs
feature, which causes our app to fail upon startup, since the dependency (great expectations) ends up loading the version internally bundled by the PEX, instead of the external one (that is anyway specified in the lockfile).curved-manchester-66006
03/27/2024, 4:56 PMimport attrs
. Is great expectations doing imports in an unusual way?
$ less pex-2.2.2-py2.py3-none-any.whl | grep attrs | head -5
459 Defl:N 290 37% 02-02-2020 00:00 b53c5e26 pex/attrs.py
163 Defl:N 140 14% 02-02-2020 00:00 fe7644f2 pex/vendor/_vendored/attrs/.layout.json
0 Defl:N 2 0% 02-02-2020 00:00 00000000 pex/vendor/_vendored/attrs/__init__.py
1672 Defl:N 725 57% 02-02-2020 00:00 704e0178 pex/vendor/_vendored/attrs/attr/__init__.py
15100 Defl:N 3036 80% 02-02-2020 00:00 6ed87c02 pex/vendor/_vendored/attrs/attr/__init__.pyi
fancy-policeman-6755
03/27/2024, 4:58 PMcurved-manchester-66006
03/27/2024, 4:58 PMfancy-policeman-6755
03/27/2024, 4:59 PM[2024-03-27, 15:04:07 UTC] {subprocess.py:93} INFO - Traceback (most recent call last):
[2024-03-27, 15:04:07 UTC] {subprocess.py:93} INFO - File "<frozen runpy>", line 198, in _run_module_as_main
[2024-03-27, 15:04:07 UTC] {subprocess.py:93} INFO - File "<frozen runpy>", line 88, in _run_code
[2024-03-27, 15:04:07 UTC] {subprocess.py:93} INFO - File "/data/cache/.pex/unzipped_pexes/c3349f9a365512d9ab2e9149a2f882cb22884192/__main__.py", line 106, in <module>
[2024-03-27, 15:04:07 UTC] {subprocess.py:93} INFO - bootstrap_pex(__entry_point__, execute=__execute__, venv_dir=__venv_dir__)
[2024-03-27, 15:04:07 UTC] {subprocess.py:93} INFO - File "/data/cache/.pex/unzipped_pexes/c3349f9a365512d9ab2e9149a2f882cb22884192/.bootstrap/pex/pex_bootstrapper.py", line 618, in bootstrap_pex
[2024-03-27, 15:04:07 UTC] {subprocess.py:93} INFO - pex.PEX(entry_point).execute()
[2024-03-27, 15:04:07 UTC] {subprocess.py:93} INFO - File "/data/cache/.pex/unzipped_pexes/c3349f9a365512d9ab2e9149a2f882cb22884192/.bootstrap/pex/pex.py", line 560, in execute
[2024-03-27, 15:04:07 UTC] {subprocess.py:93} INFO - sys.exit(self._wrap_coverage(self._wrap_profiling, self._execute))
[2024-03-27, 15:04:07 UTC] {subprocess.py:93} INFO - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[2024-03-27, 15:04:07 UTC] {subprocess.py:93} INFO - File "/data/cache/.pex/unzipped_pexes/c3349f9a365512d9ab2e9149a2f882cb22884192/.bootstrap/pex/pex.py", line 467, in _wrap_coverage
[2024-03-27, 15:04:07 UTC] {subprocess.py:93} INFO - return runner(*args)
[2024-03-27, 15:04:07 UTC] {subprocess.py:93} INFO - ^^^^^^^^^^^^^
[2024-03-27, 15:04:07 UTC] {subprocess.py:93} INFO - File "/data/cache/.pex/unzipped_pexes/c3349f9a365512d9ab2e9149a2f882cb22884192/.bootstrap/pex/pex.py", line 498, in _wrap_profiling
[2024-03-27, 15:04:07 UTC] {subprocess.py:93} INFO - return runner(*args)
[2024-03-27, 15:04:07 UTC] {subprocess.py:93} INFO - ^^^^^^^^^^^^^
[2024-03-27, 15:04:07 UTC] {subprocess.py:93} INFO - File "/data/cache/.pex/unzipped_pexes/c3349f9a365512d9ab2e9149a2f882cb22884192/.bootstrap/pex/pex.py", line 603, in _execute
[2024-03-27, 15:04:07 UTC] {subprocess.py:93} INFO - return self.execute_entry(
[2024-03-27, 15:04:07 UTC] {subprocess.py:93} INFO - ^^^^^^^^^^^^^^^^^^^
[2024-03-27, 15:04:07 UTC] {subprocess.py:93} INFO - File "/data/cache/.pex/unzipped_pexes/c3349f9a365512d9ab2e9149a2f882cb22884192/.bootstrap/pex/pex.py", line 798, in execute_entry
[2024-03-27, 15:04:07 UTC] {subprocess.py:93} INFO - return self.execute_entry_point(entry_point)
[2024-03-27, 15:04:07 UTC] {subprocess.py:93} INFO - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[2024-03-27, 15:04:07 UTC] {subprocess.py:93} INFO - File "/data/cache/.pex/unzipped_pexes/c3349f9a365512d9ab2e9149a2f882cb22884192/.bootstrap/pex/pex.py", line 815, in execute_entry_point
[2024-03-27, 15:04:07 UTC] {subprocess.py:93} INFO - runner = entry_point.resolve()
[2024-03-27, 15:04:07 UTC] {subprocess.py:93} INFO - ^^^^^^^^^^^^^^^^^^^^^
[2024-03-27, 15:04:07 UTC] {subprocess.py:93} INFO - File "/data/cache/.pex/unzipped_pexes/c3349f9a365512d9ab2e9149a2f882cb22884192/.bootstrap/pex/dist_metadata.py", line 732, in resolve
[2024-03-27, 15:04:07 UTC] {subprocess.py:93} INFO - module = importlib.import_module(self.module)
[2024-03-27, 15:04:07 UTC] {subprocess.py:93} INFO - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[2024-03-27, 15:04:07 UTC] {subprocess.py:93} INFO - File "/usr/lib64/python3.11/importlib/__init__.py", line 126, in import_module
[2024-03-27, 15:04:07 UTC] {subprocess.py:93} INFO - return _bootstrap._gcd_import(name[level:], package, level)
[2024-03-27, 15:04:07 UTC] {subprocess.py:93} INFO - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[2024-03-27, 15:04:07 UTC] {subprocess.py:93} INFO - File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
[2024-03-27, 15:04:07 UTC] {subprocess.py:93} INFO - File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
[2024-03-27, 15:04:07 UTC] {subprocess.py:93} INFO - File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
[2024-03-27, 15:04:07 UTC] {subprocess.py:93} INFO - File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
[2024-03-27, 15:04:07 UTC] {subprocess.py:93} INFO - File "<frozen importlib._bootstrap_external>", line 940, in exec_module
[2024-03-27, 15:04:07 UTC] {subprocess.py:93} INFO - File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
[2024-03-27, 15:04:07 UTC] {subprocess.py:93} INFO - File "/data/cache/.pex/unzipped_pexes/c3349f9a365512d9ab2e9149a2f882cb22884192/dq_runner/cli.py", line 10, in <module>
[2024-03-27, 15:04:07 UTC] {subprocess.py:93} INFO - from dq_runner.suite import run
[2024-03-27, 15:04:07 UTC] {subprocess.py:93} INFO - File "/data/cache/.pex/unzipped_pexes/c3349f9a365512d9ab2e9149a2f882cb22884192/dq_runner/suite.py", line 6, in <module>
[2024-03-27, 15:04:07 UTC] {subprocess.py:93} INFO - import great_expectations as gx
[2024-03-27, 15:04:07 UTC] {subprocess.py:93} INFO - File "/data/cache/.pex/installed_wheels/31550eae3b205bb446525ba78ea6134012b012eaa0bf2bddec1eb619c6af0e41/great_expectations-0.17.15-py3-none-any.whl/great_expectations/__init__.py", line 6, in <module>
[2024-03-27, 15:04:07 UTC] {subprocess.py:93} INFO - from great_expectations.data_context.migrator.cloud_migrator import CloudMigrator
[2024-03-27, 15:04:07 UTC] {subprocess.py:93} INFO - File "/data/cache/.pex/installed_wheels/31550eae3b205bb446525ba78ea6134012b012eaa0bf2bddec1eb619c6af0e41/great_expectations-0.17.15-py3-none-any.whl/great_expectations/data_context/__init__.py", line 1, in <module>
[2024-03-27, 15:04:07 UTC] {subprocess.py:93} INFO - from great_expectations.data_context.data_context import (
[2024-03-27, 15:04:07 UTC] {subprocess.py:93} INFO - File "/data/cache/.pex/installed_wheels/31550eae3b205bb446525ba78ea6134012b012eaa0bf2bddec1eb619c6af0e41/great_expectations-0.17.15-py3-none-any.whl/great_expectations/data_context/data_context/__init__.py", line 1, in <module>
[2024-03-27, 15:04:07 UTC] {subprocess.py:93} INFO - from great_expectations.data_context.data_context.abstract_data_context import (
[2024-03-27, 15:04:07 UTC] {subprocess.py:93} INFO - File "/data/cache/.pex/installed_wheels/31550eae3b205bb446525ba78ea6134012b012eaa0bf2bddec1eb619c6af0e41/great_expectations-0.17.15-py3-none-any.whl/great_expectations/data_context/data_context/abstract_data_context.py", line 61, in <module>
[2024-03-27, 15:04:07 UTC] {subprocess.py:93} INFO - from great_expectations.core.datasource_dict import CacheableDatasourceDict
[2024-03-27, 15:04:07 UTC] {subprocess.py:93} INFO - File "/data/cache/.pex/installed_wheels/31550eae3b205bb446525ba78ea6134012b012eaa0bf2bddec1eb619c6af0e41/great_expectations-0.17.15-py3-none-any.whl/great_expectations/core/datasource_dict.py", line 13, in <module>
[2024-03-27, 15:04:07 UTC] {subprocess.py:93} INFO - from great_expectations.datasource.fluent import Datasource as FluentDatasource
[2024-03-27, 15:04:07 UTC] {subprocess.py:93} INFO - File "/data/cache/.pex/installed_wheels/31550eae3b205bb446525ba78ea6134012b012eaa0bf2bddec1eb619c6af0e41/great_expectations-0.17.15-py3-none-any.whl/great_expectations/datasource/__init__.py", line 6, in <module>
[2024-03-27, 15:04:07 UTC] {subprocess.py:93} INFO - from .sparkdf_datasource import SparkDFDatasource
[2024-03-27, 15:04:07 UTC] {subprocess.py:93} INFO - File "/data/cache/.pex/installed_wheels/31550eae3b205bb446525ba78ea6134012b012eaa0bf2bddec1eb619c6af0e41/great_expectations-0.17.15-py3-none-any.whl/great_expectations/datasource/sparkdf_datasource.py", line 8, in <module>
[2024-03-27, 15:04:07 UTC] {subprocess.py:93} INFO - from great_expectations.dataset import SparkDFDataset
[2024-03-27, 15:04:07 UTC] {subprocess.py:93} INFO - File "/data/cache/.pex/installed_wheels/31550eae3b205bb446525ba78ea6134012b012eaa0bf2bddec1eb619c6af0e41/great_expectations-0.17.15-py3-none-any.whl/great_expectations/dataset/__init__.py", line 3, in <module>
[2024-03-27, 15:04:07 UTC] {subprocess.py:93} INFO - from .dataset import Dataset
[2024-03-27, 15:04:07 UTC] {subprocess.py:93} INFO - File "/data/cache/.pex/installed_wheels/31550eae3b205bb446525ba78ea6134012b012eaa0bf2bddec1eb619c6af0e41/great_expectations-0.17.15-py3-none-any.whl/great_expectations/dataset/dataset.py", line 15, in <module>
[2024-03-27, 15:04:07 UTC] {subprocess.py:93} INFO - from great_expectations.data_asset.data_asset import DataAsset
[2024-03-27, 15:04:07 UTC] {subprocess.py:93} INFO - File "/data/cache/.pex/installed_wheels/31550eae3b205bb446525ba78ea6134012b012eaa0bf2bddec1eb619c6af0e41/great_expectations-0.17.15-py3-none-any.whl/great_expectations/data_asset/__init__.py", line 2, in <module>
[2024-03-27, 15:04:07 UTC] {subprocess.py:93} INFO - from .file_data_asset import FileDataAsset
[2024-03-27, 15:04:07 UTC] {subprocess.py:93} INFO - File "/data/cache/.pex/installed_wheels/31550eae3b205bb446525ba78ea6134012b012eaa0bf2bddec1eb619c6af0e41/great_expectations-0.17.15-py3-none-any.whl/great_expectations/data_asset/file_data_asset.py", line 9, in <module>
[2024-03-27, 15:04:07 UTC] {subprocess.py:93} INFO - import jsonschema
[2024-03-27, 15:04:07 UTC] {subprocess.py:93} INFO - File "/data/cache/.pex/installed_wheels/f3de2823552ee2af15ba0d49a5bff3f31b4c8140481498db339714500a8f16bf/jsonschema-4.21.1-py3-none-any.whl/jsonschema/__init__.py", line 13, in <module>
[2024-03-27, 15:04:07 UTC] {subprocess.py:93} INFO - from jsonschema._format import FormatChecker
[2024-03-27, 15:04:07 UTC] {subprocess.py:93} INFO - File "/data/cache/.pex/installed_wheels/f3de2823552ee2af15ba0d49a5bff3f31b4c8140481498db339714500a8f16bf/jsonschema-4.21.1-py3-none-any.whl/jsonschema/_format.py", line 11, in <module>
[2024-03-27, 15:04:07 UTC] {subprocess.py:93} INFO - from jsonschema.exceptions import FormatError
[2024-03-27, 15:04:07 UTC] {subprocess.py:93} INFO - File "/data/cache/.pex/installed_wheels/f3de2823552ee2af15ba0d49a5bff3f31b4c8140481498db339714500a8f16bf/jsonschema-4.21.1-py3-none-any.whl/jsonschema/exceptions.py", line 14, in <module>
[2024-03-27, 15:04:07 UTC] {subprocess.py:93} INFO - from attrs import define
[2024-03-27, 15:04:07 UTC] {subprocess.py:93} INFO - File "/data/cache/.pex/installed_wheels/2550e6830d4914f46602e41e895ca232a64e5becab7964924c650710e1ed1668/attrs-23.2.0-py3-none-any.whl/attrs/__init__.py", line 3, in <module>
[2024-03-27, 15:04:07 UTC] {subprocess.py:93} INFO - from attr import (
[2024-03-27, 15:04:07 UTC] {subprocess.py:93} INFO - ImportError: cannot import name 'AttrsInstance' from 'pex.vendor._vendored.attrs.attr' (/data/cache/.pex/unzipped_pexes/c3349f9a365512d9ab2e9149a2f882cb22884192/.bootstrap/pex/vendor/_vendored/attrs/attr/__init__.py)
[2024-03-27, 15:04:08 UTC] {subprocess.py:97} INFO - Command exited with return code 1
fancy-policeman-6755
03/27/2024, 5:00 PMfancy-policeman-6755
03/27/2024, 5:02 PMattrs
tries to import something from attr
fancy-policeman-6755
03/27/2024, 5:03 PMattr
inside attrs-23.2.0
it uses the one from _vendored
fancy-policeman-6755
03/27/2024, 5:03 PMmodule_mapping
fancy-policeman-6755
03/27/2024, 5:08 PMfancy-policeman-6755
03/27/2024, 5:58 PMmodule_mapping={
"attrs": ["attrs", "attr"],
},
to the python_requirements
, fwiw, to make sure it "finds" the attr
module from the attrs
packagecurved-manchester-66006
03/27/2024, 6:48 PMattrs
wheel is particularity puzzling to me.
Do you have a small repository that can rerprouce the issue? (My corp one has both GX and attrs and we have not stumbled on this.)fancy-policeman-6755
03/27/2024, 6:48 PMfancy-policeman-6755
03/27/2024, 6:49 PMfancy-policeman-6755
03/27/2024, 6:50 PMgenerate-lockfiles
gets stuck in an infinite loop when I revert to the previous requirements.txt
curved-manchester-66006
03/27/2024, 7:12 PMgenerate-lockfiles
seems to be running forever, you can try ps aux | grep pip
and see if you can find the pip log. That sometimes has clues, and sometimes just pip restatign that it is taking a long time.happy-kitchen-89482
03/27/2024, 7:35 PMhappy-kitchen-89482
03/27/2024, 7:35 PM_vendored
prefix, and rewrites the imports to match, so I'm quite surprised at this.happy-kitchen-89482
03/27/2024, 7:38 PM.pex
file? If so, what happens if you change the execution mode to venv
(if it isn't already) and/or the layout to packed
or loose
? (if it isn't already)fancy-policeman-6755
03/27/2024, 7:40 PMfancy-policeman-6755
03/28/2024, 1:48 PMexecution_mode
to venv
fixes it. The layout doesn't change anything. Aside from the fact that it fixes this problem, is there any reason to use venv over zipapp, or the other way around?happy-kitchen-89482
03/28/2024, 3:26 PMhappy-kitchen-89482
03/28/2024, 3:27 PM