Add lots more source files

pull/13171/head
Deanna Garcia 2 years ago
parent 4efa9c3c40
commit f887fe30aa
  1. 14
      BUILD
  2. 11
      python/dist/BUILD.bazel
  3. 3
      python/dist/MANIFEST.in
  4. 10
      python/dist/setup.py
  5. 15
      upb/util/BUILD

14
BUILD

@ -36,6 +36,7 @@ load(
"upb_proto_library_copts", "upb_proto_library_copts",
"upb_proto_reflection_library", "upb_proto_reflection_library",
) )
load("@rules_pkg//:mappings.bzl", "pkg_files", "strip_prefix")
# begin:google_only # begin:google_only
# load( # load(
@ -1129,6 +1130,19 @@ filegroup(
visibility = ["//cmake:__pkg__"], visibility = ["//cmake:__pkg__"],
) )
pkg_files(
name = "upb_source_files",
srcs = glob(
[
"upb/**/*.c",
"upb/**/*.h",
"upb/**/*.hpp",
"upb/**/*.inc",
], exclude = ["upb/conformance_upb.c"]),
visibility = ["//python/dist:__pkg__"],
strip_prefix = "",
)
# end:github_only # end:github_only
# begin:google_only # begin:google_only

@ -197,6 +197,8 @@ pkg_files(
name = "generated_wkt", name = "generated_wkt",
srcs = [ srcs = [
":well_known_proto_py_pb2", ":well_known_proto_py_pb2",
"//:descriptor_upb_proto",
"//:descriptor_upb_proto_reflection",
], ],
prefix = "google/protobuf", prefix = "google/protobuf",
) )
@ -209,6 +211,12 @@ pkg_files(
prefix = "google/protobuf/compiler", prefix = "google/protobuf/compiler",
) )
pkg_files(
name = "utf8_range_source_files",
srcs = ["@utf8_range//:utf8_range_srcs"],
prefix = "utf8_range",
)
pkg_tar( pkg_tar(
name = "source_wheel", name = "source_wheel",
extension = "tar.gz", extension = "tar.gz",
@ -216,8 +224,11 @@ pkg_tar(
":generated_wkt", ":generated_wkt",
":generated_wkt_compiler", ":generated_wkt_compiler",
"setup.py", "setup.py",
":utf8_range_source_files",
"MANIFEST.in", "MANIFEST.in",
"//:LICENSE", "//:LICENSE",
"//:upb_source_files",
"//upb/util:util_source_files",
"//python:message_extension", "//python:message_extension",
"@com_google_protobuf//python:python_source_files", "@com_google_protobuf//python:python_source_files",
], ],

@ -1 +1,4 @@
include python/*.h include python/*.h
include upb/*.h
include upb/**/*.h
include utf8_range/*.h

@ -33,6 +33,7 @@
import glob import glob
import os import os
import sysconfig
# We must use setuptools, not distutils, because we need to use the # We must use setuptools, not distutils, because we need to use the
# namespace_packages option for the "google" package. # namespace_packages option for the "google" package.
@ -52,8 +53,7 @@ def GetVersion():
exec(version_file.read(), globals()) # pylint:disable=exec-used exec(version_file.read(), globals()) # pylint:disable=exec-used
return __version__ # pylint:disable=undefined-variable return __version__ # pylint:disable=undefined-variable
# Keep this list of dependencies in sync with tox.ini. current_dir = os.path.dirname(os.path.abspath(__file__))
install_requires = []
setup( setup(
name='protobuf', name='protobuf',
@ -68,6 +68,7 @@ setup(
maintainer='protobuf@googlegroups.com', maintainer='protobuf@googlegroups.com',
maintainer_email='protobuf@googlegroups.com', maintainer_email='protobuf@googlegroups.com',
license='BSD-3-Clause', license='BSD-3-Clause',
package_data = {'protobuf': ['python/*.h']},
classifiers=[ classifiers=[
'Programming Language :: Python', 'Programming Language :: Python',
'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3',
@ -78,7 +79,8 @@ setup(
], ],
namespace_packages=['google'], namespace_packages=['google'],
packages=find_packages(), packages=find_packages(),
install_requires=install_requires, install_requires=[],
ext_modules= [Extension('google._upb._message', glob.glob('python/*.c'), include_dirs=['python'])], ext_modules= [Extension('google._upb._message', glob.glob('google/protobuf/*.c') + glob.glob('python/*.c') + glob.glob('upb/*.c') + glob.glob('upb/**/*.c') + glob.glob('utf8_range/*.c'), include_dirs=[current_dir, os.path.join(current_dir, 'utf8_range')])],
python_requires='>=3.7', python_requires='>=3.7',
headers = ['python/*.h', 'upb/*.h', 'upb/**/*.h', 'utf8_range/*.h', 'google/protobuf/*.h'],
) )

@ -1,3 +1,4 @@
load("@rules_pkg//:mappings.bzl", "pkg_files")
load( load(
"//bazel:upb_proto_library.bzl", "//bazel:upb_proto_library.bzl",
"upb_proto_library", "upb_proto_library",
@ -128,3 +129,17 @@ cc_test(
"@com_google_googletest//:gtest_main", "@com_google_googletest//:gtest_main",
], ],
) )
pkg_files(
name = "util_source_files",
srcs = [
"compare.c",
"compare.h",
"def_to_proto.c",
"def_to_proto.h",
"required_fields.c",
"required_fields.h",
],
visibility = ["//visibility:public"],
prefix = "upb/util",
)

Loading…
Cancel
Save