Skip to content

Commit

Permalink
setuptools
Browse files Browse the repository at this point in the history
  • Loading branch information
ZeroIntensity committed Aug 26, 2023
1 parent 06f4564 commit 2813e18
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 107 deletions.
10 changes: 0 additions & 10 deletions include/view/context.h

This file was deleted.

1 change: 0 additions & 1 deletion include/view/view.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@
#include <view/app.h>
#include <view/awaitable.h>
#include <view/map.h>
#include <view/context.h>

#endif
14 changes: 6 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["hatchling", "setuptools", "toml"]
requires = ["setuptools", "toml"]
build-backend = "setuptools.build_meta"

[project]
Expand Down Expand Up @@ -73,11 +73,12 @@ test-output-style = "test-per-line"
fail-limit = 5
progress-style = ["bar"]

[tool.hatch.build]
include = ["src/view/**/*.py", "src/_view/_view.pyi"]

[tool.hatch.build.targets.wheel]
packages = ["src/view"]
# [tool.hatch.build]
# include = ["src/view/**/*.py", "src/_view/_view.pyi"]

# [tool.hatch.build.targets.wheel]
# packages = ["src/view"]

# [tool.hatch.build.hooks.custom]
# enable-by-default = true
Expand All @@ -88,6 +89,3 @@ packages = ["src/view"]

[project.scripts]
view = "view.__main__:main"

#[tool.hatch.build.targets.wheel.hooks.mypyc]
#dependencies = ["hatch-mypyc"]
11 changes: 6 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
from setuptools import setup, Extension
import toml
from glob import glob

import toml
from setuptools import Extension, setup

with open("./README.md") as f:
long_desc: str = f.read()

if __name__ == "__main__":
with open("./pyproject.toml", "r") as f:
data = toml.load(f)

print(glob("./src/_view/*.c"))
setup(
name="view.py",
version="1.0.0-alpha1",
Expand All @@ -19,8 +20,8 @@
ext_modules=[
Extension(
"_view",
glob("src/_view/*.c"),
include_dirs=["include"],
glob("./src/_view/*.c"),
)
],
include_dirs=["./include"],
)
67 changes: 0 additions & 67 deletions src/_view/context.c

This file was deleted.

15 changes: 0 additions & 15 deletions src/_view/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,20 +66,5 @@ PyMODINIT_FUNC PyInit__view() {
Py_DECREF(m);
return NULL;
}
/*
Py_INCREF(&ContextType);
if (PyModule_AddObject(
m,
"Context",
(PyObject*) &ContextType
) < 0) {
Py_DECREF(&ContextType);
Py_DECREF(&ViewAppType);
Py_DECREF(&PyAwaitable_Type);
Py_DECREF(&_PyAwaitable_GenWrapper_Type);
Py_DECREF(m);
return NULL;
}
*/
return m;
}
2 changes: 1 addition & 1 deletion src/view/_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def finalize(routes: list[Route], app: ViewApp):
target = targets[route.method]

if (not route.path) and (not route.parts):
raise TypeError("route did not specify a path")
raise TypeError("route did not specify a path")
assert route.path
lst = virtual_routes.get(route.path)

Expand Down

0 comments on commit 2813e18

Please sign in to comment.