build.py 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. # Copyright 2021 Monty Taylor
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License"); you may
  4. # not use this file except in compliance with the License. You may obtain
  5. # a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  11. # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  12. # License for the specific language governing permissions and limitations
  13. # under the License.
  14. """pep-517 support
  15. Add::
  16. [build-system]
  17. requires = ["pbr>=5.7.0", "setuptools>=36.6.0", "wheel"]
  18. build-backend = "pbr.build"
  19. to pyproject.toml to use this
  20. """
  21. from setuptools import build_meta
  22. __all__ = [
  23. 'get_requires_for_build_sdist',
  24. 'get_requires_for_build_wheel',
  25. 'prepare_metadata_for_build_wheel',
  26. 'build_wheel',
  27. 'build_sdist',
  28. ]
  29. def get_requires_for_build_wheel(config_settings=None):
  30. return build_meta.get_requires_for_build_wheel(config_settings)
  31. def get_requires_for_build_sdist(config_settings=None):
  32. return build_meta.get_requires_for_build_sdist(config_settings)
  33. def prepare_metadata_for_build_wheel(metadata_directory, config_settings=None):
  34. return build_meta.prepare_metadata_for_build_wheel(
  35. metadata_directory, config_settings)
  36. def build_wheel(
  37. wheel_directory,
  38. config_settings=None,
  39. metadata_directory=None,
  40. ):
  41. return build_meta.build_wheel(
  42. wheel_directory, config_settings, metadata_directory,
  43. )
  44. def build_sdist(sdist_directory, config_settings=None):
  45. return build_meta.build_sdist(sdist_directory, config_settings)