Improved project structure

This commit is contained in:
Miguel Grinberg 2021-06-07 20:18:52 +01:00
parent 5504a7acc8
commit df04df4395
No known key found for this signature in database
GPG Key ID: 36848B262DF5F06C
9 changed files with 50 additions and 59 deletions

View File

@ -1,7 +1,7 @@
Flask-SocketIO
==============
[![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)
[![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)
Socket.IO integration for Flask applications.
@ -51,6 +51,6 @@ Resources
- [Tutorial](http://blog.miguelgrinberg.com/post/easy-websockets-with-flask-and-gevent)
- [Documentation](http://flask-socketio.readthedocs.io/en/latest/)
- [PyPI](https://pypi.python.org/pypi/Flask-SocketIO)
- [Change Log](https://github.com/miguelgrinberg/Flask-SocketIO/blob/master/CHANGES.md)
- [Change Log](https://github.com/miguelgrinberg/Flask-SocketIO/blob/main/CHANGES.md)
- 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.

6
pyproject.toml Normal file
View File

@ -0,0 +1,6 @@
[build-system]
requires = [
"setuptools>=42",
"wheel"
]
build-backend = "setuptools.build_meta"

31
setup.cfg Normal file
View File

@ -0,0 +1,31 @@
[metadata]
name = Flask-SocketIO
version = 5.1.1.dev0
author = Miguel Grinberg
author_email = miguel.grinberg@gmail.com
description = Socket.IO integration for Flask applications
long_description = file: README.md
long_description_content_type = text/markdown
url = https://github.com/miguelgrinberg/flask-socketio
project_urls =
Bug Tracker = https://github.com/miguelgrinberg/flask-socketio/issues
classifiers =
Environment :: Web Environment
Intended Audience :: Developers
Programming Language :: Python :: 3
License :: OSI Approved :: MIT License
Operating System :: OS Independent
[options]
zip_safe = False
include_package_data = True
package_dir =
= src
packages = find:
python_requires = >=3.6
install_requires =
Flask >= 0.9
python-socketio >= 5.0.2
[options.packages.find]
where = src

View File

@ -1,45 +1,3 @@
"""
Flask-SocketIO
--------------
import setuptools
Socket.IO integration for Flask applications.
"""
import re
from setuptools import setup
with open('flask_socketio/__init__.py', 'r') as f:
version = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]',
f.read(), re.MULTILINE).group(1)
setup(
name='Flask-SocketIO',
version=version,
url='http://github.com/miguelgrinberg/Flask-SocketIO/',
license='MIT',
author='Miguel Grinberg',
author_email='miguelgrinberg50@gmail.com',
description='Socket.IO integration for Flask applications',
long_description=__doc__,
packages=['flask_socketio'],
zip_safe=False,
include_package_data=True,
platforms='any',
install_requires=[
'Flask>=0.9',
'python-socketio>=5.0.2'
],
tests_require=[
'coverage'
],
test_suite='test_socketio',
classifiers=[
'Environment :: Web Environment',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
'Topic :: Software Development :: Libraries :: Python Modules'
]
)
setuptools.setup()

View File

@ -26,8 +26,6 @@ from werkzeug._reloader import run_with_reloader
from .namespace import Namespace
from .test_client import SocketIOTestClient
__version__ = '5.1.1dev'
class _SocketIOMiddleware(socketio.WSGIApp):
"""This WSGI middleware simply exposes the Flask application in the WSGI

View File

@ -1,9 +1,5 @@
import json
import unittest
import coverage
cov = coverage.coverage(branch=True)
cov.start()
from flask import Flask, session, request, json as flask_json
from flask_socketio import SocketIO, send, emit, join_room, leave_room, \
@ -270,8 +266,7 @@ class TestSocketIO(unittest.TestCase):
@classmethod
def tearDownClass(cls):
cov.stop()
cov.report(include='flask_socketio/*', show_missing=True)
pass
def setUp(self):
pass

13
tox.ini
View File

@ -12,14 +12,17 @@ python =
[testenv]
commands=
python setup.py test
pip install -e .
pytest -p no:logging --cov=flask_socketio --cov-branch --cov-report=term-missing
deps=
pytest
pytest-cov
[testenv:flake8]
deps=
six
flake8
commands=
flake8 --exclude=".*" --ignore=W503,E402,E722 flask_socketio test_socketio.py
flake8 --exclude=".*" --ignore=W503,E402,E722 src/flask_socketio test_socketio.py
deps=
flake8
[testenv:docs]
changedir=docs