Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add preprocessor flag to unit test for importlib.metadata. #154

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ WORKDIR /opt/multipy
COPY . .
RUN git submodule update --init --recursive --jobs 0

# Install conda + neccessary python dependencies
# Install conda + neccessary python dependencies for 3.8+.
FROM dev-base as conda
ARG PYTHON_VERSION=3.8
RUN curl -fsSL -v -o ~/miniconda.sh -O https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh && \
Expand Down
2 changes: 2 additions & 0 deletions multipy/runtime/test_deploy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,7 @@ result = torch.Tensor([1,2,3])
EXPECT_TRUE(w_grad0.equal(w_grad1));
}

#ifndef LEGACY_PYTHON_PRE_3_8
TEST(TorchpyTest, ImportlibMetadata) {
torch::deploy::InterpreterManager m(1);
m.registerModuleSource("importlib_test", R"PYTHON(
Expand All @@ -470,6 +471,7 @@ result = version("torch")
auto ver = I.global("importlib_test", "result").toIValue().toString();
ASSERT_EQ(ver->string(), "0.0.1+fake_multipy");
}
#endif

// OSS build does not have bultin numpy support yet. Use this flag to guard the
// test case.
Expand Down