|
1 | | -# Deploy to test repository |
| 1 | +# Getting Started with The Project |
2 | 2 |
|
| 3 | +## Python Runtime Management |
| 4 | + |
| 5 | +We recommend using pyenv for Python runtime management. |
| 6 | + |
| 7 | +https://github.com/pyenv/pyenv |
| 8 | + |
| 9 | +If you use macOS, follow the following steps: |
| 10 | + |
| 11 | +```bash |
| 12 | +$ brew update |
| 13 | +$ brew install pyenv |
| 14 | +``` |
| 15 | + |
| 16 | +Then, install Python runtimes for this project: |
| 17 | + |
| 18 | +```bash |
| 19 | +$ pyenv install -l | grep -v "-e[conda|stackless|pypy]" |
| 20 | + |
| 21 | +$ pyenv install 3.8.5 |
| 22 | +$ pyenv local 3.8.5 |
| 23 | + |
| 24 | +$ pyenv versions |
| 25 | + system |
| 26 | + 3.6.10 |
| 27 | + 3.7.7 |
| 28 | +* 3.8.5 (set by /path-to-bolt-python/.python-version) |
| 29 | + |
| 30 | +$ pyenv rehash |
| 31 | +``` |
| 32 | + |
| 33 | +## Create a Virtual Environment |
| 34 | + |
| 35 | +``` |
| 36 | +$ python -m venv env_3.8.5 |
| 37 | +$ source env_3.8.5/bin/activate |
3 | 38 | ``` |
4 | | -# https://packaging.python.org/guides/using-testpypi/ |
5 | | -python -m venv env |
6 | | -source env/bin/activate |
7 | | -pip install --upgrade pip |
8 | | -pip install twine wheel |
9 | | -rm -rf dist/ build/ slack_bolt.egg-info/ && python setup.py sdist bdist_wheel |
10 | | -twine check dist/* |
11 | 39 |
|
12 | | -# Deploy to test repository |
13 | | -twine upload --repository testpypi dist/* |
14 | | -# Test installation |
15 | | -pip install -U --index-url https://test.pypi.org/simple/ slack_bolt |
| 40 | +## Run All the Tests |
| 41 | + |
| 42 | +```bash |
| 43 | +$ pip install -U pip |
| 44 | +$ python setup.py test # or ./scripts/run_tests.sh |
| 45 | +``` |
| 46 | + |
| 47 | +# Run the Samples |
| 48 | + |
| 49 | +```bash |
| 50 | +# Install all optional dependencies |
| 51 | +$ pip install -e ".[adapter]" |
| 52 | + |
| 53 | +$ cd samples/ |
| 54 | +$ export SLACK_SIGNING_SECRET=*** |
| 55 | +$ export SLACK_BOT_TOKEN=xoxb-*** |
| 56 | +$ python app.py |
| 57 | + |
| 58 | +# In another terminal |
| 59 | +$ ngrok http 3000 --subdomain {your-domain} |
| 60 | +``` |
| 61 | + |
| 62 | +# Deploying to test.pypi.org |
| 63 | + |
| 64 | +## $HOME/.pypirc |
| 65 | + |
| 66 | +``` |
| 67 | +[testpypi] |
| 68 | +username: {your username} |
| 69 | +password: {your password} |
| 70 | +``` |
| 71 | + |
| 72 | +## Run the Script |
| 73 | + |
| 74 | +```bash |
| 75 | +$ echo '__version__ = "{the version}"' > slack_bolt/version.py |
| 76 | +$ ./scripts/deploy_to_test_pypi_org.sh |
16 | 77 | ``` |
0 commit comments