-
Notifications
You must be signed in to change notification settings - Fork 27
Enhancement: Add Python 3.12 #159
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
Open
adamkells
wants to merge
24
commits into
main
Choose a base branch
from
improv/add_python312
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
e887d99
feat: clarify FhirData setter behavior with explicit replace parameter
skalwaghe-56 82a14c1
Merge branch 'main' into fix-issue-123
skalwaghe-56 023181e
Merge branch 'main' into fix-issue-123
skalwaghe-56 d56ef8c
Merge branch 'main' into fix-issue-123
skalwaghe-56 7d79a15
Merge branch 'main' into fix-issue-123
adamkells db1a5f4
transition from poetry to uv
adamkells ef4d3a7
testing uv publish to test-pypi
adamkells 62dcf25
Allow publishing with uv
adamkells 1e2cef0
update docs for uv
adamkells c1e0fb0
Bump python version to 3.12
adamkells 134b0f5
replacing spyne with fastapi WIP
adamkells e220187
remove spyne dependency fully
adamkells 2d21c09
Merge branch 'main' into fix-issue-123
jenniferjiangkells 717aa43
remove 3.9 testing
adamkells 616f8a8
update dependencies
adamkells a6247c0
Potential fix for code scanning alert no. 15: XML external entity exp…
adamkells e027b12
Potential fix for code scanning alert no. 14: Information exposure th…
adamkells 1e90ab7
Merge branch 'main' into improv/add_python312
adamkells 1e51f9c
merge uv branch
adamkells 228889a
update wsdl
adamkells 7e2132d
Merge branch 'main' into improv/add_python312
adamkells 812f877
Modify failing tests
adamkells d6bad3c
notereader/fhir -> notereader/?wsdl
jenniferjiangkells 8f75f7b
Added timezone fix for naive datetimes
jenniferjiangkells File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,7 +11,6 @@ | |
| from datetime import datetime | ||
| from fastapi import FastAPI, APIRouter, HTTPException, Request | ||
| from fastapi.middleware.cors import CORSMiddleware | ||
| from fastapi.middleware.wsgi import WSGIMiddleware | ||
| from fastapi.exceptions import RequestValidationError | ||
| from fastapi.responses import JSONResponse | ||
| from termcolor import colored | ||
|
|
@@ -233,10 +232,10 @@ def _add_component_routes( | |
| # Case 2: WSGI services (like NoteReaderService) - only for services | ||
| if ( | ||
| component_type == "service" | ||
| and hasattr(component, "create_wsgi_app") | ||
| and callable(component.create_wsgi_app) | ||
| and hasattr(component, "create_fastapi_router") | ||
| and callable(component.create_fastapi_router) | ||
| ): | ||
| self._register_wsgi_service( | ||
| self._register_mounted_service( | ||
| component, component_name, endpoints_registry, path | ||
| ) | ||
| return | ||
|
|
@@ -249,7 +248,7 @@ def _add_component_routes( | |
| else: | ||
| logger.warning( | ||
| f"Service {component_name} does not implement APIRouter or WSGI patterns. " | ||
| f"Services must either inherit from APIRouter or implement create_wsgi_app()." | ||
| f"Services must either inherit from APIRouter or implement create_fastapi_router()." | ||
| ) | ||
|
|
||
| def _register_api_router( | ||
|
|
@@ -277,29 +276,42 @@ def _register_api_router( | |
| else: | ||
| logger.debug(f"Registered {component_name} as router (routes unknown)") | ||
|
|
||
| def _register_wsgi_service( | ||
| def _register_mounted_service( # Renamed from _register_wsgi_service | ||
| self, | ||
| service: BaseProtocolHandler, | ||
| service_name: str, | ||
| endpoints_registry: Dict[str, set], | ||
| path: Optional[str] = None, | ||
| ) -> None: | ||
| """Register a WSGI service.""" | ||
| # Create WSGI app | ||
| wsgi_app = service.create_wsgi_app() | ||
| """Register a service with a custom router.""" | ||
| router_or_app = service.create_fastapi_router() | ||
|
|
||
| # Determine mount path with fallback chain | ||
| mount_path = ( | ||
| path | ||
| or getattr(service.config, "default_mount_path", None) | ||
| or getattr(service.config, "base_path", None) | ||
| or f"/{service_name.lower().replace('service', '').replace('gateway', '')}" | ||
| ) | ||
|
|
||
| # Mount the WSGI app | ||
| self.mount(mount_path, WSGIMiddleware(wsgi_app)) | ||
| endpoints_registry[service_name].add(f"WSGI:{mount_path}") | ||
| logger.debug(f"Registered WSGI service {service_name} at {mount_path}") | ||
| logger.info(f"🔧 Registering {service_name} at: {mount_path}") | ||
| logger.info(f" Router type: {type(router_or_app)}") | ||
|
|
||
| # Use include_router for APIRouter instances | ||
| if isinstance(router_or_app, APIRouter): | ||
| if hasattr(router_or_app, "routes"): | ||
| logger.info(f" Routes in router: {len(router_or_app.routes)}") | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same here |
||
| for route in router_or_app.routes: | ||
| if hasattr(route, "methods") and hasattr(route, "path"): | ||
| logger.info(f" - {route.methods} {route.path}") | ||
|
|
||
| self.include_router(router_or_app, prefix=mount_path) | ||
| endpoints_registry[service_name].add(f"INCLUDED:{mount_path}") | ||
| logger.info(f"✅ Included router {service_name} at {mount_path}") | ||
| else: | ||
| # For FastAPI apps, use mount | ||
| self.mount(mount_path, router_or_app) | ||
| endpoints_registry[service_name].add(f"MOUNTED:{mount_path}") | ||
| logger.info(f"✅ Mounted app {service_name} at {mount_path}") | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. logs |
||
|
|
||
| def register_gateway( | ||
| self, | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,9 @@ | ||
| from .notereader import NoteReaderService | ||
| from .utils.epiccds import CDSServices | ||
| from .notereader import NoteReaderService, NoteReaderConfig | ||
| from .utils.model import ClientFault, ServerFault | ||
|
|
||
| __all__ = [ | ||
| "NoteReaderService", | ||
| "CDSServices", | ||
| "NoteReaderConfig", | ||
| "ClientFault", | ||
| "ServerFault", | ||
| ] |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe make these logs debug instead of info