Skip to content

Commit df04df4

Browse files
Improved project structure
1 parent 5504a7a commit df04df4

File tree

9 files changed

+49
-58
lines changed

9 files changed

+49
-58
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Flask-SocketIO
22
==============
33

4-
[![Build status](https://github.com/miguelgrinberg/flask-socketio/workflows/build/badge.svg)](https://github.com/miguelgrinberg/Flask-SocketIO/actions) [![codecov](https://codecov.io/gh/miguelgrinberg/flask-socketio/branch/master/graph/badge.svg)](https://codecov.io/gh/miguelgrinberg/flask-socketio)
4+
[![Build status](https://github.com/miguelgrinberg/flask-socketio/workflows/build/badge.svg)](https://github.com/miguelgrinberg/Flask-SocketIO/actions) [![codecov](https://codecov.io/gh/miguelgrinberg/flask-socketio/branch/main/graph/badge.svg)](https://codecov.io/gh/miguelgrinberg/flask-socketio)
55

66
Socket.IO integration for Flask applications.
77

@@ -51,6 +51,6 @@ Resources
5151
- [Tutorial](http://blog.miguelgrinberg.com/post/easy-websockets-with-flask-and-gevent)
5252
- [Documentation](http://flask-socketio.readthedocs.io/en/latest/)
5353
- [PyPI](https://pypi.python.org/pypi/Flask-SocketIO)
54-
- [Change Log](https://github.com/miguelgrinberg/Flask-SocketIO/blob/master/CHANGES.md)
54+
- [Change Log](https://github.com/miguelgrinberg/Flask-SocketIO/blob/main/CHANGES.md)
5555
- Questions? See the [questions](https://stackoverflow.com/questions/tagged/flask-socketio) others have asked on Stack Overflow, or [ask](https://stackoverflow.com/questions/ask?tags=python+flask-socketio+python-socketio) your own question.
5656

pyproject.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[build-system]
2+
requires = [
3+
"setuptools>=42",
4+
"wheel"
5+
]
6+
build-backend = "setuptools.build_meta"

setup.cfg

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
[metadata]
2+
name = Flask-SocketIO
3+
version = 5.1.1.dev0
4+
author = Miguel Grinberg
5+
author_email = miguel.grinberg@gmail.com
6+
description = Socket.IO integration for Flask applications
7+
long_description = file: README.md
8+
long_description_content_type = text/markdown
9+
url = https://github.com/miguelgrinberg/flask-socketio
10+
project_urls =
11+
Bug Tracker = https://github.com/miguelgrinberg/flask-socketio/issues
12+
classifiers =
13+
Environment :: Web Environment
14+
Intended Audience :: Developers
15+
Programming Language :: Python :: 3
16+
License :: OSI Approved :: MIT License
17+
Operating System :: OS Independent
18+
19+
[options]
20+
zip_safe = False
21+
include_package_data = True
22+
package_dir =
23+
= src
24+
packages = find:
25+
python_requires = >=3.6
26+
install_requires =
27+
Flask >= 0.9
28+
python-socketio >= 5.0.2
29+
30+
[options.packages.find]
31+
where = src

setup.py

Lines changed: 2 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,3 @@
1-
"""
2-
Flask-SocketIO
3-
--------------
1+
import setuptools
42

5-
Socket.IO integration for Flask applications.
6-
"""
7-
import re
8-
from setuptools import setup
9-
10-
with open('flask_socketio/__init__.py', 'r') as f:
11-
version = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]',
12-
f.read(), re.MULTILINE).group(1)
13-
14-
setup(
15-
name='Flask-SocketIO',
16-
version=version,
17-
url='http://github.com/miguelgrinberg/Flask-SocketIO/',
18-
license='MIT',
19-
author='Miguel Grinberg',
20-
author_email='miguelgrinberg50@gmail.com',
21-
description='Socket.IO integration for Flask applications',
22-
long_description=__doc__,
23-
packages=['flask_socketio'],
24-
zip_safe=False,
25-
include_package_data=True,
26-
platforms='any',
27-
install_requires=[
28-
'Flask>=0.9',
29-
'python-socketio>=5.0.2'
30-
],
31-
tests_require=[
32-
'coverage'
33-
],
34-
test_suite='test_socketio',
35-
classifiers=[
36-
'Environment :: Web Environment',
37-
'Intended Audience :: Developers',
38-
'License :: OSI Approved :: MIT License',
39-
'Operating System :: OS Independent',
40-
'Programming Language :: Python',
41-
'Programming Language :: Python :: 3',
42-
'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
43-
'Topic :: Software Development :: Libraries :: Python Modules'
44-
]
45-
)
3+
setuptools.setup()

flask_socketio/__init__.py renamed to src/flask_socketio/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@
2626
from .namespace import Namespace
2727
from .test_client import SocketIOTestClient
2828

29-
__version__ = '5.1.1dev'
30-
3129

3230
class _SocketIOMiddleware(socketio.WSGIApp):
3331
"""This WSGI middleware simply exposes the Flask application in the WSGI
File renamed without changes.
File renamed without changes.

test_socketio.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
import json
22
import unittest
3-
import coverage
4-
5-
cov = coverage.coverage(branch=True)
6-
cov.start()
73

84
from flask import Flask, session, request, json as flask_json
95
from flask_socketio import SocketIO, send, emit, join_room, leave_room, \
@@ -270,8 +266,7 @@ def setUpClass(cls):
270266

271267
@classmethod
272268
def tearDownClass(cls):
273-
cov.stop()
274-
cov.report(include='flask_socketio/*', show_missing=True)
269+
pass
275270

276271
def setUp(self):
277272
pass

tox.ini

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,17 @@ python =
1212

1313
[testenv]
1414
commands=
15-
python setup.py test
15+
pip install -e .
16+
pytest -p no:logging --cov=flask_socketio --cov-branch --cov-report=term-missing
17+
deps=
18+
pytest
19+
pytest-cov
1620

1721
[testenv:flake8]
22+
commands=
23+
flake8 --exclude=".*" --ignore=W503,E402,E722 src/flask_socketio test_socketio.py
1824
deps=
19-
six
2025
flake8
21-
commands=
22-
flake8 --exclude=".*" --ignore=W503,E402,E722 flask_socketio test_socketio.py
2326

2427
[testenv:docs]
2528
changedir=docs

0 commit comments

Comments
 (0)