Skip to content

npm should not be required to install pytest-html from pypi #747

@thebaptiste

Description

@thebaptiste

Since release 4.0.0rc5, npm is required to install pytest-html from pypi

I understand npm is only used for tests purpose (maybe I'm wrong...) ? If it is the case I think it should not be necessary to have npm pre-installed to install pytest-html

Below the error I have installing pytest-html >= 4.0.0rc5 from pypi (same thing with 4.0.0, 4.0.1 and 4.0.2) :

  Downloading pytest_html-4.0.0rc5.tar.gz (145 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 145.8/145.8 kB 20.8 MB/s eta 0:00:00
  Preparing metadata (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [23 lines of output]
      /bin/sh: npm: command not found
      Traceback (most recent call last):
        File "/home/baptiste/mfext/build/opt/python3_core/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/home/baptiste/mfext/build/opt/python3_core/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 "/home/baptiste/mfext/build/opt/python3_core/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 152, in prepare_metadata_for_build_wheel
          whl_basename = backend.build_wheel(metadata_directory, config_settings)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/baptiste/mfext/build/opt/python3_core/lib/python3.11/site-packages/hatchling/build.py", line 56, in build_wheel
          return os.path.basename(next(builder.build(wheel_directory, ['standard'])))
                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/baptiste/mfext/build/opt/python3_core/lib/python3.11/site-packages/hatchling/builders/plugin/interface.py", line 150, in build
          build_hook.initialize(version, build_data)
        File "/home/baptiste/mfext/src/layers/layer7_python3_devtools/0500_extra_python_packages/tempolayer3830361/tmp/pip-wheel-dl81rpb1/pytest-html_2cea07a17db443aebda5c2ba1b9efeb4/scripts/npm.py", line 8, in initialize
          subprocess.check_output("npm ci", shell=True)
        File "/home/baptiste/mfext/build/opt/python3_core/lib/python3.11/subprocess.py", line 466, in check_output
          return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/baptiste/mfext/build/opt/python3_core/lib/python3.11/subprocess.py", line 571, in run
          raise CalledProcessError(retcode, process.args,
      subprocess.CalledProcessError: Command 'npm ci' returned non-zero exit status 127.
      [end of output]

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

× Encountered error while generating package metadata.
╰─> See above for output.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions