From bfd020da80c87a90db48c26e20167984dd82a7e5 Mon Sep 17 00:00:00 2001 From: William Bergamin Date: Tue, 28 Nov 2023 11:50:26 -0500 Subject: [PATCH] Adapt for python 3.6 --- .github/workflows/codecov.yml | 2 +- .github/workflows/tests.yml | 2 +- pyproject.toml | 4 ++-- requirements.txt | 1 + requirements/testing.txt | 3 ++- scripts/install_all_and_run_tests.sh | 8 +++++++- 6 files changed, 14 insertions(+), 6 deletions(-) create mode 100644 requirements.txt diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index 8bd1c1a48..4839962ef 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -26,8 +26,8 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install dependencies run: | - pip install . pip install -U pip + pip install . pip install -r requirements/async.txt pip install -r requirements/adapter.txt pip install -r requirements/testing.txt diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7e137386c..fcdc053b8 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -25,8 +25,8 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install dependencies run: | - pip install . pip install -U pip + pip install -r requirements.txt pip install -r requirements/testing_without_asyncio.txt - name: Run tests without aiohttp run: | diff --git a/pyproject.toml b/pyproject.toml index ffab492ee..0292636ef 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,11 +4,10 @@ build-backend = "setuptools.build_meta" [project] name = "slack_bolt" -dynamic = ["version", "readme"] +dynamic = ["version", "readme", "dependencies"] description = "The Bolt Framework for Python" license = { text = "MIT" } authors = [{ name = "Slack Technologies, LLC", email = "opensource@slack.com" }] -dependencies = ["slack_sdk>=3.25.0,<4"] classifiers = [ "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", @@ -33,6 +32,7 @@ include = ["slack_bolt*"] [tool.setuptools.dynamic] version = { attr = "slack_bolt.version.__version__" } readme = { file = ["README.md"], content-type = "text/markdown" } +dependencies = { file = ["requirements.txt"] } [tool.distutils.bdist_wheel] universal = true diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 000000000..4d4e8fe15 --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +slack_sdk>=3.25.0,<4 diff --git a/requirements/testing.txt b/requirements/testing.txt index 9593654a1..6fbcc045d 100644 --- a/requirements/testing.txt +++ b/requirements/testing.txt @@ -1,5 +1,6 @@ # pip install -r requirements/testing.txt -r testing_without_asyncio.txt -pytest-asyncio>=0.18.2,<1 +pytest-asyncio>=0.16.0; python_version=="3.6" +pytest-asyncio>=0.18.2,<1; python_version>"3.6" aiohttp>=3,<4 diff --git a/scripts/install_all_and_run_tests.sh b/scripts/install_all_and_run_tests.sh index 9e00bf4fa..c5da9647e 100755 --- a/scripts/install_all_and_run_tests.sh +++ b/scripts/install_all_and_run_tests.sh @@ -10,8 +10,14 @@ rm -rf ./slack_bolt.egg-info pip uninstall python-lambda test_target="$1" +python_version=`python --version | awk '{print $2}'` -pip install -e . +if [ ${python_version:0:3} == "3.6" ] +then + pip install -r requirements.txt +else + pip install -e . +fi if [[ $test_target != "" ]] then