Skip to content

Commit

Permalink
Improved project structure
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelgrinberg committed Jun 7, 2021
1 parent 5504a7a commit df04df4
Show file tree
Hide file tree
Showing 9 changed files with 49 additions and 58 deletions.
4 changes: 2 additions & 2 deletions README.md
@@ -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.

Expand Down Expand Up @@ -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 changes: 6 additions & 0 deletions pyproject.toml
@@ -0,0 +1,6 @@
[build-system]
requires = [
"setuptools>=42",
"wheel"
]
build-backend = "setuptools.build_meta"
31 changes: 31 additions & 0 deletions setup.cfg
@@ -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
46 changes: 2 additions & 44 deletions setup.py
@@ -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()
2 changes: 0 additions & 2 deletions flask_socketio/__init__.py → src/flask_socketio/__init__.py
Expand Up @@ -26,8 +26,6 @@
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
Expand Down
File renamed without changes.
File renamed without changes.
7 changes: 1 addition & 6 deletions test_socketio.py
@@ -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, \
Expand Down Expand Up @@ -270,8 +266,7 @@ def setUpClass(cls):

@classmethod
def tearDownClass(cls):
cov.stop()
cov.report(include='flask_socketio/*', show_missing=True)
pass

def setUp(self):
pass
Expand Down
11 changes: 7 additions & 4 deletions tox.ini
Expand Up @@ -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]
commands=
flake8 --exclude=".*" --ignore=W503,E402,E722 src/flask_socketio test_socketio.py
deps=
six
flake8
commands=
flake8 --exclude=".*" --ignore=W503,E402,E722 flask_socketio test_socketio.py

[testenv:docs]
changedir=docs
Expand Down

0 comments on commit df04df4

Please sign in to comment.