Skip to content

Commit 8ded8a4

Browse files
committed
Inline relevant information from Trino's DEVELOPMENT.md
Most of the information on Trino's DEVELOPMENT.md doesn't apply to Python and leads to confusion.
1 parent f271da0 commit 8ded8a4

File tree

1 file changed

+56
-14
lines changed

1 file changed

+56
-14
lines changed

.github/DEVELOPMENT.md

Lines changed: 56 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
# Development
22

3-
## Getting started with development
3+
Developers should read [the development section of the website](https://trino.io/development),
4+
which covers things like development philosophy and contribution process.
5+
6+
* [Commits and pull requests](#commits-and-pull-requests)
7+
* [Code style](#code-style)
8+
9+
## Getting started
410

511
Start by forking the repository and then modify the code in your fork.
612

@@ -16,18 +22,7 @@ With `-e` passed to `pip install` above pip can reference the code you are
1622
modifying in the *virtual env*. That way, you do not need to run `pip install`
1723
again to make your changes applied to the *virtual env*.
1824

19-
When the code is ready, submit a Pull Request.
20-
21-
### Code style
22-
23-
- For Python code, adhere to PEP 8.
24-
- Prefer code that is readable over one that is "clever".
25-
- When writing a Git commit message, follow these [guidelines](https://chris.beams.io/posts/git-commit/).
26-
27-
See also Trino's [guidelines](https://github.com/trinodb/trino/blob/master/.github/DEVELOPMENT.md).
28-
Most of them also apply to code in trino-python-client.
29-
30-
### Running tests
25+
## Running tests
3126

3227
`trino-python-client` uses [pytest](https://pytest.org/) for its tests. To run
3328
only unit tests, type:
@@ -55,6 +50,54 @@ use `tox` (see the configuration in `tox.ini`):
5550
$ tox
5651
```
5752

53+
When the code is ready, submit a Pull Request.
54+
55+
## Commits and pull requests
56+
57+
See [Commits and pull requests](https://github.com/trinodb/trino/blob/master/.github/DEVELOPMENT.md#commits-and-pull-requests) section from Trino.
58+
59+
## Code style
60+
61+
To run linting and formatting checks before opening a PR: `#TODO - fill this in`
62+
63+
In addition to that you should also adhere to the following:
64+
65+
### Readability
66+
67+
Prefer code that is readable over one that is "clever". The purpose of code
68+
style rules is to maintain code readability and developer efficiency when
69+
working with the code. All the code style rules explained below are good
70+
guidelines to follow but there may be exceptional situations where we
71+
purposefully depart from them. When readability and code style rule are at
72+
odds, the readability is more important.
73+
74+
### Consistency
75+
76+
Keep code consistent with surrounding code where possible.
77+
78+
### Avoid mocks where possible
79+
80+
Do not use mocking libraries. These libraries encourage testing specific call
81+
sequences, interactions, and other internal behavior, which we believe leads to
82+
fragile tests. They also make it possible to mock complex interfaces or
83+
classes, which hides the fact that these classes are not (easily) testable. We
84+
prefer to write mocks by hand, which forces code to be written in a certain
85+
testable style.
86+
87+
We also acknowledge that there is existing code which uses mocks but that
88+
should not be taken as a reason increase reliance on mocks.
89+
90+
### Maintain production quality for test code
91+
92+
Maintain the same quality for production and test code.
93+
94+
### Avoid abbreviations
95+
96+
Please avoid abbreviations, slang or inside jokes as this makes harder for
97+
non-native english speaker to understand the code. Very well known
98+
abbreviations like `max` or `min` and ones already very commonly used across
99+
the code base like `ttl` are allowed and encouraged.
100+
58101
## Releasing
59102

60103
- [Set up your development environment](#Getting-Started-With-Development).
@@ -86,4 +129,3 @@ $ tox
86129
git push upstream master 0.123.0
87130
```
88131
- Send release announcement on the *#python-client* channel on [Trino Slack][trino-slack].
89-

0 commit comments

Comments
 (0)