build.py 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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 / PEP-660 support
  15. Add::
  16. [build-system]
  17. requires = ["pbr>=6.0.0", "setuptools>=64.0.0"]
  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. 'build_editable',
  29. 'get_requires_for_build_editable',
  30. 'prepare_metadata_for_build_editable',
  31. ]
  32. # PEP-517
  33. def get_requires_for_build_wheel(config_settings=None):
  34. return build_meta.get_requires_for_build_wheel(
  35. config_settings=config_settings,
  36. )
  37. def get_requires_for_build_sdist(config_settings=None):
  38. return build_meta.get_requires_for_build_sdist(
  39. config_settings=config_settings,
  40. )
  41. def prepare_metadata_for_build_wheel(metadata_directory, config_settings=None):
  42. return build_meta.prepare_metadata_for_build_wheel(
  43. metadata_directory,
  44. config_settings=config_settings,
  45. )
  46. def build_wheel(
  47. wheel_directory,
  48. config_settings=None,
  49. metadata_directory=None,
  50. ):
  51. return build_meta.build_wheel(
  52. wheel_directory,
  53. config_settings=config_settings,
  54. metadata_directory=metadata_directory,
  55. )
  56. def build_sdist(sdist_directory, config_settings=None):
  57. return build_meta.build_sdist(
  58. sdist_directory,
  59. config_settings=config_settings,
  60. )
  61. # PEP-660
  62. def build_editable(
  63. wheel_directory,
  64. config_settings=None,
  65. metadata_directory=None,
  66. ):
  67. return build_meta.build_editable(
  68. wheel_directory,
  69. config_settings=config_settings,
  70. metadata_directory=metadata_directory,
  71. )
  72. def get_requires_for_build_editable(config_settings=None):
  73. return build_meta.get_requires_for_build_editable(
  74. config_settings=config_settings,
  75. )
  76. def prepare_metadata_for_build_editable(
  77. metadata_directory,
  78. config_settings=None,
  79. ):
  80. return build_meta.prepare_metadata_for_build_editable(
  81. metadata_directory,
  82. config_settings=config_settings,
  83. )