Skip to content

Commit e230b07

Browse files
committed
initial commit
0 parents  commit e230b07

File tree

17 files changed

+1064
-0
lines changed

17 files changed

+1064
-0
lines changed

.gitignore

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Byte-compiled / optimized / DLL filesA
2+
__pycache__/
3+
*.py[cod]
4+
5+
# C extensions
6+
*.so
7+
8+
# Distribution / packaging
9+
.Python
10+
env/
11+
bin/
12+
build/
13+
develop-eggs/
14+
dist/
15+
eggs/
16+
lib/
17+
lib64/
18+
parts/
19+
sdist/
20+
var/
21+
*.egg-info/
22+
.installed.cfg
23+
*.egg
24+
include/
25+
26+
# Installer logs
27+
pip-log.txt
28+
pip-delete-this-directory.txt
29+
30+
# Unit test / coverage reports
31+
htmlcov/
32+
.tox/
33+
.coverage
34+
.cache
35+
nosetests.xml
36+
coverage.xml
37+
38+
# Translations
39+
*.mo
40+
41+
# Mr Developer
42+
.mr.developer.cfg
43+
.project
44+
.pydevproject
45+
46+
# Rope
47+
.ropeproject
48+
49+
# Django stuff:
50+
*.log
51+
*.pot
52+
53+
# Sphinx documentation
54+
docs/_build/
55+
56+
secrets.*sh
57+
.idea
58+
59+
.venv
60+
pip-selfcheck.json
61+
.idea
62+
63+
*,cover
64+
.eggs

.travis.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
language: python
2+
python:
3+
- 3.6
4+
- 3.7
5+
6+
cache: pip
7+
8+
install:
9+
- pip install black
10+
- pip install pycodestyle
11+
12+
script:
13+
- echo $STREAM_KEY
14+
- python setup.py test
15+
16+
after_script:
17+
- "black stream_chat"
18+
- "pycodestyle --ignore=E501,E225,W293 stream_chat"
19+
- "python setup.py install"
20+
- "codecov"

CHANGELOG

Whitespace-only changes.

LICENSE

Whitespace-only changes.

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
include README.md

README.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# stream-chat-python
2+
3+
[![Build Status](https://travis-ci.com/GetStream/stream-chat-python.svg?token=WystDPP9vxKnwsd8NwW1&branch=master)](https://travis-ci.com/GetStream/stream-chat-python)
4+
5+
stream-chat-python is the official Python client for Stream chat.
6+
7+
### Installation
8+
9+
stream-python supports:
10+
11+
- Python (3.4, 3.5, 3.6, 3.7)
12+
13+
#### Install from Pypi
14+
15+
```bash
16+
pip install stream-chat
17+
```
18+
19+
### Contributing
20+
21+
First, make sure you can run the test suite. Tests are run via py.test
22+
23+
```bash
24+
STREAM_KEY=my_api_key STREAM_SECRET=my_api_secret py.test stream_chat/ -v
25+
```
26+
27+
Install black and pycodestyle
28+
29+
```
30+
pip install pycodestyle
31+
pip install pycodestyle
32+
```
33+
34+
35+
### Releasing a new version
36+
37+
In order to release new version you need to be a maintainer on Pypi.
38+
39+
- Update CHANGELOG
40+
- Make sure you have twine installed (pip install twine)
41+
- Update the version on setup.py
42+
- Commit and push to Github
43+
- Create a new tag for the version (eg. `v2.9.0`)
44+
- Create a new dist with python `python setup.py sdist`
45+
- Upload the new distributable with wine `twine upload dist/stream-chat-VERSION-NAME.tar.gz`
46+
47+
If unsure you can also test using the Pypi test servers `twine upload --repository-url https://test.pypi.org/legacy/ dist/stream-chat-VERSION-NAME.tar.gz`

pyproject.toml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
[tool.black]
2+
line-length = 88
3+
py36 = true
4+
include = '\.pyi?$'
5+
exclude = '''
6+
/(
7+
\.git
8+
| \.hg
9+
| \.egg
10+
| \.eggs
11+
| \.mypy_cache
12+
| \.tox
13+
| _build
14+
| \.venv
15+
| src
16+
| bin
17+
| stream_chat\.egg-info
18+
| lib
19+
| docs
20+
| buck-out
21+
| build
22+
| dist
23+
)/
24+
'''

setup.py

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
import sys
2+
3+
from stream_chat import __version__, __maintainer__, __email__, __license__
4+
from setuptools import find_packages, setup
5+
from setuptools.command.test import test as TestCommand
6+
7+
8+
install_requires = [
9+
"pycryptodomex==3.4.7",
10+
"requests>=2.3.0,<3",
11+
"pyjwt==1.7.1",
12+
"six>=1.8.0",
13+
]
14+
long_description = open("README.md", "r").read()
15+
tests_require = ["pytest==4.4.1", "pytest-cov", "codecov"]
16+
17+
18+
class PyTest(TestCommand):
19+
def finalize_options(self):
20+
TestCommand.finalize_options(self)
21+
self.test_args = []
22+
self.test_suite = True
23+
24+
def run_tests(self):
25+
# import here, cause outside the eggs aren't loaded
26+
import pytest
27+
28+
errno = pytest.main(["stream_chat/", "-v", "--cov=stream_chat/", "--cov-report=html", "--cov-report=annotate"])
29+
sys.exit(errno)
30+
31+
32+
setup(
33+
name="stream-chat",
34+
cmdclass={"test": PyTest},
35+
version=__version__,
36+
author=__maintainer__,
37+
author_email=__email__,
38+
url="http://github.com/GetStream/chat-py",
39+
description="Client for Stream Chat.",
40+
long_description=long_description,
41+
long_description_content_type="text/markdown",
42+
license=__license__,
43+
packages=find_packages(),
44+
zip_safe=False,
45+
install_requires=install_requires,
46+
extras_require={"test": tests_require},
47+
tests_require=tests_require,
48+
include_package_data=True,
49+
classifiers=[
50+
"Intended Audience :: Developers",
51+
"Intended Audience :: System Administrators",
52+
"Operating System :: OS Independent",
53+
"Topic :: Software Development",
54+
"Development Status :: 5 - Production/Stable",
55+
"Natural Language :: English",
56+
"Programming Language :: Python :: 3",
57+
"Programming Language :: Python :: 3.4",
58+
"Programming Language :: Python :: 3.5",
59+
"Programming Language :: Python :: 3.6",
60+
"Programming Language :: Python :: 3.7",
61+
"Topic :: Software Development :: Libraries :: Python Modules",
62+
],
63+
)

stream_chat/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
__author__ = "Tommaso Barbugli"
2+
__copyright__ = "Copyright 2019, Stream.io, Inc"
3+
__license__ = "To be defined"
4+
__version__ = "0.0.1"
5+
__maintainer__ = "Tommaso Barbugli"
6+
__email__ = "[email protected]"
7+
__status__ = "Production"

0 commit comments

Comments
 (0)