Git Product home page Git Product logo

Comments (3)

tristanlatr avatar tristanlatr commented on June 2, 2024

This is a really strange error. I admit. I have no clue currently whatโ€™s happening in your environment t it behaves like this.

how does tox -e test behaves ?

from pydoctor.

buhtz avatar buhtz commented on June 2, 2024

Are there any steps to prepare tox (except installing it) that are not documented somewhere and I might have missed?

$ tox -e test
test: internal error
Traceback (most recent call last):
  File "/home/user/.local/lib/python3.9/site-packages/tox/session/cmd/run/single.py", line 46, in _evaluate
    tox_env.setup()
  File "/home/user/.local/lib/python3.9/site-packages/tox/tox_env/api.py", line 247, in setup
    self._setup_env()
  File "/home/user/.local/lib/python3.9/site-packages/tox/tox_env/python/runner.py", line 107, in _setup_env
    super()._setup_env()
  File "/home/user/.local/lib/python3.9/site-packages/tox/tox_env/python/api.py", line 199, in _setup_env
    self.ensure_python_env()
  File "/home/user/.local/lib/python3.9/site-packages/tox/tox_env/python/api.py", line 203, in ensure_python_env
    conf = self.python_cache()
  File "/home/user/.local/lib/python3.9/site-packages/tox/tox_env/python/virtual_env/api.py", line 77, in python_cache
    base = super().python_cache()
  File "/home/user/.local/lib/python3.9/site-packages/tox/tox_env/python/api.py", line 240, in python_cache
    "version_info": list(self.base_python.version_info),
  File "/home/user/.local/lib/python3.9/site-packages/tox/tox_env/python/api.py", line 250, in base_python
    self._base_python = self._get_python(base_pythons)
  File "/home/user/.local/lib/python3.9/site-packages/tox/tox_env/python/virtual_env/api.py", line 134, in _get_python
    interpreter = self.creator.interpreter
  File "/home/user/.local/lib/python3.9/site-packages/tox/tox_env/python/virtual_env/api.py", line 126, in creator
    return self.session.creator
  File "/home/user/.local/lib/python3.9/site-packages/tox/tox_env/python/virtual_env/api.py", line 107, in session
    self._virtualenv_session = session_via_cli(env_dir, options=None, setup_logging=False, env=env)
  File "/home/user/.local/lib/python3.9/site-packages/virtualenv/run/__init__.py", line 49, in session_via_cli
    parser, elements = build_parser(args, options, setup_logging, env)
  File "/home/user/.local/lib/python3.9/site-packages/virtualenv/run/__init__.py", line 82, in build_parser
    CreatorSelector(interpreter, parser),
  File "/home/user/.local/lib/python3.9/site-packages/virtualenv/run/plugin/creators.py", line 24, in __init__
    creators, self.key_to_meta, self.describe, self.builtin_key = self.for_interpreter(interpreter)
  File "/home/user/.local/lib/python3.9/site-packages/virtualenv/run/plugin/creators.py", line 31, in for_interpreter
    for key, creator_class in cls.options("virtualenv.create").items():
  File "/home/user/.local/lib/python3.9/site-packages/virtualenv/run/plugin/base.py", line 45, in options
    cls._OPTIONS = cls.entry_points_for(key)
  File "/home/user/.local/lib/python3.9/site-packages/virtualenv/run/plugin/base.py", line 24, in entry_points_for
    return OrderedDict((e.name, e.load()) for e in cls.entry_points().get(key, {}))
  File "/home/user/.local/lib/python3.9/site-packages/virtualenv/run/plugin/base.py", line 24, in <genexpr>
    return OrderedDict((e.name, e.load()) for e in cls.entry_points().get(key, {}))
  File "/home/user/.local/lib/python3.9/site-packages/setuptools/_vendor/importlib_metadata/__init__.py", line 210, in load
    return functools.reduce(getattr, attrs, module)
AttributeError: module 'virtualenv.create.via_global_ref.builtin.cpython.mac_os' has no attribute 'CPython2macOsFramework'
  test: FAIL code 2 (0.03 seconds)
  evaluation failed :( (0.28 seconds)

from pydoctor.

buhtz avatar buhtz commented on June 2, 2024

I might have found a hot trail. Totally independent from tox and pydoctor I accidentally observed a similar error using hatch to create a virtual environment. The error output of hatch (see below) is bit easier to read so I realized the problem is about the package virtualenv. I uninstalled it via python3 -m pip uninstall virtuelenv. Then hatch worked.

Then I tried tox on pydoctor. And it worked.

I am not enough into the details about virtual environments or the package virtuelenv. So I am not able to decide where and if I should open a bug report. Maybe related to pypa/virtualenv#2551.
Maybe I encountered the first time a real use case why I should use virtual environments. Currently I do avoid them as much as possible. I am a but stubborn about this topic. ๐Ÿ˜„

$ย hatch env create
โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ Traceback (most recent call last) โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ /home/user/.local/lib/python3.9/site-packages/hatch/cli/__init__.py:221 in main                  โ”‚
โ”‚                                                                                                  โ”‚
โ”‚   218                                                                                            โ”‚
โ”‚   219 def main():  # no cov                                                                      โ”‚
โ”‚   220 โ”‚   try:                                                                                   โ”‚
โ”‚ โฑ 221 โ”‚   โ”‚   return hatch(prog_name='hatch', windows_expand_args=False)                         โ”‚
โ”‚   222 โ”‚   except Exception:  # noqa: BLE001                                                      โ”‚
โ”‚   223 โ”‚   โ”‚   from rich.console import Console                                                   โ”‚
โ”‚   224                                                                                            โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ /home/user/.local/lib/python3.9/site-packages/click/core.py:1157 in __call__                     โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ /home/user/.local/lib/python3.9/site-packages/click/core.py:1078 in main                         โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ /home/user/.local/lib/python3.9/site-packages/click/core.py:1688 in invoke                       โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ /home/user/.local/lib/python3.9/site-packages/click/core.py:1688 in invoke                       โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ /home/user/.local/lib/python3.9/site-packages/click/core.py:1434 in invoke                       โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ /home/user/.local/lib/python3.9/site-packages/click/core.py:783 in invoke                        โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ /home/user/.local/lib/python3.9/site-packages/click/decorators.py:45 in new_func                 โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ /home/user/.local/lib/python3.9/site-packages/hatch/cli/env/create.py:38 in create               โ”‚
โ”‚                                                                                                  โ”‚
โ”‚   35 โ”‚   โ”‚   โ”‚                                                                                   โ”‚
โ”‚   36 โ”‚   โ”‚   โ”‚   app.abort(f'Environment `{env}` is incompatible: {e}')                          โ”‚
โ”‚   37 โ”‚   โ”‚                                                                                       โ”‚
โ”‚ โฑ 38 โ”‚   โ”‚   app.prepare_environment(environment)                                                โ”‚
โ”‚   39 โ”‚                                                                                           โ”‚
โ”‚   40 โ”‚   if incompatible:                                                                        โ”‚
โ”‚   41 โ”‚   โ”‚   num_incompatible = len(incompatible)                                                โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ /home/user/.local/lib/python3.9/site-packages/hatch/cli/application.py:89 in prepare_environment โ”‚
โ”‚                                                                                                  โ”‚
โ”‚    86 โ”‚   โ”‚   โ”‚   self.env_metadata.reset(environment)                                           โ”‚
โ”‚    87 โ”‚   โ”‚   โ”‚                                                                                  โ”‚
โ”‚    88 โ”‚   โ”‚   โ”‚   with self.status(f'Creating environment: {environment.name}'):                 โ”‚
โ”‚ โฑ  89 โ”‚   โ”‚   โ”‚   โ”‚   environment.create()                                                       โ”‚
โ”‚    90 โ”‚   โ”‚   โ”‚                                                                                  โ”‚
โ”‚    91 โ”‚   โ”‚   โ”‚   if not environment.skip_install:                                               โ”‚
โ”‚    92 โ”‚   โ”‚   โ”‚   โ”‚   if environment.pre_install_commands:                                       โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ /home/user/.local/lib/python3.9/site-packages/hatch/env/virtual.py:103 in create                 โ”‚
โ”‚                                                                                                  โ”‚
โ”‚   100 """                                                                                        โ”‚
โ”‚   101 โ”‚   โ”‚   โ”‚   โ”‚   )                                                                          โ”‚
โ”‚   102 โ”‚   โ”‚                                                                                      โ”‚
โ”‚ โฑ 103 โ”‚   โ”‚   self.virtual_env.create(self.parent_python, allow_system_packages=self.config.ge   โ”‚
โ”‚   104 โ”‚                                                                                          โ”‚
โ”‚   105 โ”‚   def remove(self):                                                                      โ”‚
โ”‚   106 โ”‚   โ”‚   self.virtual_env.remove()                                                          โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ /home/user/.local/lib/python3.9/site-packages/hatch/venv/core.py:59 in create                    โ”‚
โ”‚                                                                                                  โ”‚
โ”‚    56 โ”‚   โ”‚   # Decrease verbosity since the virtualenv CLI defaults to something like +2 verb   โ”‚
โ”‚    57 โ”‚   โ”‚   add_verbosity_flag(command, self.verbosity, adjustment=-1)                         โ”‚
โ”‚    58 โ”‚   โ”‚                                                                                      โ”‚
โ”‚ โฑ  59 โ”‚   โ”‚   cli_run(command)                                                                   โ”‚
โ”‚    60 โ”‚                                                                                          โ”‚
โ”‚    61 โ”‚   def remove(self):                                                                      โ”‚
โ”‚    62 โ”‚   โ”‚   self.directory.remove()                                                            โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ /home/user/.local/lib/python3.9/site-packages/virtualenv/run/__init__.py:31 in cli_run           โ”‚
โ”‚                                                                                                  โ”‚
โ”‚    28 โ”‚   :return: the session object of the creation (its structure for now is experimental a   โ”‚
โ”‚    29 โ”‚   """                                                                                    โ”‚
โ”‚    30 โ”‚   env = os.environ if env is None else env                                               โ”‚
โ”‚ โฑ  31 โ”‚   of_session = session_via_cli(args, options, setup_logging, env)                        โ”‚
โ”‚    32 โ”‚   with of_session:                                                                       โ”‚
โ”‚    33 โ”‚   โ”‚   of_session.run()                                                                   โ”‚
โ”‚    34 โ”‚   return of_session                                                                      โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ /home/user/.local/lib/python3.9/site-packages/virtualenv/run/__init__.py:49 in session_via_cli   โ”‚
โ”‚                                                                                                  โ”‚
โ”‚    46 โ”‚   :return: the session object of the creation (its structure for now is experimental a   โ”‚
โ”‚    47 โ”‚   """  # noqa: D205                                                                      โ”‚
โ”‚    48 โ”‚   env = os.environ if env is None else env                                               โ”‚
โ”‚ โฑ  49 โ”‚   parser, elements = build_parser(args, options, setup_logging, env)                     โ”‚
โ”‚    50 โ”‚   options = parser.parse_args(args)                                                      โ”‚
โ”‚    51 โ”‚   creator, seeder, activators = tuple(e.create(options) for e in elements)  # create t   โ”‚
โ”‚    52 โ”‚   return Session(                                                                        โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ /home/user/.local/lib/python3.9/site-packages/virtualenv/run/__init__.py:82 in build_parser      โ”‚
โ”‚                                                                                                  โ”‚
โ”‚    79 โ”‚   โ”‚   msg = f"failed to find interpreter for {discover}"                                 โ”‚
โ”‚    80 โ”‚   โ”‚   raise RuntimeError(msg)                                                            โ”‚
โ”‚    81 โ”‚   elements = [                                                                           โ”‚
โ”‚ โฑ  82 โ”‚   โ”‚   CreatorSelector(interpreter, parser),                                              โ”‚
โ”‚    83 โ”‚   โ”‚   SeederSelector(interpreter, parser),                                               โ”‚
โ”‚    84 โ”‚   โ”‚   ActivationSelector(interpreter, parser),                                           โ”‚
โ”‚    85 โ”‚   ]                                                                                      โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ /home/user/.local/lib/python3.9/site-packages/virtualenv/run/plugin/creators.py:24 in __init__   โ”‚
โ”‚                                                                                                  โ”‚
โ”‚   21                                                                                             โ”‚
โ”‚   22 class CreatorSelector(ComponentBuilder):                                                    โ”‚
โ”‚   23 โ”‚   def __init__(self, interpreter, parser) -> None:                                        โ”‚
โ”‚ โฑ 24 โ”‚   โ”‚   creators, self.key_to_meta, self.describe, self.builtin_key = self.for_interpret    โ”‚
โ”‚   25 โ”‚   โ”‚   super().__init__(interpreter, parser, "creator", creators)                          โ”‚
โ”‚   26 โ”‚                                                                                           โ”‚
โ”‚   27 โ”‚   @classmethod                                                                            โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ /home/user/.local/lib/python3.9/site-packages/virtualenv/run/plugin/creators.py:31 in            โ”‚
โ”‚ for_interpreter                                                                                  โ”‚
โ”‚                                                                                                  โ”‚
โ”‚   28 โ”‚   def for_interpreter(cls, interpreter):                                                  โ”‚
โ”‚   29 โ”‚   โ”‚   key_to_class, key_to_meta, builtin_key, describe = OrderedDict(), {}, None, None    โ”‚
โ”‚   30 โ”‚   โ”‚   errors = defaultdict(list)                                                          โ”‚
โ”‚ โฑ 31 โ”‚   โ”‚   for key, creator_class in cls.options("virtualenv.create").items():                 โ”‚
โ”‚   32 โ”‚   โ”‚   โ”‚   if key == "builtin":                                                            โ”‚
โ”‚   33 โ”‚   โ”‚   โ”‚   โ”‚   msg = "builtin creator is a reserved name"                                  โ”‚
โ”‚   34 โ”‚   โ”‚   โ”‚   โ”‚   raise RuntimeError(msg)                                                     โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ /home/user/.local/lib/python3.9/site-packages/virtualenv/run/plugin/base.py:45 in options        โ”‚
โ”‚                                                                                                  โ”‚
โ”‚   42 โ”‚   @classmethod                                                                            โ”‚
โ”‚   43 โ”‚   def options(cls, key):                                                                  โ”‚
โ”‚   44 โ”‚   โ”‚   if cls._OPTIONS is None:                                                            โ”‚
โ”‚ โฑ 45 โ”‚   โ”‚   โ”‚   cls._OPTIONS = cls.entry_points_for(key)                                        โ”‚
โ”‚   46 โ”‚   โ”‚   return cls._OPTIONS                                                                 โ”‚
โ”‚   47 โ”‚                                                                                           โ”‚
โ”‚   48 โ”‚   def add_selector_arg_parse(self, name, choices):                                        โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ /home/user/.local/lib/python3.9/site-packages/virtualenv/run/plugin/base.py:24 in                โ”‚
โ”‚ entry_points_for                                                                                 โ”‚
โ”‚                                                                                                  โ”‚
โ”‚   21 โ”‚   def entry_points_for(cls, key):                                                         โ”‚
โ”‚   22 โ”‚   โ”‚   if sys.version_info >= (3, 10) or importlib_metadata_version >= (3, 6):             โ”‚
โ”‚   23 โ”‚   โ”‚   โ”‚   return OrderedDict((e.name, e.load()) for e in cls.entry_points().select(gro    โ”‚
โ”‚ โฑ 24 โ”‚   โ”‚   return OrderedDict((e.name, e.load()) for e in cls.entry_points().get(key, {}))     โ”‚
โ”‚   25 โ”‚                                                                                           โ”‚
โ”‚   26 โ”‚   @staticmethod                                                                           โ”‚
โ”‚   27 โ”‚   def entry_points():                                                                     โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ /home/user/.local/lib/python3.9/site-packages/virtualenv/run/plugin/base.py:24 in <genexpr>      โ”‚
โ”‚                                                                                                  โ”‚
โ”‚   21 โ”‚   def entry_points_for(cls, key):                                                         โ”‚
โ”‚   22 โ”‚   โ”‚   if sys.version_info >= (3, 10) or importlib_metadata_version >= (3, 6):             โ”‚
โ”‚   23 โ”‚   โ”‚   โ”‚   return OrderedDict((e.name, e.load()) for e in cls.entry_points().select(gro    โ”‚
โ”‚ โฑ 24 โ”‚   โ”‚   return OrderedDict((e.name, e.load()) for e in cls.entry_points().get(key, {}))     โ”‚
โ”‚   25 โ”‚                                                                                           โ”‚
โ”‚   26 โ”‚   @staticmethod                                                                           โ”‚
โ”‚   27 โ”‚   def entry_points():                                                                     โ”‚
โ”‚                                                                                                  โ”‚
โ”‚ /home/user/.local/lib/python3.9/site-packages/setuptools/_vendor/importlib_metadata/__init__.py: โ”‚
โ”‚ 210 in load                                                                                      โ”‚
โ”‚                                                                                                  โ”‚
โ”‚   207 โ”‚   โ”‚   match = self.pattern.match(self.value)                                             โ”‚
โ”‚   208 โ”‚   โ”‚   module = import_module(match.group('module'))                                      โ”‚
โ”‚   209 โ”‚   โ”‚   attrs = filter(None, (match.group('attr') or '').split('.'))                       โ”‚
โ”‚ โฑ 210 โ”‚   โ”‚   return functools.reduce(getattr, attrs, module)                                    โ”‚
โ”‚   211 โ”‚                                                                                          โ”‚
โ”‚   212 โ”‚   @property                                                                              โ”‚
โ”‚   213 โ”‚   def module(self):                                                                      โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
AttributeError: module 'virtualenv.create.via_global_ref.builtin.cpython.mac_os' has no attribute 
'CPython2macOsFramework'

from pydoctor.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.