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

Errors when tox is setting up the test environment #4031

Closed
abravalheri opened this issue Aug 29, 2023 · 5 comments
Closed

Errors when tox is setting up the test environment #4031

abravalheri opened this issue Aug 29, 2023 · 5 comments

Comments

@abravalheri
Copy link
Contributor

In the series of PRs that were targeting improving PKG-INFO all the tests seemed to have been running fine.
This is evidenced by the all green CI in #4029 (last change) before it was merged into main.

However, it started failing in the moment I did the merge. I am not sure what is happening, and I am trying to investigate why.

tox
  shell: /usr/bin/bash -e {0}
  env:
    FORCE_COLOR: 1
    MYPY_FORCE_COLOR: -42
    PY_COLORS: 1
    TOX_TESTENV_PASSENV: FORCE_COLOR MYPY_FORCE_COLOR NO_COLOR PY_COLORS PYTEST_THEME PYTEST_THEME_MODE
    PIP_DISABLE_PIP_VERSION_CHECK: true
    PIP_NO_PYTHON_VERSION_WARNING: true
    PIP_NO_WARN_SCRIPT_LOCATION: true
    TOX_PARALLEL_NO_SPINNER: 1
    TOXENV: docs
docs: install_deps> python -I -m pip install 'importlib_resources<6'
.pkg: _optional_hooks> python /home/runner/.local/lib/python[3](https://github.com/pypa/setuptools/actions/runs/6015752069/job/16318875362#step:5:3).10/site-packages/pyproject_api/_backend.py True setuptools.build_meta
.pkg: get_requires_for_build_editable> python /home/runner/.local/lib/python3.10/site-packages/pyproject_api/_backend.py True setuptools.build_meta
.pkg: install_requires_for_build_editable> python -I -m pip install wheel
.pkg: freeze> python -m pip freeze --all
.pkg: pip==23.2.1,setuptools==68.0.0,wheel==0.[4](https://github.com/pypa/setuptools/actions/runs/6015752069/job/16318875362#step:5:4)1.1
docs: internal error
Traceback (most recent call last):
  File "/home/runner/.local/lib/python3.10/site-packages/tox/session/cmd/run/single.py", line 46, in _evaluate
    tox_env.setup()
  File "/home/runner/.local/lib/python3.10/site-packages/tox/tox_env/api.py", line 248, in setup
    self._setup_with_env()
  File "/home/runner/.local/lib/python3.10/site-packages/tox/tox_env/runner.py", line 14[5](https://github.com/pypa/setuptools/actions/runs/6015752069/job/16318875362#step:5:5), in _setup_with_env
    self._setup_pkg()
  File "/home/runner/.local/lib/python3.10/site-packages/tox/tox_env/runner.py", line 1[6](https://github.com/pypa/setuptools/actions/runs/6015752069/job/16318875362#step:5:6)8, in _setup_pkg
    self._packages = self._build_packages()
  File "/home/runner/.local/lib/python3.10/site-packages/tox/tox_env/python/runner.py", line 119, in _build_packages
    packages = package_env.perform_packaging(self.conf)
  File "/home/runner/.local/lib/python3.10/site-packages/tox/tox_env/package.py", line 45, in _func
    return meth(*args, **kwargs)
  File "/home/runner/.local/lib/python3.10/site-packages/tox/tox_env/python/virtual_env/package/pyproject.py", line 189, in perform_packaging
    deps = self._load_deps(for_env)
  File "/home/runner/.local/lib/python3.10/site-packages/tox/tox_env/package.py", line 45, in _func
    return meth(*args, **kwargs)
  File "/home/runner/.local/lib/python3.10/site-packages/tox/tox_env/python/virtual_env/package/pyproject.py", line 248, in _load_deps
    deps = self._load_deps_from_built_metadata(for_env)
  File "/home/runner/.local/lib/python3.10/site-packages/tox/tox_env/package.py", line 45, in _func
    return meth(*args, **kwargs)
  File "/home/runner/.local/lib/python3.10/site-packages/tox/tox_env/python/virtual_env/package/pyproject.py", line 292, in _load_deps_from_built_metadata
    reqs = self.get_package_dependencies(for_env)
  File "/home/runner/.local/lib/python3.10/site-packages/tox/tox_env/package.py", line 45, in _func
    return meth(*args, **kwargs)
  File "/home/runner/.local/lib/python3.10/site-packages/tox/tox_env/python/virtual_env/package/pyproject.py", line 300, in get_package_dependencies
    self._ensure_meta_present(for_env)
  File "/home/runner/.local/lib/python3.10/site-packages/tox/tox_env/package.py", line 45, in _func
    return meth(*args, **kwargs)
  File "/home/runner/.local/lib/python3.10/site-packages/tox/tox_env/python/virtual_env/package/pyproject.py", line 321, in _ensure_meta_present
    dist_info = hook(self.meta_folder, self._wheel_config_settings).metadata
AttributeError: 'NoneType' object has no attribute 'metadata'
.pkg: _exit> python /home/runner/.local/lib/python3.10/site-packages/pyproject_api/_backend.py True setuptools.build_meta
  docs: FAIL code 2 (3.62 seconds)
  evaluation failed :( (3.[7](https://github.com/pypa/setuptools/actions/runs/6015752069/job/16318875362#step:5:7)3 seconds)

It seems that tox finds an error when calling prepare_metadata_for_build_editable however I am not sure it even gets to run this function from build_meta...

As a last resort we can revert the merge and return the repository to its last safe version.

@abravalheri
Copy link
Contributor Author

May be related to the latest 2 releases of tox-dev/pyproject-api (1.6.0 and 1.6.1) in the latest couple of hours, but I am not sure... Still have to investigate more.

@abravalheri
Copy link
Contributor Author

Might be fixed by tox==4.11.0. I will run the tests again manually to verify.

@Nusnus
Copy link

Nusnus commented Aug 30, 2023

I am experiencing the same issue randomly too regarding unrelated code changes (celery/celery#8463).
I am capped at tox <4.9 and everything was working fine yesterday.

@abravalheri
Copy link
Contributor Author

@Nusnus, you can also update to tox==4.11.0.

I will close the issue now since things seem to be fine and there is nothing to do in setuptools.

@Nusnus
Copy link

Nusnus commented Aug 30, 2023

@Nusnus, you can also update to tox==4.11.0.

I will close the issue now since things seem to be fine and there is nothing to do in setuptools.

It worked!
Thanks 👍

Mr-Pepe pushed a commit to vorausrobotik/voraus-python-template that referenced this issue Oct 25, 2023
Fixes `tox -e build` step.
See pypa/setuptools#4031 for details.
g3n35i5 pushed a commit to vorausrobotik/voraus-python-template that referenced this issue Oct 25, 2023
Fixes `tox -e build` step.
See pypa/setuptools#4031 for details.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants