Skip to content

Commit 8e24ba7

Browse files
suiiibhitgodlygeek
andcommitted
docs: Add Codespaces setup to CONTRIBUTING.md
Additionally, configure `prek` hooks in Codespaces. Signed-off-by: suiiibhit <shubhitsaxena2005@gmail.com> Co-authored-by: Matt Wozniski <godlygeek@gmail.com>
1 parent 178a765 commit 8e24ba7

2 files changed

Lines changed: 35 additions & 1 deletion

File tree

.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
"dockerfile": "../Dockerfile"
66
},
77
"runArgs": ["--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined"],
8-
"onCreateCommand": "pip install -e ."
8+
"onCreateCommand": "pip install -e . && prek install"
99
}

CONTRIBUTING.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,40 @@ You can also search this project for issues with the following labels:
1111
| [help wanted](https://github.com/bloomberg/pystack/search?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22+&type=Issues&utf8=%E2%9C%93) | `is:issue is:open label:"help wanted"` | General issues where contributors help is wanted. |
1212
| [question](https://github.com/bloomberg/pystack/search?q=is%3Aissue+is%3Aopen+label%3Aquestion&type=Issues&utf8=%E2%9C%93) | `is:issue is:open label:question` | Open discussions to resolve everything from implementation details to desired functionality. |
1313

14+
## Setting up a development environment
15+
16+
### GitHub Codespaces
17+
18+
The repository ships with a dev container configuration that works with
19+
[GitHub Codespaces](https://github.com/features/codespaces). You can open
20+
a ready-to-use environment directly:
21+
22+
[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/bloomberg/pystack)
23+
24+
Once the codespace is ready, all dependencies will be installed and hooks
25+
will be configured automatically.
26+
27+
Note that the dev container is built from the project's `Dockerfile`, which
28+
compiles `elfutils` from source, so the first build takes a few minutes.
29+
30+
pystack requires elevated ptrace permissions to inspect processes — the dev
31+
container already handles this via `--cap-add=SYS_PTRACE` and
32+
`seccomp=unconfined`, so things should work out of the box.
33+
34+
### Local setup
35+
36+
You'll need Linux with `libdw`, `libelf`, CMake, and a C++ compiler (Clang or
37+
GCC). Then:
38+
39+
```shell
40+
git clone https://github.com/bloomberg/pystack.git pystack
41+
cd pystack
42+
python3 -m venv ../pystack-env/
43+
source ../pystack-env/bin/activate
44+
pip install -e . -r requirements-test.txt -r requirements-extra.txt
45+
prek install
46+
```
47+
1448
## Contribution Licensing
1549

1650
Since this project is distributed under the terms of an [open source license](LICENSE),

0 commit comments

Comments
 (0)