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

Incompatible with tox 4.18.0: TypeError: Can't instantiate abstract class CurrentEnv with abstract method python_spec_for_path #77

Closed
kevalmorabia97 opened this issue Aug 14, 2024 · 9 comments · Fixed by #78
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@kevalmorabia97
Copy link

Traceback (most recent call last):
  File "/usr/local/bin/tox", line 8, in <module>
    sys.exit(run())
  File "/usr/local/lib/python3.10/dist-packages/tox/run.py", line 20, in run
    result = main(sys.argv[1:] if args is None else args)
  File "/usr/local/lib/python3.10/dist-packages/tox/run.py", line 46, in main
    return handler(state)
  File "/usr/local/lib/python3.10/dist-packages/tox/session/cmd/legacy.py", line 115, in legacy
    return run_sequential(state)
  File "/usr/local/lib/python3.10/dist-packages/tox/session/cmd/run/sequential.py", line 25, in run_sequential
    return execute(state, max_workers=1, has_spinner=False, live=True)
  File "/usr/local/lib/python3.10/dist-packages/tox/session/cmd/run/common.py", line 167, in execute
    state.envs.ensure_only_run_env_is_active()
  File "/usr/local/lib/python3.10/dist-packages/tox/session/env_select.py", line 436, in ensure_only_run_env_is_active
    envs, active = self._defined_envs, self._env_name_to_active()
  File "/usr/local/lib/python3.10/dist-packages/tox/session/env_select.py", line 258, in _defined_envs
    run_env = self._build_run_env(name)
  File "/usr/local/lib/python3.10/dist-packages/tox/session/env_select.py", line 322, in _build_run_env
    run_env = runner(args)
TypeError: Can't instantiate abstract class CurrentEnv with abstract method python_spec_for_path
@hroncok hroncok added bug Something isn't working help wanted Extra attention is needed labels Aug 14, 2024
@hroncok
Copy link
Member

hroncok commented Aug 14, 2024

Thanks for the report.

@hroncok
Copy link
Member

hroncok commented Aug 14, 2024

Apparently the abstract method was added in tox-dev/tox#3325

@gaborbernat
Copy link

Sorry for the trouble here but you will need to implement this new method and release a fix ☹️

@hroncok
Copy link
Member

hroncok commented Aug 14, 2024

Implementing the method to raise RuntimeError seems to make it work, it is never called. #78

@gaborbernat
Copy link

It is only called if someone sets to base_python an absolute path 👍

@hroncok
Copy link
Member

hroncok commented Aug 14, 2024

I wonder how to discard any custom base_python set. We don't care, we will always use sys.executable, that is the purpose of this plugin.

@gaborbernat
Copy link

Guess raising that RuntimeError is just fine then. or even NotImplementedError is good enough.

hroncok added a commit to hroncok/tox-current-env that referenced this issue Aug 14, 2024
hroncok added a commit to hroncok/tox-current-env that referenced this issue Aug 14, 2024
@hroncok
Copy link
Member

hroncok commented Aug 14, 2024

I ended up returning the sys.executable's PythonSpec. I belive that should do it, but we really need to fix our tests.

hroncok added a commit to hroncok/tox-current-env that referenced this issue Aug 14, 2024
@hroncok
Copy link
Member

hroncok commented Aug 28, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants