Skip to content

Commit

Permalink
Revert
Browse files Browse the repository at this point in the history
  • Loading branch information
EthanSteinberg committed Jun 22, 2024
1 parent db44df5 commit 441caef
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 28 deletions.
10 changes: 6 additions & 4 deletions native/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ load(
"@rules_foreign_cc//foreign_cc:defs.bzl", "cmake", "configure_make", "make"
)

load("@pybind11_bazel//:build_defs.bzl", "pybind_extension")

cc_binary(
name="simple_test",
srcs=["simple_test.cc"],
Expand Down Expand Up @@ -30,13 +32,13 @@ cc_binary(
],
)

cc_binary(
name="_meds_reader.so",

pybind_extension(
name="_meds_reader",
srcs=[
"meds_reader.cc",
],
deps=["@rules_python//python/cc:current_py_cc_headers", ":create_database"],
linkshared = 1,
deps=[":create_database"],
)

cmake(
Expand Down
13 changes: 1 addition & 12 deletions native/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,4 @@
# Please consider migrating your external dependencies from WORKSPACE to MODULE.bazel.
#
# For more details, please check https://github.com/bazelbuild/bazel/issues/18958
###############################################################################

register_toolchains("@bazel_tools//tools/python:autodetecting_toolchain")

bazel_dep(name = "rules_python", version = "0.33.2")
python = use_extension("@rules_python//python/extensions:python.bzl", "python")

python.toolchain(
ignore_root_user_error = True,
is_default=False,
python_version = "3.11",
)
###############################################################################
38 changes: 32 additions & 6 deletions native/MODULE.bazel.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 15 additions & 6 deletions native/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,18 @@ http_archive(
integrity = "sha256-Oxw7RuQW02kx79NGYxItf1G1UMh/dN4tOCSVFv59i+U=",
)

# http_archive(
# name="lz4",
# strip_prefix="lz4-1.9.4",
# urls = ["https://github.com/lz4/lz4/releases/download/v1.9.4/lz4-1.9.4.tar.gz"],
# build_file_content = all_content,
# )
http_archive(
name = "pybind11_bazel",
strip_prefix = "pybind11_bazel-2.11.1",
urls = ["https://github.com/pybind/pybind11_bazel/archive/v2.11.1.zip"],
)
# We still require the pybind library.
http_archive(
name = "pybind11",
build_file = "@pybind11_bazel//:pybind11.BUILD",
strip_prefix = "pybind11-2.11.1",
urls = ["https://github.com/pybind/pybind11/archive/v2.11.1.zip"],
)

load("@pybind11_bazel//:python_configure.bzl", "python_configure")
python_configure(name = "local_config_python")
4 changes: 4 additions & 0 deletions native/meds_reader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1109,6 +1109,8 @@ PyMODINIT_FUNC
PyInit__meds_reader(void) {
PyDateTime_IMPORT;

std::cout<<PY_VERSION << std::endl;

if (PyType_Ready(&PatientDatabaseType) < 0) {
return NULL;
}
Expand All @@ -1119,6 +1121,8 @@ PyInit__meds_reader(void) {
return NULL;
}



PyObject* m = PyModule_Create(&meds_reader_module);
if (m == NULL) {
return NULL;
Expand Down

0 comments on commit 441caef

Please sign in to comment.