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

Add support for PEP517 builds #1050

Closed

Conversation

joel-martin
Copy link
Contributor

Summary

Using PEP517 to build the source distribution fails, because the build system dependencies are not specified.

pip wheel --no-cache-dir --use-pep517 dymos
Collecting dymos
  Downloading dymos-1.10.0.tar.gz (567 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 567.3/567.3 kB 5.1 MB/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
  ╰─> [17 lines of output]
      Traceback (most recent call last):
        File "PATH_TO_VIRTUAL_ENV\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
          main()
        File "PATH_TO_VIRTUAL_ENV\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "PATH_TO_VIRTUAL_ENV\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
        File "PATH_TO_TEMP\pip-build-env-p10744e1\overlay\Lib\site-packages\setuptools\build_meta.py", line 325, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
        File "PATH_TO_TEMP\pip-build-env-p10744e1\overlay\Lib\site-packages\setuptools\build_meta.py", line 295, in _get_build_requires
          self.run_setup()
        File "PATH_TO_TEMP\pip-build-env-p10744e1\overlay\Lib\site-packages\setuptools\build_meta.py", line 487, in run_setup
          super().run_setup(setup_script=setup_script)
        File "PATH_TO_TEMP\pip-build-env-p10744e1\overlay\Lib\site-packages\setuptools\build_meta.py", line 311, in run_setup
          exec(code, locals())
        File "<string>", line 1, in <module>
      ModuleNotFoundError: No module named 'packaging'
      [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.

Support for PEP517 is required as it is the recommended standard and dependency management systems such as Poetry use the --use-pep517 flag.

The error can be easily solved by adding a pyproject.toml file that specifies the required build dependencies. This is suggested in this pull request.

Related Issues

None

Backwards incompatibilities

None

New Dependencies

None, setuptools is already required. The requirement is only specified.

@coveralls
Copy link

Coverage Status

coverage: 92.7% (-0.1%) from 92.838%
when pulling 4dc8ed4 on joel-martin:add-support-for-pep517-builds
into ed640d7 on OpenMDAO:master.

@robfalck
Copy link
Contributor

The specific error you showed will no longer occur as of #1027. However if you're interested in using something like Poetry and thus need this change regardless, we'd accept it. Is there a test you can add that verifies this change functions as you want it to? Building a wheel or something?

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.

3 participants