Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.0.0: One test fails: AttributeError: module 'jsonpickle.ext' has no attribute 'gmpy' #419

Open
yurivict opened this issue Dec 4, 2022 · 5 comments

Comments

@yurivict
Copy link

yurivict commented Dec 4, 2022

=========================================================================================== ERRORS ===========================================================================================
_______________________________________________________________________ ERROR at setup of EcdsaTestCase.test_roundtrip _______________________________________________________________________

    @pytest.fixture(scope='module', autouse=True)
    def gmpy_extension():
        """Initialize the gmpy extension for this test module"""
>       jsonpickle.ext.gmpy.register_handlers()
E       AttributeError: module 'jsonpickle.ext' has no attribute 'gmpy'

tests/ecdsa_test.py:15: AttributeError
====================================================================================== warnings summary ======================================================================================
../../../../../../usr/local/lib/python3.9/site-packages/_pytest/config/__init__.py:1294
  /usr/local/lib/python3.9/site-packages/_pytest/config/__init__.py:1294: PytestConfigWarning: Unknown config option: flake8-max-line-length
  
    self._warn_or_fail_if_strict(f"Unknown config option: {key}\n")

../../../../../../usr/local/lib/python3.9/site-packages/pytest_freezegun.py:17: 634 warnings
  /usr/local/lib/python3.9/site-packages/pytest_freezegun.py:17: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
    if LooseVersion(pytest.__version__) < LooseVersion('3.6.0'):

tests/numpy_test.py::test_ndarray_roundtrip
  /disk-samsung/freebsd-ports/devel/py-jsonpickle/work-py39/jsonpickle-3.0.0/jsonpickle/ext/numpy.py:307: UserWarning: ndarray is defined by reference to an object we do not know how to serialize. A deep copy is serialized instead, breaking memory aliasing.
    warnings.warn(msg)

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
================================================================================== short test summary info ===================================================================================
SKIPPED [1] tests/sklearn_test.py:9: sklearn is not available
SKIPPED [1] tests/feedparser_test.py:85: feedparser module not available, please install
SKIPPED [1] tests/sqlalchemy_test.py:90: sqlalchemy is not installed
SKIPPED [1] tests/sqlalchemy_test.py:42: sqlalchemy is not installed
SKIPPED [1] tests/sqlalchemy_test.py:66: sqlalchemy is not installed
SKIPPED [1] tests/bson_test.py:32: bson is not installed
SKIPPED [1] tests/bson_test.py:48: bson is not installed
SKIPPED [1] tests/bson_test.py:73: bson is not installed
SKIPPED [1] tests/bson_test.py:64: bson is not installed
SKIPPED [1] tests/bson_test.py:56: bson is not installed
SKIPPED [1] tests/bson_test.py:40: bson is not installed
SKIPPED [1] tests/backend_test.py:76: ujson not available; please install
SKIPPED [1] tests/backend_test.py:68: ujson not available; please install
SKIPPED [1] tests/backend_test.py:180: ujson not available; please install
SKIPPED [1] tests/backend_test.py:115: simplejson not available; please install
SKIPPED [1] tests/backend_test.py:145: simplejson not available; please install
SKIPPED [1] tests/backend_test.py:76: simplejson not available; please install
SKIPPED [1] tests/backend_test.py:105: simplejson not available; please install
SKIPPED [1] tests/backend_test.py:68: simplejson not available; please install
SKIPPED [1] tests/backend_test.py:68: yajl not available; please install
SKIPPED [1] tests/backend_test.py:76: yajl not available; please install
SKIPPED [1] tests/backend_test.py:166: yajl not available; please install
============================================================= 292 passed, 22 skipped, 3 xpassed, 636 warnings, 1 error in 3.49s ==============================================================
*** Error code 1

python-3.9
FreeBSD 13.1

@Theelx
Copy link
Contributor

Theelx commented Dec 4, 2022

Can you show the output of pip show gmpy2?

@yurivict
Copy link
Author

$ pip show gmpy2
ERROR: Exception:
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3021, in _dep_map
    return self.__dep_map
  File "/usr/local/lib/python3.9/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2815, in __getattr__
    raise AttributeError(attr)
AttributeError: _DistInfoDistribution__dep_map

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3012, in _parsed_pkg_info
    return self._pkg_info
  File "/usr/local/lib/python3.9/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2815, in __getattr__
    raise AttributeError(attr)
AttributeError: _pkg_info

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/pip/_internal/cli/base_command.py", line 167, in exc_logging_wrapper
    status = run_func(*args)
  File "/usr/local/lib/python3.9/site-packages/pip/_internal/commands/show.py", line 45, in run
    if not print_results(
  File "/usr/local/lib/python3.9/site-packages/pip/_internal/commands/show.py", line 148, in print_results
    for i, dist in enumerate(distributions):
  File "/usr/local/lib/python3.9/site-packages/pip/_internal/commands/show.py", line 103, in search_packages_info
    required_by = sorted(_get_requiring_packages(dist), key=str.lower)
  File "/usr/local/lib/python3.9/site-packages/pip/_internal/commands/show.py", line 93, in <genexpr>
    in {canonicalize_name(d.name) for d in dist.iter_dependencies()}
  File "/usr/local/lib/python3.9/site-packages/pip/_internal/metadata/pkg_resources.py", line 199, in iter_dependencies
    return self._dist.requires(extras)
  File "/usr/local/lib/python3.9/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2736, in requires
    dm = self._dep_map
  File "/usr/local/lib/python3.9/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3023, in _dep_map
    self.__dep_map = self._compute_dependencies()
  File "/usr/local/lib/python3.9/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3032, in _compute_dependencies
    for req in self._parsed_pkg_info.get_all('Requires-Dist') or []:
  File "/usr/local/lib/python3.9/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3014, in _parsed_pkg_info
    metadata = self.get_metadata(self.PKG_INFO)
  File "/usr/local/lib/python3.9/site-packages/pip/_vendor/pkg_resources/__init__.py", line 1420, in get_metadata
    value = self._get(path)
  File "/usr/local/lib/python3.9/site-packages/pip/_vendor/pkg_resources/__init__.py", line 1616, in _get
    with open(path, 'rb') as stream:
FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/lib/python3.9/site-packages/hatch_vcs-0.2.0.dist-info/METADATA'

@Theelx
Copy link
Contributor

Theelx commented Dec 19, 2022

Huh, that's really interesting. I wonder if it's an issue with pip and gmpy's interaction with FreeBSD. When I googled the first error, I found this, and it seems to indicate that some dependency in the dependency chain (likely hatch-vcs) is having problems. According to PyPi, hatch-vcs recently released a 0.3.0 and a 0.2.1 version, so trying to install both of those first might help.

@Theelx Theelx mentioned this issue Dec 19, 2022
@yurivict
Copy link
Author

We also never use pip. The FreeBSD ports framework uses distutils and alike to install packages, and never pip.

@Theelx
Copy link
Contributor

Theelx commented Dec 22, 2022

Ah. If I recall correctly, isn't distutils deprecated as of 3.12? Also, does building with setuptools work on FreeBSD, or is that broken too?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants