diff --git a/.github/workflows/ubuntu_basic.yml b/.github/workflows/ubuntu_basic.yml index df379b0..db94132 100644 --- a/.github/workflows/ubuntu_basic.yml +++ b/.github/workflows/ubuntu_basic.yml @@ -10,31 +10,35 @@ jobs: run-unit-tests: timeout-minutes: 60 runs-on: ubuntu-latest - container: docker.io/library/ubuntu:20.04 + container: docker.io/library/ubuntu:22.04 steps: - uses: actions/checkout@v2 - name: Install bazel run: | + export DEBIAN_FRONTEND=noninteractive apt-get update - apt-get install -yq wget gcc g++ python3.8 zlib1g-dev zip libuv1.dev + add-apt-repository ppa:deadsnakes/ppa + apt-get install -yq wget gcc g++ python3.11 zlib1g-dev zip libuv1.dev apt-get install -yq pip - wget "https://github.com/bazelbuild/bazel/releases/download/5.1.0/bazel_5.1.0-linux-x86_64.deb" -O bazel_5.1.0-linux-x86_64.deb - dpkg -i bazel_5.1.0-linux-x86_64.deb + wget "https://github.com/bazelbuild/bazel/releases/download/6.5.0/bazel_6.5.0-linux-x86_64.deb" -O bazel_6.5.0-linux-x86_64.deb + dpkg -i bazel_6.5.0-linux-x86_64.deb - name: Install dependencies run: | python3 -m pip install virtualenv - python3 -m virtualenv -p python3.8 py3 + python3 -m virtualenv -p python3.11 py3 . py3/bin/activate which python + python --version pip install pytest torch - pip install ray==1.13.0 + pip install ray - name: Build and test run: | . py3/bin/activate + python --version python3 setup.py install cd tests && python3 -m pytest * diff --git a/WORKSPACE b/WORKSPACE index cdd3513..c860bd1 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -5,6 +5,21 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # Group the sources of the library so that CMake rule have access to it all_content = """filegroup(name = "all", srcs = glob(["**"]), visibility = ["//visibility:public"])""" +http_archive( + name = "rules_python", + strip_prefix = "rules_python-0.30.0", + url = "https://wq-boost.oss-cn-beijing.aliyuncs.com/rules_python-0.30.0.tar.gz", +) +# if missing it will trig the error message of the OP +load("@rules_python//python:repositories.bzl", "py_repositories", "python_register_toolchains") +py_repositories() + +python_register_toolchains( + name = "python_3_11", + python_version = "3.11", + ignore_root_user_error = True, +) + # Rule repository http_archive( name = "rules_foreign_cc", @@ -42,18 +57,19 @@ http_archive( http_archive( name = "pybind11_bazel", - strip_prefix = "pybind11_bazel-f4f1bd4fa4b368b79dd6f003f8ef8c5a91fad36b", - urls = ["https://github.com/Ezra-H/pybind11_bazel/archive/f4f1bd4fa4b368b79dd6f003f8ef8c5a91fad36b.zip"], - sha256 = "6ea811e7a7348f7c9d5b59887aa0c65e42222e199049a1ee55db147d2e9ca4a7", + strip_prefix = "pybind11_bazel-2.13.6", + urls = ["https://github.com/pybind/pybind11_bazel/releases/download/v2.13.6/pybind11_bazel-2.13.6.zip"], + sha256 = "9df284330336958c837fb70dc34c0a6254dac52a5c983b3373a8c2bbb79ac35e", ) # We still require the pybind library. http_archive( name = "pybind11", - build_file = "@pybind11_bazel//:pybind11.BUILD", - strip_prefix = "pybind11-2.6.1", - urls = ["https://github.com/pybind/pybind11/archive/v2.6.1.tar.gz"], - sha256 = "cdbe326d357f18b83d10322ba202d69f11b2f49e2d87ade0dc2be0c5c34f8e2a", + build_file = "@pybind11_bazel//:pybind11-BUILD.bazel", + strip_prefix = "pybind11-2.13.6", + # urls = ["https://github.com/pybind/pybind11/archive/v2.13.6.zip"], + urls = ["https://wq-boost.oss-cn-beijing.aliyuncs.com/pybind11-2.13.6.zip"], + # sha256 = "cdbe326d357f18b83d10322ba202d69f11b2f49e2d87ade0dc2be0c5c34f8e2a", ) http_archive( @@ -81,7 +97,7 @@ http_archive( sha256 = "a146136bb6efdac0e3ede952d09aec44b771a87ebc713bd815c3a90a7428c908", ) -load("@pybind11_bazel//:python_configure.bzl", "python_configure_pybind") -python_configure_pybind(name = "local_config_python") +# load("@pybind11_bazel//:python_configure.bzl", "python_configure_pybind") +# python_configure_pybind(name = "local_config_python") diff --git a/pygloo/BUILD b/pygloo/BUILD index 41f152f..7eaf71e 100644 --- a/pygloo/BUILD +++ b/pygloo/BUILD @@ -2,6 +2,8 @@ load("@rules_foreign_cc//tools/build_defs:cmake.bzl", "cmake_external") load("@rules_foreign_cc//tools/build_defs:make.bzl", "make") load("@pybind11_bazel//:build_defs.bzl", "pybind_library") load("@pybind11_bazel//:build_defs.bzl", "pybind_extension") +load("@rules_python//python:defs.bzl", "py_library") + cmake_external( name = "libuv", @@ -72,7 +74,7 @@ pybind_library( hdrs = glob(["include/*.h"]), strip_include_prefix = "include", visibility = ["//visibility:public"], - deps = [":gloo"] + deps = [":gloo", "@rules_python//python/cc:current_py_cc_libs"] ) pybind_extension( diff --git a/setup.py b/setup.py index 42c4070..a4ea04e 100644 --- a/setup.py +++ b/setup.py @@ -22,8 +22,8 @@ logger = logging.getLogger(__name__) -SUPPORTED_PYTHONS = [(3, 6), (3, 7), (3, 8), (3, 9), (3, 10)] -SUPPORTED_BAZEL = (3, 2, 0) +SUPPORTED_PYTHONS = [(3, 11), (3, 11), (3, 13)] +SUPPORTED_BAZEL = (6, 5, 0) ROOT_DIR = os.path.dirname(__file__) @@ -130,10 +130,10 @@ def finalize_options(self): setuptools.setup( name="pygloo", - version="0.2.0", + version="0.2.2.dev0", author="Ray Team", author_email="ray-dev@googlegroups.com", - description=("A python binding for gloo"), + description=("A python binding for gloo."), long_description=long_description, long_description_content_type="text/markdown", url="https://github.com/ray-project/pygloo",