File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -63,47 +63,6 @@ Below is an example `/slack.json` file that overrides the default `start`:
6363}
6464```
6565
66- ## Development Scripts
67-
68- ### Quick Reference
69-
70- ``` bash
71- # Run tests with installation and formatting
72- ./scripts/install_and_run_tests.sh
73-
74- # Run tests with formatting (no install)
75- ./scripts/run_tests.sh
76-
77- # Run single test file
78- ./scripts/run_tests.sh tests/scenario_tests/test_app.py
79-
80- # Format code
81- ./scripts/format.sh
82-
83- # Lint code (format check + flake8)
84- ./scripts/lint.sh
85-
86- # Type check
87- ./scripts/run_mypy.sh
88-
89- # Install dependencies
90- ./scripts/install.sh
91-
92- # Build package
93- ./scripts/build_pypi_package.sh
94- ```
95-
96- ### Script Options
97-
98- Most scripts support ` --no-install ` flag to skip dependency installation:
99- ``` bash
100- ./scripts/format.sh --no-install
101- ./scripts/lint.sh --no-install
102- ./scripts/run_mypy.sh --no-install
103- ```
104-
105- This is useful in CI or when dependencies are already installed.
106-
10766## Contributing
10867
10968Contributions are always welcome! Please review the
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ set_prj_as_cwd () {
4+ script_dir=` dirname $0 `
5+ cd ${script_dir} /..
6+ }
7+
8+ clean_project () {
9+ rm -rf dist/ build/ slack_cli_hooks.egg-info/
10+ }
11+
12+ install_development_requirements () {
13+ pip install -U pip
14+ pip install -e .
15+ pip install -r requirements/testing.txt
16+ pip install -r requirements/format.txt
17+ }
18+
19+ build () {
20+ pip install -r requirements/build.txt && \
21+ python -m build && \
22+ twine check dist/*
23+ }
24+
25+ format () {
26+ black slack_cli_hooks/ tests/
27+ }
Original file line number Diff line number Diff line change 11#! /bin/bash
2+ source ./scripts/_utils.sh
23
3- script_dir=$( dirname " $0 " )
4- cd " ${script_dir} /.."
4+ set_prj_as_cwd
55
6- rm -rf dist/ build/ slack_cli_hooks.egg-info/
6+ clean_project
77
8- pip install -r requirements/build.txt && \
9- python -m build && \
10- twine check dist/*
8+ build
Original file line number Diff line number Diff line change 11#! /bin/bash
2+ source ./scripts/_utils.sh
23
3- script_dir=$( dirname " $0 " )
4- cd " ${script_dir} /.."
4+ set_prj_as_cwd
55
6- rm -rf dist/ build/ slack_cli_hooks.egg-info/
6+ clean_project
7+
8+ build
79
8- pip install -r requirements/build.txt && \
9- python -m build && \
10- twine check dist/* && \
1110twine upload --repository testpypi dist/*
Original file line number Diff line number Diff line change 11#! /bin/bash
2- # ./scripts/format .sh [--no-install]
2+ source ./scripts/_utils .sh
33
4- script_dir=$( dirname " $0 " )
5- cd " ${script_dir} /.."
4+ set_prj_as_cwd
65
7- if [[ " $1 " != " --no-install" ]]; then
8- export PIP_REQUIRE_VIRTUALENV=1
9- pip install -U pip
10- pip install -U -r requirements/format.txt
11- fi
6+ pip install -U pip
7+ pip install -r requirements/format.txt
128
13- black slack_cli_hooks/ tests/
9+ format
Original file line number Diff line number Diff line change 11#! /bin/bash
2+ source ./scripts/_utils.sh
23
3- script_dir=$( dirname " $0 " )
4- cd " ${script_dir} /.."
4+ set_prj_as_cwd
55
6- export PIP_REQUIRE_VIRTUALENV=1
7- pip install -U pip
8- pip install -U -e .
9- pip install -U -r requirements/testing.txt
10- pip install -U -r requirements/format.txt
6+ install_development_requirements
Original file line number Diff line number Diff line change 11#! /bin/bash
2- # Run all the tests or a single test with installation
32# all: ./scripts/install_and_run_tests.sh
43# single: ./scripts/install_and_run_tests.sh tests/scenario_tests/test_app.py
54
6- script_dir=$( dirname " $0 " )
7- cd " ${script_dir} /.."
8-
95test_target=" $1 "
6+ source ./scripts/_utils.sh
7+
8+ set_prj_as_cwd
9+
10+ install_development_requirements
1011
11- ./scripts/install.sh
12- ./scripts/format.sh --no-install
13- ./scripts/lint.sh --no-install
12+ format
1413
15- if [[ " $test_target " != " " ]]
14+ if [[ $test_target != " " ]]
1615then
17- pytest -vv " $test_target "
16+ pytest -vv $1
1817else
19- pytest
18+ pytest && \
19+ mypy --config-file pyproject.toml
2020fi
Original file line number Diff line number Diff line change 11#! /bin/bash
2- # ./scripts/lint.sh [--no-install]
32
4- script_dir=$( dirname " $0 " )
5- cd " ${script_dir} /.."
3+ source ./scripts/_utils.sh
64
7- if [[ " $1 " != " --no-install" ]]; then
8- export PIP_REQUIRE_VIRTUALENV=1
9- pip install -U pip
10- pip install -U -r requirements/format.txt
11- fi
5+ set_prj_as_cwd
126
13- black --check slack_cli_hooks/ tests/
14- flake8 slack_cli_hooks/ tests/
7+ pip install -U pip
8+ pip install -r requirements/format.txt
9+
10+ flake8 slack_cli_hooks/ && flake8 tests/
Original file line number Diff line number Diff line change 11#! /bin/bash
2- # ./scripts/run_mypy.sh [--no-install]
32
4- script_dir=$( dirname " $0 " )
5- cd " ${script_dir} /.."
3+ source ./scripts/_utils.sh
64
7- if [[ " $1 " != " --no-install " ]] ; then
8- ./scripts/install.sh
9- fi
5+ set_prj_as_cwd
6+
7+ install_development_requirements
108
119mypy --config-file pyproject.toml
Original file line number Diff line number Diff line change 11#! /bin/bash
2- # Run all the tests or a single test
32# all: ./scripts/run_tests.sh
43# single: ./scripts/run_tests.sh tests/scenario_tests/test_app.py
54
6- script_dir=$( dirname " $0 " )
7- cd " ${script_dir} /.."
8-
95test_target=" $1 "
6+ source ./scripts/_utils.sh
7+
8+ set_prj_as_cwd
109
11- ./scripts/ format.sh --no-install
10+ format
1211
13- if [[ " $test_target " != " " ]]
12+ if [[ $test_target != " " ]]
1413then
15- pytest -vv " $test_target "
14+ pytest -vv $1
1615else
1716 pytest
1817fi
You can’t perform that action at this time.
0 commit comments