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
[](https://www.starburst.io/info/oreilly-trino-guide/)
9
9
10
+
## Development
11
+
12
+
See [DEVELOPMENT](.github/DEVELOPMENT.md) for information about code style,
13
+
development process, and guidelines.
14
+
10
15
## Usage
11
16
12
17
### The Python Database API (DBAPI)
@@ -412,95 +417,6 @@ assert rows[0][0] == params
412
417
assert cur.description[0][1] =="timestamp with time zone"
413
418
```
414
419
415
-
# Development
416
-
417
-
## Getting started with development
418
-
419
-
Start by forking the repository and then modify the code in your fork.
420
-
421
-
We recommend that you use Python3's `venv` for development:
422
-
423
-
```
424
-
$ python3 -m venv .venv
425
-
$ . .venv/bin/activate
426
-
$ pip install -e '.[tests]'
427
-
```
428
-
429
-
With `-e` passed to `pip install` above pip can reference the code you are
430
-
modifying in the *virtual env*. That way, you do not need to run `pip install`
431
-
again to make your changes applied to the *virtual env*.
432
-
433
-
When the code is ready, submit a Pull Request.
434
-
435
-
### Code style
436
-
437
-
- For Python code, adhere to PEP8.
438
-
- Prefer code that is readable over one that is"clever".
439
-
- When writing a Git commit message, follow these [guidelines](https://chris.beams.io/posts/git-commit/).
440
-
441
-
See also Trino's [guidelines](https://github.com/trinodb/trino/blob/master/.github/DEVELOPMENT.md).
442
-
Most of them also apply to code in trino-python-client.
443
-
444
-
### Running tests
445
-
446
-
`trino-python-client` uses [pytest](https://pytest.org/) for its tests. To run
447
-
only unit tests, type:
448
-
449
-
```
450
-
$ pytest tests/unit
451
-
```
452
-
453
-
Then you can pass options like `--pdb`or anything supported by `pytest --help`.
454
-
455
-
To run integration tests:
456
-
457
-
```
458
-
$ pytest tests/integration
459
-
```
460
-
461
-
They pull a Docker image and then run a container with a Trino server:
462
-
- the image is named `trinodb/trino:${TRINO_VERSION}`
463
-
- the container is named `trino-python-client-tests-{uuid4()[:7]}`
464
-
465
-
To run the tests with different versions of Python in managed *virtual envs*,
466
-
use `tox` (see the configuration in`tox.ini`):
467
-
468
-
```
469
-
$ tox
470
-
```
471
-
472
-
## Releasing
473
-
474
-
- [Set up your development environment](#Getting-Started-With-Development).
475
-
- Check the local workspace is up to date and has no uncommitted changes
476
-
```bash
477
-
git fetch -a && git status
478
-
```
479
-
- Change version in`trino/__init__.py` to a new version, e.g. `0.123.0`.
480
-
- Commit
481
-
```bash
482
-
git commit -a -m "Bump version to 0.123.0"
483
-
```
484
-
- Create an annotated tag
485
-
```bash
486
-
git tag -m ""0.123.0
487
-
```
488
-
- Create release package and upload it to PyPI
489
-
```bash
490
-
. .venv/bin/activate && \
491
-
pip install twine wheel setuptools && \
492
-
rm -rf dist/&& \
493
-
./setup.py sdist bdist_wheel && \
494
-
twine upload dist/*&& \
495
-
open https://pypi.org/project/trino/&& \
496
-
echo "Released!"
497
-
```
498
-
- Push the branch and the tag
499
-
```bash
500
-
git push upstream master 0.123.0
501
-
```
502
-
- Send release announcement on the *#python-client* channel on [Trino Slack][trino-slack].
503
-
504
420
# Need help?
505
421
506
422
Feel free to create an issue as it makes your request visible to other users and contributors.
0 commit comments