works
commit
9189741692
|
@ -0,0 +1,26 @@
|
||||||
|
git_repository(
|
||||||
|
name = "io_bazel_rules_python",
|
||||||
|
# Patch: Invoke pip for the appropriate Python version.
|
||||||
|
remote = "https://github.com/uri-canva/rules_python.git",
|
||||||
|
commit = "b8f9dead4a2d3607455db4f87adf58c56c9de8c7",
|
||||||
|
)
|
||||||
|
|
||||||
|
git_repository(
|
||||||
|
name = "subpar",
|
||||||
|
remote = "https://github.com/q3k/subpar",
|
||||||
|
# Patch: do not always call atexit.
|
||||||
|
commit = "e32f5f71d263858eb099f79a281760f0c3aae4c6",
|
||||||
|
)
|
||||||
|
|
||||||
|
load("@io_bazel_rules_python//python:pip.bzl", "pip3_import", "pip_repositories")
|
||||||
|
|
||||||
|
pip_repositories()
|
||||||
|
|
||||||
|
pip3_import(
|
||||||
|
name = "py_deps",
|
||||||
|
requirements = "//py:requirements.txt",
|
||||||
|
)
|
||||||
|
|
||||||
|
load("@py_deps//:requirements.bzl", "pip_install")
|
||||||
|
|
||||||
|
pip_install()
|
|
@ -0,0 +1,17 @@
|
||||||
|
load("@subpar//:subpar.bzl", "par_binary")
|
||||||
|
load("@py_deps//:requirements.bzl", "requirement")
|
||||||
|
|
||||||
|
par_binary(
|
||||||
|
name = "demo",
|
||||||
|
srcs = ["demo.py"],
|
||||||
|
main = "demo.py",
|
||||||
|
|
||||||
|
legacy_create_init = False,
|
||||||
|
zip_safe = False,
|
||||||
|
|
||||||
|
visibility = ["//visibility:public"],
|
||||||
|
|
||||||
|
deps = [
|
||||||
|
requirement("numpy"),
|
||||||
|
],
|
||||||
|
)
|
|
@ -0,0 +1,8 @@
|
||||||
|
import sys
|
||||||
|
|
||||||
|
import numpy as np
|
||||||
|
|
||||||
|
print('Python Version', sys.version)
|
||||||
|
|
||||||
|
papiez = np.array([2,1,3,7])
|
||||||
|
print(papiez)
|
|
@ -0,0 +1 @@
|
||||||
|
numpy==1.15.4
|
Loading…
Reference in New Issue