Skip to content

Commit 6f369e4

Browse files
authored
Link to Contributor's Guide from README + expand Maintainer's Guide (#1071)
* Link to Contributor Guide from README. Expand Maintainer Guide with more details on virtual env setup. Mirror Maintainer Guide steps as closely to CI execution as possible. (#1070) * Remove env var prefixing from test run command
1 parent bd99038 commit 6f369e4

4 files changed

Lines changed: 35 additions & 27 deletions

File tree

.github/contributing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Issues labelled `good first contribution`.
3939
For your contribution to be accepted:
4040

4141
- [x] You must have signed the [Contributor License Agreement (CLA)](https://cla-assistant.io/slackapi/python-slack-sdk).
42-
- [x] The test suite must be complete and pass.
42+
- [x] The test suite must be complete and pass (see the [Maintainer's Guide](./maintainers_guide.md) for details on how to run the tests).
4343
- [x] The changes must be approved by code review.
4444
- [x] Commits should be atomic and messages must be descriptive. Related issues should be mentioned by Issue number.
4545

.github/maintainers_guide.md

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,30 +15,48 @@ $ brew update
1515
$ brew install pyenv
1616
```
1717

18-
Install necessary Python runtimes for development/testing. You can rely on Travis CI builds for testing with various major versions. https://github.com/slackapi/python-slack-sdk/blob/main/.travis.yml
18+
You can hook `pyenv` into your shell automatically by running `pyenv init` and following the instructions.
19+
20+
Install necessary Python runtimes for development/testing. It is not necessary
21+
to install all the various Python versions we test in [continuous integration on
22+
GitHub Actions](https://github.com/slackapi/python-slack-sdk/blob/main/.github/workflows/ci-build.yml),
23+
but make sure you are running at least one version that we execute our tests in
24+
locally so that you can run the tests yourself.
1925

2026
```bash
2127
$ pyenv install -l | grep -v "-e[conda|stackless|pypy]"
2228

23-
$ pyenv install 3.8.5 # select the latest patch version
24-
$ pyenv local 3.8.5
29+
$ pyenv install 3.9.6 # select the latest patch version
30+
$ pyenv local 3.9.6
2531

2632
$ pyenv versions
2733
system
2834
3.6.10
2935
3.7.7
30-
* 3.8.5 (set by /path-to-python-slack-sdk/.python-version)
36+
* 3.9.6 (set by /path-to-python-slack-sdk/.python-version)
3137

3238
$ pyenv rehash
3339
```
3440

35-
Then, you can create a new Virtual Environment this way:
41+
Then, you can create a new [Virtual Environment](https://docs.python.org/3/tutorial/venv.html) specific to the Python version you just installed by running:
3642

3743
```
38-
$ python -m venv env_3.8.5
39-
$ source env_3.8.5/bin/activate
44+
$ python -m venv env_3.9.6
45+
$ source env_3.9.6/bin/activate
4046
```
4147

48+
At this point you have a clean, Python-version-specific environment "activated" for
49+
use just for this project. All `python` and `pip` commands run in your shell
50+
from this point on run in the context of this virtual environment. You can
51+
deactivate the virtual environment by running `deactivate`; it is recommended to
52+
do so after you are done working in this project. To come back to development
53+
work for this project again in the future, `cd` into this project directory and
54+
run `source env_3.9.6/bin/activate` again.
55+
56+
The last step is to install this project's dependencies; to do so, check out [how
57+
we configure GitHub Actions to install dependencies for this project for use in
58+
our continuous integration](https://github.com/slackapi/python-slack-sdk/blob/main/.github/workflows/ci-build.yml#L26-L30). You can also run `./scripts/run_validation.sh` to install the dependencies and run the unit tests in one command!
59+
4260
## Tasks
4361

4462
### Testing (Unit Tests)
@@ -53,7 +71,7 @@ python setup.py validate \
5371
--test-target tests/web/test_web_client.py
5472
```
5573

56-
You can rely on Travis CI builds for running the tests on a variety of Python runtimes.
74+
You can rely on GitHub Actions builds for running the tests on a variety of Python runtimes.
5775

5876
### Testing (Integration Tests with Real Slack APIs)
5977

.travis.yml

Lines changed: 0 additions & 17 deletions
This file was deleted.

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ Are you looking for [slackclient](https://pypi.org/project/slackclient/)? The we
4848
* [Example](#example)
4949
* [Migrating from v1](#migrating-from-v1)
5050
* [Support](#support)
51+
* [Development](#development)
5152

5253
### Requirements
5354

@@ -138,7 +139,7 @@ except SlackApiError as e:
138139

139140
#### AsyncWebClient in a script
140141

141-
```python
142+
```python
142143
import asyncio
143144
import os
144145
from slack_sdk.web.async_client import AsyncWebClient
@@ -266,6 +267,12 @@ If you get stuck, we’re here to help. The following are the best ways to get a
266267
Use our [Github Issue Tracker][gh-issues] for reporting bugs or requesting features.
267268
Visit the [Slack Community][slack-community] for getting help using Slack Developer Kit for Python or just generally bond with your fellow Slack developers.
268269

270+
### Contributing
271+
272+
We welcome contributions from everyone! Please check out our
273+
[Contributor's Guide](.github/contributing.md) for how to contribute in a
274+
helpful and collaborative way.
275+
269276
<!-- Markdown links -->
270277

271278
[pypi-image]: https://badge.fury.io/py/slack-sdk.svg

0 commit comments

Comments
 (0)