Delete unused requirements file, simplify nanobind build file (#1635)

The dependencies are contained in the `pyproject.toml` since it was added.

Switches to header and source file globbing instead of manually listing
the files. The selects for different platforms are removed, as a tradeoff,
we take a single- to low double-digit hit in wheel sizes (between 5 percent
zipped and 12% installed on MacOS 13.4).
This commit is contained in:
Nicholas Junge 2023-07-17 16:28:35 +02:00 committed by GitHub
parent b1c4a752d1
commit c5997e0a78
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 53 deletions

View File

@ -1,57 +1,17 @@
config_setting(
name = "msvc_compiler",
flag_values = {"@bazel_tools//tools/cpp:compiler": "msvc-cl"},
)
cc_library(
name = "nanobind",
hdrs = glob(
include = [
"include/nanobind/*.h",
"include/nanobind/stl/*.h",
"include/nanobind/detail/*.h",
],
exclude = [],
),
srcs = [
"include/nanobind/stl/detail/nb_dict.h",
"include/nanobind/stl/detail/nb_list.h",
"include/nanobind/stl/detail/traits.h",
"ext/robin_map/include/tsl/robin_map.h",
"ext/robin_map/include/tsl/robin_hash.h",
"ext/robin_map/include/tsl/robin_growth_policy.h",
"ext/robin_map/include/tsl/robin_set.h",
"src/buffer.h",
"src/common.cpp",
"src/error.cpp",
"src/implicit.cpp",
"src/nb_enum.cpp",
"src/nb_func.cpp",
"src/nb_internals.cpp",
"src/nb_internals.h",
"src/nb_ndarray.cpp",
"src/nb_static_property.cpp",
"src/nb_type.cpp",
"src/trampoline.cpp",
],
copts = select({
":msvc_compiler": [],
"//conditions:default": [
"-fexceptions",
"-Os", # size optimization
"-flto", # enable LTO
],
}),
linkopts = select({
"@com_github_google_benchmark//:macos": [
"-undefined dynamic_lookup",
"-Wl,-no_fixup_chains",
"-Wl,-dead_strip",
],
"//conditions:default": [],
}),
srcs = glob([
"src/*.cpp"
]),
copts = ["-fexceptions"],
includes = ["include", "ext/robin_map/include"],
textual_hdrs = glob(
[
"include/**/*.h",
"src/*.h",
"ext/robin_map/include/tsl/*.h",
],
),
deps = ["@python_headers"],
visibility = ["//visibility:public"],
)

View File

@ -1,2 +0,0 @@
absl-py>=0.7.1