switch from setuptools to flit for packaging, finalize release 0.9.9.4

Commit 277462c · patx · 2025-02-20T01:06:28-05:00

Changeset
277462ca6a18f67e30df9761125625596628e201
Parents
eb1f42c40104a9d86e3680fa0a49a262d5cdf864

View source at this commit

Comments

No comments yet.

Log in to comment

Diff

diff --git a/MicroPie.py b/MicroPie.py
index 0080509..936b34d 100644
--- a/MicroPie.py
+++ b/MicroPie.py
@@ -50,8 +50,8 @@ except ImportError:
     JINJA_INSTALLED = False
 
 try:
-    from multipart import PushMultipartParser, MultipartSegment
     import aiofiles, aiofiles.os
+    from multipart import PushMultipartParser, MultipartSegment
     MULTIPART_INSTALLED = True
 except ImportError:
     MULTIPART_INSTALLED = False
diff --git a/README.md b/README.md
index 683f640..3974e8b 100644
--- a/README.md
+++ b/README.md
@@ -24,13 +24,18 @@
 ## **Installing MicroPie**
 
 ### **Installation**
-Install MicroPie via pip:
+Install MicroPie with all optional dependencies via pip:
 ```bash
-pip install micropie
+pip install micropie[all]
 ```
 This will install MicroPie along with `jinja2` for template rendering and `multipart`/`aiofiles` for parsing multipart form data.
 
 ### **Minimal Setup**
+You can also install MicroPie without dependencies via pip:
+```bash
+pip install micropie
+```
+
 For an ultra-minimalistic approach, download the standalone script:
 
 [MicroPie.py](https://raw.githubusercontent.com/patx/micropie/refs/heads/main/MicroPie.py)
diff --git a/pyproject.toml b/pyproject.toml
new file mode 100644
index 0000000..e12b62f
--- /dev/null
+++ b/pyproject.toml
@@ -0,0 +1,32 @@
+[build-system]
+requires = ["flit_core>=3.9,<4"]
+build-backend = "flit_core.buildapi"
+
+[project]
+name = "MicroPie"
+version = "0.9.9.4"
+description = "An ultra micro ASGI web framework"
+keywords = ["micropie", "asgi", "microframework", "http"]
+readme = "README.md"
+authors = [{ name = "Harrison Erd", email = "[email protected]" }]
+license = {file = "LICENSE"}
+classifiers = [
+    "Programming Language :: Python :: 3",
+    "Environment :: Web Environment",
+    "Intended Audience :: Developers",
+    "License :: OSI Approved :: BSD License",
+    "Operating System :: OS Independent",
+    "Topic :: Internet :: WWW/HTTP :: Dynamic Content",
+    "Topic :: Internet :: WWW/HTTP",
+    "Framework :: AsyncIO",
+    "Topic :: Software Development :: Libraries :: Application Frameworks",
+    "Typing :: Typed"
+]
+
+[project.optional-dependencies]
+all = ["jinja2", "multipart", "aiofiles"]
+
+[project.urls]
+Homepage = "https://patx.github.io/micropie"
+Repository = "https://github.com/patx/micropie"
+
diff --git a/setup.py b/setup.py
deleted file mode 100644
index bf46a5d..0000000
--- a/setup.py
+++ /dev/null
@@ -1,49 +0,0 @@
-"""
-
-MicroPie is Fun
-```````````````
-
-::
-
-    from MicroPie import App
-
-    class MyApp(App):
-
-        async def index(self):
-            return 'Hello world!'
-
-    app = MyApp()  # Run with `uvicorn app:app`
-
-
-Links
-`````
-
-* `Website <https://patx.github.io/micropie>`_
-* `Github Repo <https://github.com/patx/micropie>`_
-"""
-
-from distutils.core import setup
-
-setup(name="MicroPie",
-    version="0.9.9.3",
-    description="A ultra micro web framework w/ Jinja2.",
-    long_description=__doc__,
-    author="Harrison Erd",
-    author_email="[email protected]",
-    license="three-clause BSD",
-    url="http://github.com/patx/micropie",
-    classifiers = [
-    "Programming Language :: Python :: 3",
-    "Environment :: Web Environment",
-    "Intended Audience :: Developers",
-    "License :: OSI Approved :: BSD License",
-    "Operating System :: OS Independent",
-    "Topic :: Internet :: WWW/HTTP :: Dynamic Content",
-    "Topic :: Internet :: WWW/HTTP",
-    "Framework :: AsyncIO",
-    "Topic :: Software Development :: Libraries :: Application Frameworks",
-    "Typing :: Typed"],
-    py_modules=['MicroPie'],
-    install_requires=['jinja2', 'multipart', 'aiofiles'],
-)
-