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

Remove test command #4458

Merged
merged 7 commits into from
Jul 28, 2024
Merged

Remove test command #4458

merged 7 commits into from
Jul 28, 2024

Conversation

jaraco
Copy link
Member

@jaraco jaraco commented Jul 5, 2024

  • Move paths_on_pythonpath out of the command.test module.
  • Remove test module and associated tests.

Summary of changes

Closes #931.

Pull Request Checklist

@jaraco jaraco marked this pull request as draft July 5, 2024 12:52
@jaraco jaraco marked this pull request as ready for review July 5, 2024 13:36
@jaraco jaraco force-pushed the debt/remove-test-command branch from f85d11c to fb6c826 Compare July 5, 2024 13:37
@jaraco jaraco force-pushed the debt/remove-test-command branch from fb6c826 to 6404823 Compare July 5, 2024 13:37
@jaraco jaraco force-pushed the debt/remove-test-command branch from e1311d9 to c405ac1 Compare July 21, 2024 16:05
@jaraco jaraco merged commit 4c0b9f3 into main Jul 28, 2024
38 checks passed
@jaraco jaraco deleted the debt/remove-test-command branch July 28, 2024 21:05
@bebound
Copy link
Contributor

bebound commented Jul 29, 2024

It seems some packages fail to build because of this change.
For example, pip install vcrpy.

Collecting vcrpy
  Downloading vcrpy-6.0.1.tar.gz (84 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 84.8/84.8 kB 755.9 kB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [20 lines of output]
      Traceback (most recent call last):
        File "/usr/local/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/usr/local/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/usr/local/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
                 ^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-wbp_9tw8/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 327, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=[])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-wbp_9tw8/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 297, in _get_build_requires
          self.run_setup()
        File "/tmp/pip-build-env-wbp_9tw8/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 497, in run_setup
          super().run_setup(setup_script=setup_script)
        File "/tmp/pip-build-env-wbp_9tw8/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 313, in run_setup
          exec(code, locals())
        File "<string>", line 9, in <module>
      ModuleNotFoundError: No module named 'setuptools.command.test'
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

@otms61
Copy link

otms61 commented Jul 29, 2024

The installation of the autobahn package also failed. Here is the error message:

> pip install autobahn
Collecting autobahn
  Using cached autobahn-23.6.2.tar.gz (480 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [20 lines of output]
      Traceback (most recent call last):
        File "/Users/name/.pyenv/versions/3.11.4/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/Users/name/.pyenv/versions/3.11.4/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/Users/name/.pyenv/versions/3.11.4/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
                 ^^^^^^^^^^^^^^^^^^^^^
        File "/private/var/folders/yg/56szr3gj3w504fzkc5851c9w0000gn/T/pip-build-env-6uyc5q5e/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 327, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=[])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/private/var/folders/yg/56szr3gj3w504fzkc5851c9w0000gn/T/pip-build-env-6uyc5q5e/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 297, in _get_build_requires
          self.run_setup()
        File "/private/var/folders/yg/56szr3gj3w504fzkc5851c9w0000gn/T/pip-build-env-6uyc5q5e/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 497, in run_setup
          super().run_setup(setup_script=setup_script)
        File "/private/var/folders/yg/56szr3gj3w504fzkc5851c9w0000gn/T/pip-build-env-6uyc5q5e/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 313, in run_setup
          exec(code, locals())
        File "<string>", line 32, in <module>
      ModuleNotFoundError: No module named 'setuptools.command.test'
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

@kwongtn98
Copy link

django-celery-beat breaks too

#33 [web build 8/8] RUN --mount=type=cache,target=/root/.cache/uv     if [ "dev" = "dev" ]; then         /root/.cargo/bin/uv pip install --no-cache-dir --system -r requirements-dev.lock;     else         /root/.cargo/bin/uv pip install --no-cache-dir --system -r requirements.lock;     fi
#33 3.182 error: Failed to download and build `django-celery-beat==2.6.0`
#33 3.182   Caused by: Failed to build: `django-celery-beat==2.6.0`
#33 3.183   Caused by: Build backend failed to determine extra requires with `build_wheel()` with exit status: 1
#33 3.183 --- stdout:
#33 3.183 
failed to solve: process "/bin/sh -c if [ \"$ENVIRONMENT\" = \"dev\" ]; then         /root/.cargo/bin/uv pip install --no-cache-dir --system -r requirements-dev.lock;     else         /root/.cargo/bin/uv pip install --no-cache-dir --system -r requirements.lock;     fi" did not complete successfully: exit code: 2
#33 3.183 --- stderr:
#33 3.183 Traceback (most recent call last):
#33 3.183   File "<string>", line 14, in <module>
#33 3.183   File "/tmp/.tmpHvNSNa/builds-v0/.tmpf0XfAh/lib/python3.12/site-packages/setuptools/build_meta.py", line 327, in get_requires_for_build_wheel
#33 3.183     return self._get_build_requires(config_settings, requirements=[])
#33 3.183            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#33 3.183   File "/tmp/.tmpHvNSNa/builds-v0/.tmpf0XfAh/lib/python3.12/site-packages/setuptools/build_meta.py", line 297, in _get_build_requires
#33 3.183     self.run_setup()
#33 3.183   File "/tmp/.tmpHvNSNa/builds-v0/.tmpf0XfAh/lib/python3.12/site-packages/setuptools/build_meta.py", line 497, in run_setup
#33 3.183     super().run_setup(setup_script=setup_script)
#33 3.183   File "/tmp/.tmpHvNSNa/builds-v0/.tmpf0XfAh/lib/python3.12/site-packages/setuptools/build_meta.py", line 313, in run_setup
#33 3.183     exec(code, locals())
#33 3.183   File "<string>", line 9, in <module>
#33 3.183 ModuleNotFoundError: No module named 'setuptools.command.test'
#33 3.183 ---
#33 ERROR: process "/bin/sh -c if [ \"$ENVIRONMENT\" = \"dev\" ]; then         /root/.cargo/bin/uv pip install --no-cache-dir --system -r requirements-dev.lock;     else         /root/.cargo/bin/uv pip install --no-cache-dir --system -r requirements.lock;     fi" did not complete successfully: exit code: 2
------
 > [celeryworker build 8/8] RUN --mount=type=cache,target=/root/.cache/uv     if [ "dev" = "dev" ]; then         /root/.cargo/bin/uv pip install --no-cache-dir --system -r requirements-dev.lock;     else         /root/.cargo/bin/uv pip install --no-cache-dir --system -r requirements.lock;     fi:
3.183            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3.183   File "/tmp/.tmpHvNSNa/builds-v0/.tmpf0XfAh/lib/python3.12/site-packages/setuptools/build_meta.py", line 297, in _get_build_requires
3.183     self.run_setup()
3.183   File "/tmp/.tmpHvNSNa/builds-v0/.tmpf0XfAh/lib/python3.12/site-packages/setuptools/build_meta.py", line 497, in run_setup
3.183     super().run_setup(setup_script=setup_script)
3.183   File "/tmp/.tmpHvNSNa/builds-v0/.tmpf0XfAh/lib/python3.12/site-packages/setuptools/build_meta.py", line 313, in run_setup
3.183     exec(code, locals())
3.183   File "<string>", line 9, in <module>
3.183 ModuleNotFoundError: No module named 'setuptools.command.test'
3.183 ---
------

@valentino-sm
Copy link

> pip wheel --no-cache-dir --use-pep517 nylas
Collecting nylas
  Downloading nylas-6.3.0.tar.gz (44 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [20 lines of output]
      Traceback (most recent call last):
        File "/Users/val/Developer/app/venv/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/Users/val/Developer/app/venv/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/Users/val/Developer/app/venv/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
                 ^^^^^^^^^^^^^^^^^^^^^
        File "/private/var/folders/ml/yvwf_v0s3rs8h_b62psv0_5w0000gp/T/pip-build-env-i80m24b4/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 327, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=[])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/private/var/folders/ml/yvwf_v0s3rs8h_b62psv0_5w0000gp/T/pip-build-env-i80m24b4/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 297, in _get_build_requires
          self.run_setup()
        File "/private/var/folders/ml/yvwf_v0s3rs8h_b62psv0_5w0000gp/T/pip-build-env-i80m24b4/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 497, in run_setup
          super().run_setup(setup_script=setup_script)
        File "/private/var/folders/ml/yvwf_v0s3rs8h_b62psv0_5w0000gp/T/pip-build-env-i80m24b4/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 313, in run_setup
          exec(code, locals())
        File "<string>", line 7, in <module>
      ModuleNotFoundError: No module named 'setuptools.command.test'
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

@anyidea
Copy link

anyidea commented Jul 29, 2024

jsbeautifier and cssbeautifier breaks too.

ChefBuildError

  Backend subprocess exited when trying to invoke get_requires_for_build_wheel
  
  Traceback (most recent call last):
    File "/Users/aidenlu/.local/pipx/venvs/poetry/lib/python3.12/site-packages/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
      main()
    File "/Users/aidenlu/.local/pipx/venvs/poetry/lib/python3.12/site-packages/pyproject_hooks/_in_process/_in_process.py", line 335, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/Users/aidenlu/.local/pipx/venvs/poetry/lib/python3.12/site-packages/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
      return hook(config_settings)
             ^^^^^^^^^^^^^^^^^^^^^
    File "/private/var/folders/wz/kqw652sx28j0zhdrhln3s6h80000gn/T/tmp4yqgsyc9/.venv/lib/python3.12/site-packages/setuptools/build_meta.py", line 327, in get_requires_for_build_wheel
      return self._get_build_requires(config_settings, requirements=[])
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/private/var/folders/wz/kqw652sx28j0zhdrhln3s6h80000gn/T/tmp4yqgsyc9/.venv/lib/python3.12/site-packages/setuptools/build_meta.py", line 297, in _get_build_requires
      self.run_setup()
    File "/private/var/folders/wz/kqw652sx28j0zhdrhln3s6h80000gn/T/tmp4yqgsyc9/.venv/lib/python3.12/site-packages/setuptools/build_meta.py", line 497, in run_setup
      super().run_setup(setup_script=setup_script)
    File "/private/var/folders/wz/kqw652sx28j0zhdrhln3s6h80000gn/T/tmp4yqgsyc9/.venv/lib/python3.12/site-packages/setuptools/build_meta.py", line 313, in run_setup
      exec(code, locals())
    File "<string>", line 9, in <module>
  ModuleNotFoundError: No module named 'setuptools.command.test'
  

  at ~/.local/pipx/venvs/poetry/lib/python3.12/site-packages/poetry/installation/chef.py:164 in _prepare
      160│ 
      161│                 error = ChefBuildError("\n\n".join(message_parts))
      162│ 
      163│             if error is not None:
    → 164│                 raise error from None
      165│ 
      166│             return path
      167│ 
      168│     def _prepare_sdist(self, archive: Path, destination: Path | None = None) -> Path:

Note: This error originates from the build backend, and is likely not a problem with poetry but with jsbeautifier (1.15.1) not supporting PEP 517 builds. You can verify this by running 'pip wheel --no-cache-dir --use-pep517 "jsbeautifier (==1.15.1)"'.```

@PhuongTMR
Copy link

I encountered the same issue with django-celery-beat==2.6.0 even though I have my setuptools version fixed at 69.1.1. It's so weird. Please note that I'm using Poetry for installation.

#17 21.94   ChefBuildError
#17 21.94 
#17 21.94   Backend subprocess exited when trying to invoke get_requires_for_build_wheel
#17 21.94   
#17 21.94   Traceback (most recent call last):
#17 21.94     File "/app/.local/share/pypoetry/venv/lib/python3.11/site-packages/pyproject_hooks/_in_process/_in_process.py", line 373, in <module>
#17 21.94       main()
#17 21.94     File "/app/.local/share/pypoetry/venv/lib/python3.11/site-packages/pyproject_hooks/_in_process/_in_process.py", line 357, in main
#17 21.94       json_out["return_val"] = hook(**hook_input["kwargs"])
#17 21.94                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#17 21.94     File "/app/.local/share/pypoetry/venv/lib/python3.11/site-packages/pyproject_hooks/_in_process/_in_process.py", line 134, in get_requires_for_build_wheel
#17 21.94       return hook(config_settings)
#17 21.94              ^^^^^^^^^^^^^^^^^^^^^
#17 21.94     File "/tmp/tmpu16gtcd5/.venv/lib/python3.11/site-packages/setuptools/build_meta.py", line 327, in get_requires_for_build_wheel
#17 21.94       return self._get_build_requires(config_settings, requirements=[])
#17 21.94              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#17 21.94     File "/tmp/tmpu16gtcd5/.venv/lib/python3.11/site-packages/setuptools/build_meta.py", line 297, in _get_build_requires
#17 21.94       self.run_setup()
#17 21.94     File "/tmp/tmpu16gtcd5/.venv/lib/python3.11/site-packages/setuptools/build_meta.py", line 497, in run_setup
#17 21.94       super().run_setup(setup_script=setup_script)
#17 21.94     File "/tmp/tmpu16gtcd5/.venv/lib/python3.11/site-packages/setuptools/build_meta.py", line 313, in run_setup
#17 21.94       exec(code, locals())
#17 21.94     File "<string>", line 9, in <module>
#17 21.94   ModuleNotFoundError: No module named 'setuptools.command.test'
#17 21.94   
#17 21.96 
#17 21.96   at .local/share/pypoetry/venv/lib/python3.11/site-packages/poetry/installation/chef.py:164 in _prepare
#17 21.99       160│ 
#17 22.00       161│                 error = ChefBuildError("\n\n".join(message_parts))
#17 22.02       162│ 
#17 22.02       163│             if error is not None:
#17 22.02     → 164│                 raise error from None
#17 22.02       165│ 
#17 22.02       166│             return path
#17 22.03       167│ 
#17 22.03       168│     def _prepare_sdist(self, archive: Path, destination: Path | None = None) -> Path:
#17 22.05 
#17 22.05 Note: This error originates from the build backend, and is likely not a problem with poetry but with django-celery-beat (2.6.0) not supporting PEP 517 builds. You can verify this by running 'pip wheel --no-cache-dir --use-pep517 "django-celery-beat (==2.6.0)"'.

@FANGOD
Copy link

FANGOD commented Jul 29, 2024

I have to temporarily use an older version of setuptools.

10 18.71 Collecting SQLAlchemy==1.4.29 (from -r /tmp/requirements.txt (line 25))
10 18.87   Downloading SQLAlchemy-1.4.29.tar.gz (8.0 MB)
10 24.98      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 8.0/8.0 MB 1.4 MB/s eta 0:00:00
10 26.70   Preparing metadata (setup.py): started
10 26.96   Preparing metadata (setup.py): finished with status 'error'
10 26.97   error: subprocess-exited-with-error
10 26.97   
10 26.97   × python setup.py egg_info did not run successfully.
10 26.97   │ exit code: 1
10 26.97   ╰─> [6 lines of output]
10 26.97       Traceback (most recent call last):
10 26.97         File "<string>", line 2, in <module>
10 26.97         File "<pip-setuptools-caller>", line 34, in <module>
10 26.97         File "/tmp/pip-install-1243ft56/sqlalchemy_3f077010db4f461497398e0b7ffee028/setup.py", line 10, in <module>
10 26.97           from setuptools.command.test import test as TestCommand
10 26.97       ModuleNotFoundError: No module named 'setuptools.command.test'
10 26.97       [end of output]
10 26.97   
10 26.97   note: This error originates from a subprocess, and is likely not a problem with pip.
10 27.71 error: metadata-generation-failed
10 27.71 
10 27.71 × Encountered error while generating package metadata.
10 27.71 ╰─> See above for output.
10 27.71 
10 27.71 note: This is an issue with the package mentioned above, not pip.
10 27.71 hint: See above for details.
10 ERROR: process "/bin/sh -c pip --no-cache-dir install -r /tmp/requirements.txt && rm -rf /tmp/requirements.txt" did not complete successfully: exit code: 1
------
 > [6/7] RUN pip --no-cache-dir install -r /tmp/requirements.txt && rm -rf /tmp/requirements.txt:
26.97       [end of output]
26.97   
26.97   note: This error originates from a subprocess, and is likely not a problem with pip.
27.71 error: metadata-generation-failed
27.71 
27.71 × Encountered error while generating package metadata.
27.71 ╰─> See above for output.
27.71 
27.71 note: This is an issue with the package mentioned above, not pip.
27.71 hint: See above for details.

@gukoff
Copy link

gukoff commented Jul 29, 2024

UPDATE

Pinning setuptools<72 doesn't help when pip installs your requirement in the isolated build environment, because then it by default pulls the latest setuptools.

The universal solution is to define PIP_CONSTRAINT like in the answer below, because this constraint will also apply to the isolated build environment.

Another workarounds that may or may not work for you include:

  • downgrading to pip<23.1.0
  • doing pip install wheel (this will disable isolated build environment for some packages)
  • specifying --no-build-isolation (which has its own pitfalls).

@paris-ci
Copy link

UPDATE

Those for whom pinning setuptools<72 doesn't help, also install wheel.

Per this comment, without wheel available, pip will build package in an isolated environment in which it will install the latest version of setuptools.

(Previous text)

Those for whom pinning setuptools<72 doesn't help, try downgrading pip to pip<23.1.0. On my machine, starting from pip==23.1.0, pip automatically fetches the latest setuptools during pip install. I'm trying to track down why.

I wish that'd work, but on python3.12, pinning pip that low makes it error with AttributeError: module 'pkgutil' has no attribute 'ImpImporter'. Did you mean: 'zipimporter'

@paris-ci
Copy link

Solution/workaround is there : #4519

If using docker and PIP or poetry, do the following :

RUN echo "setuptools<72" > constraints.txt
ENV PIP_CONSTRAINT=constraints.txt

If not, well, create a file constraints.txt at the root of your project with setuptools<72 as the file content
Then use export PIP_CONSTRAINT=constraints.txt to point to that file in the environnement variables.

Remove the fix once the upstream packages are updated

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

Successfully merging this pull request may close these issues.

Remove test command and tests_require
10 participants