|
1 | | -from setuptools import setup |
| 1 | +from setuptools import setup, find_packages |
2 | 2 | from mypyc.build import mypycify |
| 3 | +import os |
| 4 | + |
| 5 | + |
| 6 | +def readme(): |
| 7 | + with open("README.md", "r", encoding="utf-8") as fh: |
| 8 | + return fh.read() |
| 9 | + |
| 10 | + |
| 11 | +def list_ext_modules(base_path="src/py/extra"): |
| 12 | + python_files = [] |
| 13 | + for root, _, files in os.walk(base_path): |
| 14 | + for file in files: |
| 15 | + if file.endswith(".py"): |
| 16 | + python_files.append(os.path.join(root, file)) |
| 17 | + return python_files |
| 18 | + |
3 | 19 |
|
4 | | -# NOTE: This is experimental |
5 | 20 | setup( |
6 | | - name="extra", |
7 | | - packages=[ |
8 | | - "extra", |
9 | | - "extra.bridge", |
10 | | - "extra.feature", |
11 | | - "extra.protocol", |
12 | | - "extra.util", |
13 | | - "extra.services", |
14 | | - ], |
15 | | - ext_modules=mypycify( |
16 | | - [ |
17 | | - "src/py/extra/bridge/awslambda.py", |
18 | | - "src/py/extra/bridge/cli.py", |
19 | | - "src/py/extra/bridge/python.py", |
20 | | - "src/py/extra/bridge/aio.py", |
21 | | - "src/py/extra/bridge/files.py", |
22 | | - "src/py/extra/bridge/__init__.py", |
23 | | - "src/py/extra/bridge/asgi.py", |
24 | | - "src/py/extra/feature/cors.py", |
25 | | - "src/py/extra/feature/channels.py", |
26 | | - "src/py/extra/protocol/__init__.py", |
27 | | - "src/py/extra/protocol/http.py", |
28 | | - "src/py/extra/util/__init__.py", |
29 | | - "src/py/extra/util/files.py", |
30 | | - "src/py/extra/services/__init__.py", |
31 | | - "src/py/extra/services/files.py", |
32 | | - "src/py/extra/__init__.py", |
33 | | - "src/py/extra/routing.py", |
34 | | - "src/py/extra/decorators.py", |
35 | | - "src/py/extra/logging.py", |
36 | | - "src/py/extra/model.py", |
37 | | - ] |
38 | | - ), |
| 21 | + name="extra", |
| 22 | + version="1.0.0", |
| 23 | + author="Sébastien Pierre", |
| 24 | + author_email="sebastien.pierre@gmail.com", |
| 25 | + description="A toolkit to write HTTP/1.1 web services and applications, with first class support for streaming", |
| 26 | + long_description=readme(), |
| 27 | + long_description_content_type="text/markdown", |
| 28 | + url="https://github.com/sebastien/extra", |
| 29 | + project_urls={ |
| 30 | + "Bug Tracker": "https://github.com/sebastien/extra/issues", |
| 31 | + "Documentation": "https://github.com/sebastien/extra", |
| 32 | + "Source Code": "https://github.com/sebastien/extra", |
| 33 | + }, |
| 34 | + packages=find_packages(where="src/py"), |
| 35 | + package_dir={"": "src/py"}, |
| 36 | + classifiers=[ |
| 37 | + "Development Status :: 4 - Beta", |
| 38 | + "Intended Audience :: Developers", |
| 39 | + "License :: OSI Approved :: MIT License", |
| 40 | + "Operating System :: OS Independent", |
| 41 | + "Programming Language :: Python :: 3", |
| 42 | + "Programming Language :: Python :: 3.8", |
| 43 | + "Programming Language :: Python :: 3.9", |
| 44 | + "Programming Language :: Python :: 3.10", |
| 45 | + "Programming Language :: Python :: 3.11", |
| 46 | + "Programming Language :: Python :: 3.12", |
| 47 | + "Topic :: Internet :: WWW/HTTP :: HTTP Servers", |
| 48 | + "Topic :: Software Development :: Libraries :: Python Modules", |
| 49 | + "Topic :: System :: Networking", |
| 50 | + ], |
| 51 | + python_requires=">=3.8", |
| 52 | + install_requires=[ |
| 53 | + "mypy-extensions", |
| 54 | + ], |
| 55 | + extras_require={ |
| 56 | + "dev": [ |
| 57 | + "mypy", |
| 58 | + "flake8", |
| 59 | + "bandit", |
| 60 | + ], |
| 61 | + }, |
| 62 | + entry_points={ |
| 63 | + "console_scripts": [ |
| 64 | + "extra=extra.__main__:main", |
| 65 | + ], |
| 66 | + }, |
| 67 | + include_package_data=True, |
| 68 | + zip_safe=False, |
| 69 | + # NOTE: mypyc compilation is experimental |
| 70 | + ext_modules=mypycify(list_ext_modules()), |
39 | 71 | ) |
0 commit comments