You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1.[Create a virtual environment](#create-a-virtual-environment)
29
+
1.[Fork and clone the repository](#fork-and-clone-the-repository)
30
+
1.[Install XPK dev dependencies](#install-xpk-dev-dependencies)
31
+
1.[Make your change](#make-your-change)
32
+
1.[Verify change against checklist](#verify-change-against-checklist)
33
+
1.[Open a Pull Request](#open-a-pull-request)
29
34
30
-
0. <Optionallyneeded> Create a virtual environment:
35
+
### Create a virtual environment
31
36
32
-
Optionally use a venv to set up and develop xpk. This is needed for Google
37
+
Use a venv to set up and develop xpk. This is needed for Google
33
38
internal xpk development from a cloudtop machine.
34
39
35
40
```shell
@@ -41,59 +46,34 @@ python3 -m venv $VENV_DIR
41
46
source$VENV_DIR/bin/activate
42
47
```
43
48
44
-
1. Install developer tools including `pyink`, `pylint`, and `precommit` using
49
+
### Fork and clone the repository
45
50
51
+
All changes should be performed on your XPK fork, then proposed to the mainline repository through pull request process.
52
+
More about how to work with forks can be found [here](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo).
53
+
54
+
### Install XPK dev dependencies
55
+
56
+
Use the following script to install XPK python dependencies.
46
57
```shell
47
-
git clone https://github.com/google/xpk.git
48
-
cd xpk
49
58
pip install .[dev]
50
59
```
60
+
Also, follow [Prerequisites](https://github.com/AI-Hypercomputer/xpk?tab=readme-ov-file#prerequisites) section to ensure system dependencies are present on your machine.
51
61
52
-
2. Install git hook scripts.
53
-
```shell
54
-
pre-commit install
55
-
# Optionally run against files
56
-
pre-commit run --all-files
57
-
```
62
+
### Make your change
58
63
59
-
3. Support auto-formatting when committing changes!
60
-
```shell
61
-
# 1. Code will be autoformatted on:
62
-
git commit -m "My cool new feature"
63
-
# 2. If code needs to be reformatted, check what changes were made, and add them to the commit.
64
-
git add -p
65
-
# 3. Run git commit again, which should successfully pass pre-commit checks.
66
-
git commit -m "My cool new feature"
64
+
Make intended code change, cover it with unit tests and iterate on the code by executing local XPK version via `python3 xpk.py`.
67
65
66
+
### Verify change against checklist
68
67
69
-
# If you need, you can also manually format code by running:
70
-
pyink .
71
-
```
68
+
Before opening a pull request make sure your change passes the following checklist:
69
+
* Change is covered with unit tests.
70
+
* Goldens are up-to-date - regenerate them using `make goldens` command.
71
+
* Change is production ready, if not make sure it is covered with a feature flag. See sample flags [here](https://github.com/AI-Hypercomputer/xpk/blob/main/src/xpk/utils/feature_flags.py).
72
72
73
-
### Code Reviews
73
+
**Code merged to the main branch is expected to be released at any given point in time, hence it needs to be treated as a production code.**
74
+
75
+
### Open a Pull Request
74
76
75
77
All submissions, including submissions by project members, require review. We
76
78
use [GitHub pull requests](https://docs.github.com/articles/about-pull-requests)
77
79
for this purpose.
78
-
79
-
### Testing
80
-
Unit Tests for XPK coming soon.
81
-
82
-
### Code style
83
-
Before pushing your changes, you need to lint the code style via `pyink`. This
84
-
is handled through `pre-commit` if you have that installed.
0 commit comments