Please check INSTALLATION.md to build SecretFlow from source.
Before start, please install required package for testing.
pip install -r dev-requirements.txt
There are two types in secretflow/tests.
If you need to run all tests,
# tests under production mode
pytest --env prod -n auto -v --capture=no tests/
# tests under simulation mode
pytest --env sim -n auto -v --capture=no tests/
If you would like to run a single test, e.g. tests/device/test_spu.py,
# tests under simulation mode
pytest --env sim -n auto -v --capture=no tests/device/test_spu.py
# tests under production mode
pytest --env prod -n auto -v --capture=no tests/device/test_spu.py
We stick to Google Style.
We prefer black as our code formatter. For various editor users,
please refer to editor integration.
Pass -S, --skip-string-normalization
to black to avoid string quotes or prefixes normalization.
black
won't format your imports. You can do this manually or by IDE, e.g. VSCode. The format of imports refers to Imports formatting
We stick to Angular Style.
if you update the documentation files in docs/
, you are supposed to update its multilingual version in docs/locales/zh_CN/LC_MESSAGES
.
For example, if you update docs/getting_started/installation.md
, you also need to update the corresponding *.po
file in docs/locales/zh_CN/LC_MESSAGES/getting_started/installation.po
.
Follow follwing steps to update documentation:
Update documentation in docs
.
Run the following command to update *.po
file.
cd docs
pip install -r requirements.txt
sh update_po.sh
Update the corresponding *.po
file.
All fuzzy
should be removed in *.po
file, because it won't take effect in the Chinese version of the documentation.
All strings which start with #~
such as #~ msgid
or #~ msgstr
should be removed, because it is redundant.
Only commit the files which you update and pull request.
If your document is conflict with the main branch of SecretFlow, you are supposed to solve the conflict locally and commit.
You should use protoc v3.19.6
Protocol Buffers resides at submodules/spec/ as git submodules.
~/protoc-3.19.6/bin/protoc --proto_path submodules/spec/ --python_out . submodules/spec/secretflow/spec/v1/*.proto
Protocol Buffers resides at secretflow/protos.
~/protoc-3.19.6/bin/protoc --proto_path secretflow/protos/ --python_out . secretflow/protos/secretflow/spec/extend/*.proto
All generated Python code resides at secretflow/spec.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。