From fe1f17fbe3ac6c8c2c025ea0487f3462e3ca99e1 Mon Sep 17 00:00:00 2001 From: Max <35808469+maxblan@users.noreply.github.com> Date: Fri, 15 Mar 2024 22:40:43 +0100 Subject: [PATCH] Fix/package builder (#51) * Remove old Score class * Update .gitignore * Fix module filtering in SochaPackageBuilder class --- .gitignore | 3 ++- python/socha/api/protocol/protocol.py | 28 --------------------------- python/socha/utils/package_builder.py | 2 +- 3 files changed, 3 insertions(+), 30 deletions(-) diff --git a/.gitignore b/.gitignore index bb3f5be..311c305 100644 --- a/.gitignore +++ b/.gitignore @@ -9,13 +9,14 @@ __pycache__/ *.so # Distribution / packaging +socha_builds/ .Python .venv/ env/ bin/ build/ develop-eggs/ -# dist/ +dist/ eggs/ lib/ lib64/ diff --git a/python/socha/api/protocol/protocol.py b/python/socha/api/protocol/protocol.py index 33c4ca5..ec3b43c 100644 --- a/python/socha/api/protocol/protocol.py +++ b/python/socha/api/protocol/protocol.py @@ -704,34 +704,6 @@ class Meta: ) -@dataclass -class Score: - class Meta: - name = "score" - - cause: Optional[str] = field( - default=None, - metadata={ - "type": "Attribute", - "required": True, - } - ) - reason: Optional[object] = field( - default=None, - metadata={ - "type": "Attribute", - "required": True, - } - ) - part: List[int] = field( - default_factory=list, - metadata={ - "type": "Element", - "min_occurs": 1, - } - ) - - @dataclass class Turn: class Meta: diff --git a/python/socha/utils/package_builder.py b/python/socha/utils/package_builder.py index c641748..e930cce 100644 --- a/python/socha/utils/package_builder.py +++ b/python/socha/utils/package_builder.py @@ -96,7 +96,7 @@ def _get_modules(): ) main_modules = { name for name in main_modules - if hasattr(sys.modules[name], "__file__") + if hasattr(sys.modules[name], "__file__") and sys.modules[name].__file__ is not None and (os.path.abspath(os.path.dirname(sys.modules[name].__file__)) == main_dir or os.path.abspath(os.path.dirname(sys.modules[name].__file__)).startswith(main_dir + os.path.sep)) }