server: entrypoints `run_*.py` are written as scripts
维护者通常 4 天内回复
还没有人认领这个 Issue。
评估
调研方向
Start by reading server/app/services/run_repository.py, run_registry.py, and run_discovery.py to identify the code currently executed at import time. Move each entrypoint's setup into a main() function and only assign application when the script is run directly. Done when importing these modules no longer executes the setup, while direct execution still creates the WSGI application.
由索引模型根据 Issue 内容生成。
描述
To create the Python WSGI application, the docker images execute a script from server/app/services (run_repository.py, run_registry.py, run_discovery.py) which sets the global application variable.
These script's code is written directly to the file and is not wrapped inside functions or a if __name__ == "__main__" guard. Therefore this code can only and will always be executed when the script is imported (e.g. import app.services.run_repositroy). This complicates unit testing unnecessary, because it requires re-importing the script over and over again.
We should wrap the code that lives at file level today inside a main() function and only execute it, when the script is run directly. This could look equivalent to this:
def main() -> WSGIApp:
...
if __name__ == "__main__":
application = main()
- 主要语言
- Python
- 星标
- 104
- 派生
- 56
- 平均合并
- 12 天 13 小时
- 30 天内合并 PR
- 5
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
eclipse-basyx/basyx-python-sdk 的其他 Issue
-
README CI badge is broken可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭bug documentation
难度 1/5 1 小时以内 新手友好度 85/100
eclipse-basyx/basyx-python-sdk#656 ·
维护者通常 4 天内回复
-
bug server Specification
难度 2/5 1-3 小时 新手友好度 88/100
eclipse-basyx/basyx-python-sdk#655 ·
维护者通常 4 天内回复
-
bug sdk
难度 2/5 1-3 小时 新手友好度 84/100
eclipse-basyx/basyx-python-sdk#634 · 3 条评论 ·
维护者通常 4 天内回复
-
enhancement server
难度 2/5 1-3 小时 新手友好度 88/100
eclipse-basyx/basyx-python-sdk#632 ·
维护者通常 4 天内回复
-
bug high priority
难度 2/5 1-3 小时 新手友好度 90/100
eclipse-basyx/basyx-python-sdk#631 ·
维护者通常 4 天内回复
查看 eclipse-basyx/basyx-python-sdk 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
huggingface/sentence-transformers#4186 ·
维护者通常 5 天内回复
-
documentation good first issue
难度 2/5 半天 新手友好度 72/100
sujithputta02/Esapay#13 ·
-
bot-triaged module: correctness (silent) module: mps module: NaNs and Infs triage review
难度 2/5 半天 新手友好度 62/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
SCIInstitute/SCIRun#2842 ·
维护者通常 3 天内回复