Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: don't include modules.c in the wheel #48

Merged
merged 4 commits into from
Nov 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion httpout/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright (c) 2024 nggit

__version__ = '0.0.52'
__version__ = '0.0.53'
__all__ = ('HTTPOut',)

from .httpout import HTTPOut # noqa: E402
4 changes: 2 additions & 2 deletions httpout/lib/http_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ def set_content_type(self, content_type='text/html; charset=utf-8'):
self.call_soon(self.response.set_content_type, content_type)

async def _run_middleware(self):
worker_ctx = self.response.request.protocol.globals
middlewares = worker_ctx.options['_middlewares']['response']
g = self.response.request.protocol.globals
middlewares = g.options['_middlewares']['response']
i = len(middlewares)

while i > 0:
Expand Down
3 changes: 1 addition & 2 deletions httpout/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ def new_module(name, level=0, document_root=None):
if os.path.isfile(module_path):
if name in sys.modules:
if ('__file__' in sys.modules[name].__dict__ and
sys.modules[name].__file__
.startswith(document_root)):
sys.modules[name].__file__.startswith(document_root)):
del sys.modules[name]

raise ImportError(f'module name conflict: {name}')
Expand Down
4 changes: 2 additions & 2 deletions httpout/utils/modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ def cleanup_modules(modules, excludes=()):
if value in excludes or name.startswith('__'):
continue

if value is not module and not isinstance(value,
(type, ModuleType)):
if not (value is module or
isinstance(value, (type, ModuleType))):
value_dict = getattr(value, '__dict__', None)

if value_dict:
Expand Down
4 changes: 2 additions & 2 deletions httpout/utils/modules.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ def cleanup_modules(modules, tuple excludes=()):
if value in excludes or name.startswith('__'):
continue

if value is not module and not isinstance(value,
(type, ModuleType)):
if not (value is module or
isinstance(value, (type, ModuleType))):
value_dict = getattr(value, '__dict__', None)

if value_dict:
Expand Down
8 changes: 5 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@ def build_extension(self, ext):
)
finally:
for source in ext.sources:
if os.path.exists(source):
os.unlink(source)
print(f'Deleted: {source}')
path = os.path.join(self.build_lib, source)

if os.path.exists(path):
os.unlink(path)
print(f'Deleted: {path}')


extensions = [
Expand Down
Loading