-
Notifications
You must be signed in to change notification settings - Fork 835
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
661eeec
commit a136c51
Showing
15 changed files
with
153 additions
and
159 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,67 @@ | ||
# black project prefers pyproject.toml | ||
# that's why we have this file in addition to other setting files | ||
[build-system] | ||
requires = ["setuptools", "pytest-runner", "wheel"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[project] | ||
name = "slack_sdk" | ||
dynamic = ["version", "readme"] | ||
description = "The Slack API Platform SDK for Python" | ||
license = { text = "MIT" } | ||
authors = [{ name = "Slack Technologies, LLC", email = "[email protected]" }] | ||
requires-python = ">=3.6" | ||
keywords = [ | ||
"slack", | ||
"slack-api", | ||
"web-api", | ||
"slack-rtm", | ||
"websocket", | ||
"chat", | ||
"chatbot", | ||
"chatops", | ||
] | ||
classifiers = [ | ||
"Development Status :: 5 - Production/Stable", | ||
"Intended Audience :: Developers", | ||
"Topic :: Communications :: Chat", | ||
"Topic :: System :: Networking", | ||
"Topic :: Office/Business", | ||
"License :: OSI Approved :: MIT License", | ||
"Programming Language :: Python", | ||
"Programming Language :: Python :: 3", | ||
"Programming Language :: Python :: 3.6", | ||
"Programming Language :: Python :: 3.7", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"Programming Language :: Python :: 3.12", | ||
] | ||
|
||
|
||
[project.urls] | ||
homepage = "https://github.com/slackapi/python-slack-sdk" | ||
|
||
[tool.setuptools.packages.find] | ||
include = ["slack_bolt*", "slack*"] | ||
|
||
[tool.setuptools.dynamic] | ||
version = { attr = "slack_sdk.version.__version__" } | ||
readme = { file = ["README.md"], content-type = "text/markdown" } | ||
|
||
[tool.distutils.bdist_wheel] | ||
universal = true | ||
|
||
[tool.black] | ||
line-length = 125 | ||
line-length = 125 | ||
|
||
[tool.pytest.ini_options] | ||
testpaths = ["tests"] | ||
log_file = "logs/pytest.log" | ||
log_file_level = "DEBUG" | ||
log_format = "%(asctime)s %(levelname)s %(message)s" | ||
log_date_format = "%Y-%m-%d %H:%M:%S" | ||
filterwarnings = [ | ||
"ignore:\"@coroutine\" decorator is deprecated since Python 3.8, use \"async def\" instead:DeprecationWarning", | ||
"ignore:The loop argument is deprecated since Python 3.8, and scheduled for removal in Python 3.10.:DeprecationWarning", | ||
] | ||
asyncio_mode = "auto" |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# pip install -r requirements/optional.txt | ||
# async modules depend on aiohttp | ||
aiodns>1.0 | ||
# We recommend using 3.7.1+ for RTMClient | ||
# https://github.com/slackapi/python-slack-sdk/issues/912 | ||
aiohttp>=3.7.3,<4 | ||
# used only under slack_sdk/*_store | ||
boto3<=2 | ||
# InstallationStore/OAuthStateStore | ||
# Since v3.20, we no longer support SQLAlchemy 1.3 or older. | ||
# If you need to use a legacy version, please add our v3.19.5 code to your project. | ||
SQLAlchemy>=1.4,<3 | ||
# Socket Mode | ||
# websockets 9 is not compatible with Python 3.10 | ||
websockets>=9.1,<10; python_version=="3.6" | ||
websockets>=10,<11; python_version>"3.6" | ||
websocket-client>=1,<2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# pip install -r requirements/testing.txt | ||
pytest>=6.2.5,<7 | ||
pytest-asyncio<1 # for async | ||
Flask-Sockets>=0.2,<1 | ||
Flask>=1,<2 # TODO: Flask-Sockets is not yet compatible with Flask 2.x | ||
Werkzeug<2 # TODO: Flask-Sockets is not yet compatible with Flask 2.x | ||
itsdangerous==1.1.0 # TODO: Flask-Sockets is not yet compatible with Flask 2.x | ||
Jinja2==3.0.3 # https://github.com/pallets/flask/issues/4494 | ||
pytest-cov>=2,<3 | ||
flake8>=5,<6 | ||
# Don't change this version without running CI builds; | ||
# The latest version may not be available for older Python runtime | ||
black>=22.8.0; python_version=="3.6" | ||
black==22.10.0; python_version>"3.6" | ||
click==8.0.4 # black is affected by https://github.com/pallets/click/issues/2225 | ||
psutil>=5,<6 | ||
# used only under slack_sdk/*_store | ||
boto3<=2 | ||
moto>=3,<4 # For AWS tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
|
||
script_dir=`dirname $0` | ||
cd ${script_dir}/.. | ||
rm -rf ./slack_bolt.egg-info | ||
|
||
pip install -U pip && \ | ||
pip install twine build && \ | ||
rm -rf dist/ build/ slack_sdk.egg-info/ && \ | ||
python -m build --sdist --wheel && \ | ||
twine check dist/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,12 @@ | ||
#!/bin/bash | ||
|
||
python setup.py upload | ||
script_dir=`dirname $0` | ||
cd ${script_dir}/.. | ||
rm -rf ./slack_sdk.egg-info | ||
|
||
pip install -U pip && \ | ||
pip install twine build && \ | ||
rm -rf dist/ build/ slack_sdk.egg-info/ && \ | ||
python -m build --sdist --wheel && \ | ||
twine check dist/* && \ | ||
twine upload dist/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/bash | ||
|
||
script_dir=`dirname $0` | ||
cd ${script_dir}/.. | ||
rm -rf ./slack_sdk.egg-info | ||
|
||
pip install -U pip && \ | ||
pip install twine build && \ | ||
rm -rf dist/ build/ slack_sdk.egg-info/ && \ | ||
python -m build --sdist --wheel && \ | ||
twine check dist/* && \ | ||
twine upload --repository testpypi dist/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash | ||
|
||
pip uninstall -y slack-sdk && \ | ||
pip freeze | grep -v "^-e" | xargs pip uninstall -y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,18 @@ | ||
# -*- coding: utf-8 -*- | ||
import codecs | ||
import os | ||
import subprocess | ||
import sys | ||
from shutil import rmtree | ||
|
||
from setuptools import setup, find_packages, Command | ||
from setuptools import setup, Command | ||
|
||
here = os.path.abspath(os.path.dirname(__file__)) | ||
|
||
__version__ = None | ||
exec(open(f"{here}/slack_sdk/version.py").read()) | ||
|
||
long_description = "" | ||
with codecs.open(os.path.join(here, "README.md"), encoding="utf-8") as readme: | ||
long_description = readme.read() | ||
|
||
validate_dependencies = [ | ||
"pytest>=6.2.5,<7", | ||
"pytest-asyncio<1", # for async | ||
"Flask-Sockets>=0.2,<1", | ||
"Flask>=1,<2", # TODO: Flask-Sockets is not yet compatible with Flask 2.x | ||
"Werkzeug<2", # TODO: Flask-Sockets is not yet compatible with Flask 2.x | ||
"itsdangerous==1.1.0", # TODO: Flask-Sockets is not yet compatible with Flask 2.x | ||
"Jinja2==3.0.3", # https://github.com/pallets/flask/issues/4494 | ||
"pytest-cov>=2,<3", | ||
"flake8>=5,<6", | ||
# Don't change this version without running CI builds; | ||
# The latest version may not be available for older Python runtime | ||
"black==22.8.0", | ||
"click==8.0.4", # black is affected by https://github.com/pallets/click/issues/2225 | ||
"psutil>=5,<6", | ||
# used only under slack_sdk/*_store | ||
"boto3<=2", | ||
"moto>=3,<4", # For AWS tests | ||
] | ||
codegen_dependencies = [ | ||
# Don't change this version without running CI builds; | ||
# The latest version may not be available for older Python runtime | ||
"black==22.10.0", | ||
] | ||
|
||
needs_pytest = {"pytest", "test", "ptr"}.intersection(sys.argv) | ||
pytest_runner = ["pytest-runner"] if needs_pytest else [] | ||
|
||
|
||
class BaseCommand(Command): | ||
user_options = [] | ||
|
||
|
@@ -67,37 +35,6 @@ def _run(self, s, command): | |
sys.exit(error.returncode) | ||
|
||
|
||
class UploadCommand(BaseCommand): | ||
"""Support setup.py upload. Thanks @kennethreitz!""" | ||
|
||
description = "Build and publish the package." | ||
|
||
def run(self): | ||
self._run( | ||
"Installing upload dependencies ...", | ||
[sys.executable, "-m", "pip", "install", "wheel"], | ||
) | ||
try: | ||
self.status("Removing previous builds ...") | ||
rmtree(os.path.join(here, "dist")) | ||
rmtree(os.path.join(here, "build")) | ||
except OSError: | ||
pass | ||
|
||
self._run( | ||
"Building Source and Wheel (universal) distribution ...", | ||
[sys.executable, "setup.py", "sdist", "bdist_wheel", "--universal"], | ||
) | ||
self._run( | ||
"Installing Twine dependency ...", | ||
[sys.executable, "-m", "pip", "install", "twine"], | ||
) | ||
self._run( | ||
"Uploading the package to PyPI via Twine ...", | ||
[sys.executable, "-m", "twine", "upload", "dist/*"], | ||
) | ||
|
||
|
||
class CodegenCommand(BaseCommand): | ||
def run(self): | ||
self._run( | ||
|
@@ -210,7 +147,7 @@ def initialize_options(self): | |
def run(self): | ||
self._run( | ||
"Installing test dependencies ...", | ||
[sys.executable, "-m", "pip", "install"] + validate_dependencies, | ||
[sys.executable, "-m", "pip", "install", "-r", "requirements/testing.txt"], | ||
) | ||
self._run("Running black ...", [sys.executable, "-m", "black", f"{here}/slack"]) | ||
self._run("Running black ...", [sys.executable, "-m", "black", f"{here}/slack_sdk"]) | ||
|
@@ -281,78 +218,7 @@ def run(self): | |
|
||
|
||
setup( | ||
name="slack_sdk", | ||
version=__version__, | ||
description="The Slack API Platform SDK for Python", | ||
long_description=long_description, | ||
long_description_content_type="text/markdown", | ||
url="https://github.com/slackapi/python-slack-sdk", | ||
author="Slack Technologies, LLC", | ||
author_email="[email protected]", | ||
python_requires=">=3.6.0", | ||
include_package_data=True, | ||
license="MIT", | ||
classifiers=[ | ||
"Development Status :: 5 - Production/Stable", | ||
"Intended Audience :: Developers", | ||
"Topic :: Communications :: Chat", | ||
"Topic :: System :: Networking", | ||
"Topic :: Office/Business", | ||
"License :: OSI Approved :: MIT License", | ||
"Programming Language :: Python", | ||
"Programming Language :: Python :: 3", | ||
"Programming Language :: Python :: 3.6", | ||
"Programming Language :: Python :: 3.7", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"Programming Language :: Python :: 3.12", | ||
], | ||
keywords="slack slack-api web-api slack-rtm websocket chat chatbot chatops", | ||
packages=find_packages( | ||
exclude=[ | ||
"docs", | ||
"docs-src", | ||
"docs-v2", | ||
"docs-src-v2", | ||
"docs-v3", | ||
"docs-src-v3", | ||
"integration_tests", | ||
"integration_tests_legacy", | ||
"tests", | ||
"tests.*", | ||
"tutorial", | ||
] | ||
), | ||
install_requires=[], | ||
extras_require={ | ||
# pip install -e ".[testing]" | ||
"testing": validate_dependencies, | ||
# pip install -e ".[optional]" | ||
"optional": [ | ||
# async modules depend on aiohttp | ||
"aiodns>1.0", | ||
# We recommend using 3.7.1+ for RTMClient | ||
# https://github.com/slackapi/python-slack-sdk/issues/912 | ||
"aiohttp>=3.7.3,<4", | ||
# used only under slack_sdk/*_store | ||
"boto3<=2", | ||
# InstallationStore/OAuthStateStore | ||
# Since v3.20, we no longer support SQLAlchemy 1.3 or older. | ||
# If you need to use a legacy version, please add our v3.19.5 code to your project. | ||
"SQLAlchemy>=1.4,<3", | ||
# Socket Mode | ||
# websockets 9 is not compatible with Python 3.10 | ||
"websockets>=10,<11" if sys.version_info.minor > 6 else "websockets>=9.1,<10", | ||
"websocket-client>=1,<2", | ||
], | ||
}, | ||
setup_requires=pytest_runner, | ||
test_suite="tests", | ||
tests_require=validate_dependencies, | ||
cmdclass={ | ||
"upload": UploadCommand, | ||
"codegen": CodegenCommand, | ||
"validate": ValidateCommand, | ||
"unit_tests": UnitTestsCommand, | ||
|