Skip to content

Commit e1e1a1e

Browse files
authoredNov 10, 2024
release 0.0.53 (#48)
* clean up * fix: don't include modules.c in the wheel --------- Co-authored-by: nggit <12218311+nggit@users.noreply.github.com>
1 parent 661ed09 commit e1e1a1e

File tree

6 files changed

+13
-12
lines changed

6 files changed

+13
-12
lines changed
 

‎httpout/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Copyright (c) 2024 nggit
22

3-
__version__ = '0.0.52'
3+
__version__ = '0.0.53'
44
__all__ = ('HTTPOut',)
55

66
from .httpout import HTTPOut # noqa: E402

‎httpout/lib/http_response.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ def set_content_type(self, content_type='text/html; charset=utf-8'):
8686
self.call_soon(self.response.set_content_type, content_type)
8787

8888
async def _run_middleware(self):
89-
worker_ctx = self.response.request.protocol.globals
90-
middlewares = worker_ctx.options['_middlewares']['response']
89+
g = self.response.request.protocol.globals
90+
middlewares = g.options['_middlewares']['response']
9191
i = len(middlewares)
9292

9393
while i > 0:

‎httpout/utils/__init__.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@ def new_module(name, level=0, document_root=None):
4141
if os.path.isfile(module_path):
4242
if name in sys.modules:
4343
if ('__file__' in sys.modules[name].__dict__ and
44-
sys.modules[name].__file__
45-
.startswith(document_root)):
44+
sys.modules[name].__file__.startswith(document_root)):
4645
del sys.modules[name]
4746

4847
raise ImportError(f'module name conflict: {name}')

‎httpout/utils/modules.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ def cleanup_modules(modules, excludes=()):
2828
if value in excludes or name.startswith('__'):
2929
continue
3030

31-
if value is not module and not isinstance(value,
32-
(type, ModuleType)):
31+
if not (value is module or
32+
isinstance(value, (type, ModuleType))):
3333
value_dict = getattr(value, '__dict__', None)
3434

3535
if value_dict:

‎httpout/utils/modules.pyx

+2-2
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ def cleanup_modules(modules, tuple excludes=()):
6262
if value in excludes or name.startswith('__'):
6363
continue
6464

65-
if value is not module and not isinstance(value,
66-
(type, ModuleType)):
65+
if not (value is module or
66+
isinstance(value, (type, ModuleType))):
6767
value_dict = getattr(value, '__dict__', None)
6868

6969
if value_dict:

‎setup.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,11 @@ def build_extension(self, ext):
1919
)
2020
finally:
2121
for source in ext.sources:
22-
if os.path.exists(source):
23-
os.unlink(source)
24-
print(f'Deleted: {source}')
22+
path = os.path.join(self.build_lib, source)
23+
24+
if os.path.exists(path):
25+
os.unlink(path)
26+
print(f'Deleted: {path}')
2527

2628

2729
extensions = [

0 commit comments

Comments
 (0)
Please sign in to comment.