Skip to content

Commit ad3edb2

Browse files
authored
Update contributing instructions (#4)
* chore: update contributing instructions * fix: update contributing based on PR feedback
1 parent df3a48d commit ad3edb2

File tree

1 file changed

+65
-129
lines changed

1 file changed

+65
-129
lines changed

CONTRIBUTING.md

Lines changed: 65 additions & 129 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,78 @@
11
# Contributing to F5 AI Gateway Processor SDK
2+
23
We want to make contributing to this project as easy and transparent as
34
possible.
45

5-
## [Code of Conduct]
6+
## Code of Conduct
67

78
F5 has adopted a Code of Conduct that we expect project participants to adhere
89
to. Please read [the full text](CODE_OF_CONDUCT.md) so that you can understand
910
what actions will and will not be tolerated.
1011

11-
## Our Development Process
12+
## Our development process
13+
14+
### General philosophies
15+
16+
- The project uses python3.11 or higher and [uv](https://docs.astral.sh/uv/getting-started/installation/)
17+
- Python code should conform to the
18+
[PEP-8 style guidelines](https://www.python.org/dev/peps/pep-0008/)
19+
whenever possible, and formatted using `make fmt`.
20+
- Where feasible, include unit tests.
21+
- Tests should make use of the fixtures and tools available in the project.
22+
- Code should pass `make lint` with no warnings.
23+
24+
### Getting started
25+
26+
> **Note**
27+
>
28+
> For easier dependency management, [mise](https://mise.jdx.dev/) or [asdf](https://asdf-vm.com/) will use [.tool-versions](./.tool-versions) to automatically ensure you have the correct versions of python and uv
29+
30+
### Install Python dependencies
31+
32+
```bash
33+
make deps
34+
```
35+
36+
### Linting code
37+
38+
```bash
39+
make lint
40+
```
41+
42+
### Formatting code
43+
44+
```bash
45+
make lint
46+
```
47+
48+
### Executing tests
49+
50+
```bash
51+
make test
52+
```
53+
54+
## Report a bug
55+
56+
To report a bug, open an issue on GitHub and choose the type 'Bug report'. Please ensure the issue has not already been reported, and that you fill in the template as provided, as this can reduce turnaround time.
57+
58+
## Suggest a new feature or other improvement
1259

13-
[OUTLINE OF DEVELOPMENT PROCESS]
60+
To suggest an new feature or other improvement, create an issue on Github and choose the type 'Feature request'. Please fill in the template as provided.
61+
62+
## Pull requests
1463

15-
## Pull Requests
1664
We actively welcome your pull requests.
1765

66+
Before working on a pull request which makes significant change, consider opening an associated issue describing the proposed change. This allows the core development team to discuss the potential pull request with you before you do the work.
67+
1868
1. Fork the repo and create your branch from `main`.
1969
2. If you've added code that should be tested, add tests.
2070
3. If you've changed APIs, update the documentation.
2171
4. Ensure the test suite passes.
22-
5. Make sure your code lints.
72+
- This can be done with `make test`
73+
5. Ensure code lints and is formatted correctly.
74+
- This can be done with `make fmt` and `make lint`
75+
- `make lint.fix` will attempt to resolve linting issues.
2376
6. If you haven't already, complete the Contributor License Agreement ("CLA").
2477

2578
## Contributor License Agreement ("CLA")
@@ -32,132 +85,15 @@ agree to the F5 CLA. You will have to agree to the F5 CLA terms through a commen
3285
can be merged. Your agreement signature will be safely stored by F5 and no longer be required in future PRs.
3386

3487
## License
88+
3589
By contributing to F5 AI Gateway Processor SDK, you agree that your contributions will be licensed
3690
its Apache Version 2.0 license. Copy and paste this to the top of your new file(s):
3791

38-
<<<<<<< HEAD
39-
```js
40-
/**
41-
* Copyright (c) F5, Inc.
42-
*
43-
* This source code is licensed under the Apache License Version 2.0 found in the
44-
* LICENSE file in the root directory of this source tree.
45-
*/
46-
=======
47-
### Report a Bug
48-
49-
To report a bug, open an issue on GitHub with the label `bug` using the
50-
available bug report issue template. Please ensure the issue has not already
51-
been reported.
52-
53-
### Suggest an Enhancement
54-
55-
To suggest an enhancement, please create an issue on GitHub with the label
56-
`enhancement` using the available feature issue template.
57-
58-
### Open a Pull Request
59-
60-
* Fork the repo, create a branch, submit a PR when your changes are tested and
61-
ready for review.
62-
* Fill in [our pull request template](/.github/PULL_REQUEST_TEMPLATE.md)
63-
64-
Note: if you’d like to implement a new feature, please consider creating a
65-
feature request issue first to start a discussion about the feature.
66-
67-
## Style Guides
68-
69-
### Git Style Guide
70-
71-
* Keep a clean, concise and meaningful git commit history on your branch,
72-
rebasing locally and squashing before submitting a PR
73-
* Use the
74-
[Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) format
75-
when writing a commit message, so that changelogs can be automatically
76-
generated
77-
* Follow the guidelines of writing a good commit message as described
78-
[here](https://chris.beams.io/posts/git-commit/) and summarised in the next
79-
few points
80-
* In the subject line, use the present tense
81-
("Add feature" not "Added feature")
82-
* In the subject line, use the imperative mood ("Move cursor to..." not
83-
"Moves cursor to...")
84-
* Limit the subject line to 72 characters or fewer
85-
* Reference issues and pull requests liberally after the subject line
86-
* Add more detailed description in the body of the git message (
87-
`git commit -a` to give you more space and time in your text editor to
88-
write a good message instead of `git commit -am`)
89-
90-
### Code Style Guide
91-
92-
* Python code should conform to the
93-
[PEP-8 style guidelines](https://www.python.org/dev/peps/pep-0008/)
94-
whenever possible.
95-
* Where feasible, include unit tests.
96-
* Code should pass `ruff check` with no warnings.
97-
98-
## Development Workflow
99-
100-
*General philosophies:*
101-
102-
* Recommended [to use uv](https://docs.astral.sh/uv/getting-started/installation/)
103-
* Requires python3.11 or higher
104-
* Tests should make use of the testing fixtures and tools on offer
105-
106-
### Getting Started
92+
```python
93+
"""
94+
Copyright (c) F5, Inc.
10795
108-
[mise](https://mise.jdx.dev/) or [asdf](https://asdf-vm.com/) which will use [.tool-versions](./.tool-versions) to automatically ensure you have the correct versions
109-
110-
*For macOS:*
111-
```bash
112-
make deps
113-
```
114-
115-
### Lint Checks
116-
117-
[Depend upon `ruff`](https://github.com/astral-sh/ruff), and can be executed with the following command:
118-
```bash
119-
make lint
120-
```
121-
122-
This fast, lightweight tool handles the linting operations very quickly and efficiently and is performed within the pipeline.
123-
124-
### Executing Tests
125-
126-
```bash
127-
make test
128-
```
129-
130-
*Troubleshooting:*
131-
When discovering the following error:
132-
```
133-
____________________________________________________________________________________________________ ERROR collecting tests/test_processor.py _____________________________________________________________________________________________________
134-
tests/test_processor.py:16: in <module>
135-
from f5_ai_gateway_sdk.processor import Result, Processor, SYSTEM_INFO
136-
src/f5_ai_gateway_sdk/processor.py:23: in <module>
137-
SYSTEM_INFO = system_info()
138-
src/f5_ai_gateway_sdk/sysinfo.py:50: in system_info
139-
"host": host_info(),
140-
src/f5_ai_gateway_sdk/sysinfo.py:18: in host_info
141-
"ip": socket.gethostbyname(socket.gethostname()),
142-
E socket.gaierror: [Errno 8] nodename nor servname provided, or not known
143-
_________________________________________________________________________________________________ ERROR collecting tests/test_processor_routes.py _________________________________________________________________________________________________
144-
tests/test_processor_routes.py:4: in <module>
145-
from f5_ai_gateway_sdk.processor import Processor
146-
src/f5_ai_gateway_sdk/processor.py:23: in <module>
147-
SYSTEM_INFO = system_info()
148-
src/f5_ai_gateway_sdk/sysinfo.py:50: in system_info
149-
"host": host_info(),
150-
src/f5_ai_gateway_sdk/sysinfo.py:18: in host_info
151-
"ip": socket.gethostbyname(socket.gethostname()),
152-
E socket.gaierror: [Errno 8] nodename nor servname provided, or not known
153-
```
154-
Or similar, please copy the contents of your `hostname`, on the macOS, that's:
155-
```bash
156-
hostname | pdcopy
157-
```
158-
And add it to your `/etc/hosts` file with `127.0.0.1` as `localhost` to reflect something similar to:
159-
```
160-
127.0.0.1 $(hostname)
96+
This source code is licensed under the Apache License Version 2.0 found in the
97+
LICENSE file in the root directory of this source tree.
98+
"""
16199
```
162-
[For more on why this is necessary](https://stackoverflow.com/questions/39970606/gaierror-errno-8-nodename-nor-servname-provided-or-not-known-with-macos-sie) for `starlette`.
163-
>>>>>>> main

0 commit comments

Comments
 (0)