forked from baidubce/app-builder
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'baidubce:master' into master
- Loading branch information
Showing
110 changed files
with
6,344 additions
and
2,354 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# rename this file to .env | ||
|
||
APPBUILDER_TOKEN=your-token | ||
APPBUILDER_TOKEN_V2=your-token | ||
BAIDU_VDB_API_KEY=your-token | ||
INSTANCE_ID=your-token | ||
DATASET_ID=your-token | ||
APPBUILDER_TOKEN_DOC_FORMAT=your-token |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
// Use IntelliSense to learn about possible attributes. | ||
// Hover to view descriptions of existing attributes. | ||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Python Debugger: Current File", | ||
"type": "debugpy", | ||
"request": "launch", | ||
"program": "${file}", | ||
"console": "integratedTerminal" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"python.testing.unittestArgs": [ | ||
"-v", | ||
"-s", | ||
"./appbuilder", | ||
"-p", | ||
"test*.py" | ||
], | ||
"python.testing.unittestEnabled": true, | ||
"python.envFile": "${workspaceFolder}/.env", | ||
"go.testFlags": [ | ||
"-v" | ||
], | ||
"go.testEnvFile": "${workspaceFolder}/.env", | ||
"go.toolsEnvVars": { | ||
"GOPATH": "${workspaceFolder}/go", | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
# Contributing to AppBuilder | ||
|
||
Thanks for your interest in contributing to AppBuilder! Please follow these guidelines to make the contribution process easy and effective for everyone involved. | ||
|
||
|
||
## Contributing Guide for python SDK | ||
|
||
### Development | ||
|
||
Clone the source code from Github | ||
|
||
``` | ||
git clone https://github.com/baidubce/app-builder.git | ||
``` | ||
|
||
Use `pip` to install from source | ||
|
||
```shell | ||
cd appbuilder | ||
pip install -e . | ||
``` | ||
|
||
`-e` means "editable mode" in pip. With "editable mode" all changes to python code will immediately become effective in the current environment. | ||
|
||
### Testing | ||
|
||
We highly recommend writing tests for new features or bug fixes and ensure all tests passing before submitting a PR. | ||
|
||
AppBuilder uses [unittest](https://docs.python.org/3/library/unittest.html) as the test framework, requires no 3rd party dependencies to install. | ||
|
||
Before running tests, make sure add the following environment variables: | ||
|
||
```shell | ||
export TEST_CASE=CPU_PARALLEL | ||
export APPBUILDER_TOKEN=<your_token> | ||
``` | ||
|
||
|
||
To run all existing test cases together, run | ||
|
||
``` | ||
pip install -e .[all] | ||
sh appbuilder/tests/run_python_test.sh | ||
``` | ||
|
||
If you only want to run specific test file, e.g.: | ||
|
||
``` | ||
python appbuilder/tests/test_playground.py | ||
``` | ||
|
||
|
||
To debug tests in vs code update .env file to roo folder of the project: | ||
``` | ||
APPBUILDER_TOKEN=<your-token> | ||
APPBUILDER_TOKEN_V2=<your-token> | ||
TEST_CASE=CPU_SERIAL | ||
``` | ||
|
||
and add/update `.vscode/settings.json` file with the following content: | ||
|
||
``` | ||
{ | ||
"python.testing.unittestArgs": [ | ||
"-v", | ||
"-s", | ||
"./appbuilder", | ||
"-p", | ||
"test*.py" | ||
], | ||
"python.testing.unittestEnabled": true, | ||
"python.envFile": "${workspaceFolder}/.env" | ||
} | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.