551 . python3
662 . pip
773 . virtualenv
8- ``` shell
9- pip install virtualenv
10- ```
8+ ``` shell
9+ pip install virtualenv
10+ ```
1111
1212# # Steps to setup dev environment
1313
14141. Create a python3 virtual environment
15- ``` shell
16- virtualenv .venv -p python3
17- ```
15+ ` ` ` shell
16+ virtualenv .venv -p python3
17+ ` ` `
18182. Activate the virtual environment created in step 1
19- ``` shell
20- source .venv/bin/activate
21- ```
19+ ` ` ` shell
20+ source .venv/bin/activate
21+ ` ` `
22223. Install ` setuptools` to package code and ` black` to format python code
23- ``` shell
24- pip install setuptools black
25- ```
23+ ` ` ` shell
24+ pip install setuptools black
25+ ` ` `
26264. Install libraries in file requirements.txt
27- ``` shell
28- pip install -r requirements.txt
29- ```
27+ ` ` ` shell
28+ pip install -r requirements.txt
29+ ` ` `
3030
3131# # Steps to test code in local
3232
33331. Run ` black` command to format code
34- ``` shell
35- black -S .
36- ```
34+ ` ` ` shell
35+ black -S .
36+ ` ` `
37372. Run command to test script
38- ``` shell
39- python src/aito.py
40- ```
38+ ` ` ` shell
39+ python src/aito.py
40+ ` ` `
4141
4242# # Steps to install the CLI to virtual environment and test it
4343
44441. Run command to install CLI
45- ``` shell
46- pip install -e .
47- ```
45+ ` ` ` shell
46+ pip install -e .
47+ ` ` `
48482. Verify the CLI
49- ``` shell
50- which aito
51- ```
49+ ` ` ` shell
50+ which aito
51+ ` ` `
52523. Run ` aito` command
53- ``` shell
54- aito
55- ```
53+ ` ` ` shell
54+ aito
55+ ` ` `
5656
5757# # Steps to package and distribute CLI to TestPyPI
5858
59591. Install ` build` to generate distribution packages and ` twine` to distribute package to PyPI
60- ``` shell
61- pip install build twine
62- ```
60+ ` ` ` shell
61+ pip install build twine
62+ ` ` `
63632. Run ` build` command as the root folder, where file ` pyproject.toml` is located
64- ``` shell
65- rm -rf dist
66- python -m build
67- ```
68- After that command, we will have ` tar.gz ` and ` .whl ` files in ` dist ` folder
64+ ` ` ` shell
65+ rm -rf dist
66+ python -m build
67+ ` ` `
68+ After that command, we will have ` tar.gz` and ` .whl` files in ` dist` folder
6969
70703. Register an account in TestPyPI and create an API token with ` Entire account` scope
71714. Using twine to upload the distribution packages created in step 2 to TestPyPI
72- ``` shell
73- twine upload --repository testpypi --skip-existing dist/*
74- ```
75- ` --repository ` used to choose upload to PyPI or TestPyPI, ` --skip-existing ` if we want to distribute further versions of the cli.
72+ ` ` ` shell
73+ twine upload --repository testpypi --skip-existing dist/*
74+ ` ` `
75+ ` --repository` used to choose upload to PyPI or TestPyPI, ` --skip-existing` if we want to distribute further versions of the cli.
7676
77- You will be prompted for a username and password. For the username, use __ token__ . For the password, use the token value, including the pypi- prefix.
77+ You will be prompted for a username and password. For the username, use __token__. For the password, use the token value, including the pypi- prefix.
78785. Using another virtual environment and install the ` aitomatic-cli` using pip to verify that it works
79- ``` shell
80- deactivate
81- virtualenv .venv-test -p python3
82- source .venv-test/bin/activate
83- pip install -i https://test.pypi.org/simple/ aitomatic
84- ```
79+ ` ` ` shell
80+ deactivate
81+ virtualenv .venv-test -p python3
82+ source .venv-test/bin/activate
83+ pip install -i https://test.pypi.org/simple/ aitomatic
84+ ` ` `
8585
8686# # Steps to package and distribute CLI to PyPI
8787
@@ -92,13 +92,13 @@ Similar to steps to distribute to TestPyPI, except:
9292# # Temporary: If the deploy command failed due to change in service api. Update api base:
9393
94941. Clone https://github.com/aitomatic/ai-cloud
95- 2 . Follow instruction and select dev stack
95+ 2. Follow instruction in ` infrastructure/DEVELOPING.md ` and select ` dev` stack
96963. Get the service host name
97- ``` shell
98- pulumi stack select dev
99- pulumi stack output kodaServiceHostname
100- ` ` `
97+ ` ` ` shell
98+ pulumi stack select dev
99+ pulumi stack output kodaServiceHostname
100+ ` ` `
1011014. Set AI_CLI_API_BASE env var to
102- ` ` ` shell
103- export AI_CLI_API_BASE = " http://" + < hostname from step 3>
104- ` ` `
102+ ` ` ` shell
103+ export AI_CLI_API_BASE = " http://" + < hostname from step 3>
104+ ` ` `
0 commit comments