Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
2c025ef3
A
apollo
项目概览
Pinoxchio
/
apollo
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
apollo
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
2c025ef3
编写于
9月 02, 2020
作者:
C
changsh726
提交者:
Liu Jiaming
9月 02, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Docs: update cyber/python/README.md
上级
09d8a674
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
22 addition
and
10 deletion
+22
-10
cyber/python/README.md
cyber/python/README.md
+5
-3
docs/howto/how_to_build_and_run_python_app.md
docs/howto/how_to_build_and_run_python_app.md
+17
-7
未找到文件。
cyber/python/README.md
浏览文件 @
2c025ef3
...
...
@@ -2,13 +2,12 @@
## Usage
Make sure you have built Apollo successfully, which should also have added
`/apollo/cyber/python`
to the PYTHONPATH for you. Then in Python code:
Make sure you have built Apollo successfully. Then in Python code:
```
python3
import sys
from cyber_py3 import cyber
from cyber
.python.cyber
_py3 import cyber
cyber.init()
...
...
@@ -24,3 +23,6 @@ cyber.shutdown()
Learn more usage from the
[
examples
](
cyber_py3/examples/
)
and
[
tests
](
cyber_py3/test/
)
.
**Note:**
Like C++ files, Python files are also managed by Bazel since Apollo 6.0. You can take
[
how_to_build_and_run_python_app.md
](
../../docs/howto/how_to_build_and_run_python_app.md
)
as reference.
docs/howto/how_to_build_and_run_python_app.md
浏览文件 @
2c025ef3
# How to Build
and Run(Test)
your Python Application
# How to Build
, Test and Run
your Python Application
Everything managed by pure
[
Bazel
](
https://docs.bazel.build/versions/master/be/python.html
)
in Apollo 6.0.
Starting from Apollo 6.0, building and testing Python applications in Apollo is
done using
[
Bazel
](
https://docs.bazel.build/versions/master/be/python.html
)
exclusively. We use Bazel Python rules to build, run, and test Python programs.
This not only frees us from hand-crafting Protobuf dependencies and managing
Python related Env variables manually, but also helps with managing third party
Python module dependency.
## Create the BUILD file
Generally you need a BUILD target for each python file, which could be one of
*
`py_library(name="lib_target", ...)`
*
`py_binary(name="bin_target", ...)`
*
`py_test(name="test_target", ...)`
-
`py_library(name="lib_target", ...)`
-
`py_binary(name="bin_target", ...)`
-
`py_test(name="test_target", ...)`
### Example
...
...
@@ -48,7 +53,12 @@ py_test(
)
```
## Build & Run commands
Above is a BUILD file template, you can also use the
[
BUILD
](
https://github.com/ApolloAuto/apollo/blob/master/cyber/python/BUILD
)
and
[
BUILD
](
https://github.com/ApolloAuto/apollo/blob/master/cyber/python/examples/BUILD
)
file as examples.
## Build, Test and Run commands
1.
To build any target:
...
...
@@ -65,5 +75,5 @@ py_test(
1.
To run a unit test target:
```
bash
bazel
test
//path/to:t
est_targe
t
bazel
test
//path/to:t
arget_tes
t
```
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录