Skip to content

Commit

Permalink
merge with dev
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinBelthle committed Feb 6, 2025
2 parents 20d2f82 + 3efcfff commit e5d9996
Show file tree
Hide file tree
Showing 110 changed files with 840 additions and 4,823 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
uses: psf/black@stable
with:
# Version of Black should match the versions set in `requirements-dev.txt`
version: "~=23.7.0"
version: "~=25.1.0"
options: --check --diff
- name: Check Typing (mypy)
#continue-on-error: true
Expand Down
35 changes: 0 additions & 35 deletions AntaresWebLinux.spec
Original file line number Diff line number Diff line change
Expand Up @@ -54,45 +54,10 @@ antares_web_server_exe = EXE(antares_web_server_pyz,
entitlements_file=None , icon='resources/webapp/favicon.ico')


antares_tool_a = Analysis(['antarest/tools/cli.py'],
pathex=[],
binaries=[],
datas=[('./resources', './resources')],
hiddenimports=['cmath', 'sqlalchemy.sql.default_comparator', 'sqlalchemy.ext.baked'],
hookspath=['extra-hooks'],
hooksconfig={},
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False)
antares_tool_pyz = PYZ(antares_tool_a.pure, antares_tool_a.zipped_data,
cipher=block_cipher)
antares_tool_exe = EXE(antares_tool_pyz,
antares_tool_a.scripts,
[],
exclude_binaries=True,
name='AntaresTool',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
console=True,
disable_windowed_traceback=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None )


coll = COLLECT(antares_web_server_exe,
antares_web_server_a.binaries,
antares_web_server_a.zipfiles,
antares_web_server_a.datas,
antares_tool_exe,
antares_tool_a.binaries,
antares_tool_a.zipfiles,
antares_tool_a.datas,
strip=False,
upx=True,
upx_exclude=[],
Expand Down
36 changes: 0 additions & 36 deletions AntaresWebWin.spec
Original file line number Diff line number Diff line change
Expand Up @@ -53,46 +53,10 @@ antares_web_server_exe = EXE(antares_web_server_pyz,
codesign_identity=None,
entitlements_file=None , icon='resources/webapp/favicon.ico')


antares_tool_a = Analysis(['antarest/tools/cli.py'],
pathex=[],
binaries=[],
datas=[('./resources', './resources')],
hiddenimports=['cmath', 'sqlalchemy.sql.default_comparator', 'sqlalchemy.ext.baked'],
hookspath=['extra-hooks'],
hooksconfig={},
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False)
antares_tool_pyz = PYZ(antares_tool_a.pure, antares_tool_a.zipped_data,
cipher=block_cipher)
antares_tool_exe = EXE(antares_tool_pyz,
antares_tool_a.scripts,
[],
exclude_binaries=True,
name='AntaresTool',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
console=True,
disable_windowed_traceback=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None )


coll = COLLECT(antares_web_server_exe,
antares_web_server_a.binaries,
antares_web_server_a.zipfiles,
antares_web_server_a.datas,
antares_tool_exe,
antares_tool_a.binaries,
antares_tool_a.zipfiles,
antares_tool_a.datas,
strip=False,
upx=True,
upx_exclude=[],
Expand Down
32 changes: 20 additions & 12 deletions antarest/core/filetransfer/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,11 @@ def request_download(
Event(
type=EventType.DOWNLOAD_CREATED,
payload=download.to_dto(),
permissions=PermissionInfo(owner=owner.impersonator)
if owner
else PermissionInfo(public_mode=PublicMode.READ),
permissions=(
PermissionInfo(owner=owner.impersonator)
if owner
else PermissionInfo(public_mode=PublicMode.READ)
),
)
)
return download
Expand All @@ -98,9 +100,11 @@ def set_ready(self, download_id: str, use_notification: bool = True) -> None:
Event(
type=EventType.DOWNLOAD_READY,
payload=download.to_dto(),
permissions=PermissionInfo(owner=download.owner)
if download.owner
else PermissionInfo(public_mode=PublicMode.READ),
permissions=(
PermissionInfo(owner=download.owner)
if download.owner
else PermissionInfo(public_mode=PublicMode.READ)
),
)
)

Expand All @@ -116,9 +120,11 @@ def fail(self, download_id: str, reason: str = "") -> None:
Event(
type=EventType.DOWNLOAD_FAILED,
payload=download.to_dto(),
permissions=PermissionInfo(owner=download.owner)
if download.owner
else PermissionInfo(public_mode=PublicMode.READ),
permissions=(
PermissionInfo(owner=download.owner)
if download.owner
else PermissionInfo(public_mode=PublicMode.READ)
),
)
)

Expand Down Expand Up @@ -185,9 +191,11 @@ def _clean_up_expired_downloads(self, file_downloads: List[FileDownload]) -> Non
Event(
type=EventType.DOWNLOAD_EXPIRED,
payload=download_id,
permissions=PermissionInfo(owner=download_owner)
if download_owner
else PermissionInfo(public_mode=PublicMode.READ),
permissions=(
PermissionInfo(owner=download_owner)
if download_owner
else PermissionInfo(public_mode=PublicMode.READ)
),
)
)

Expand Down
12 changes: 9 additions & 3 deletions antarest/service_creator.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,15 @@ def create_event_bus(app_ctxt: t.Optional[AppBuildContext], config: Config) -> t
)


def create_core_services(
app_ctxt: t.Optional[AppBuildContext], config: Config
) -> t.Tuple[ICache, IEventBus, ITaskService, FileTransferManager, LoginService, MatrixService, StudyService,]:
def create_core_services(app_ctxt: t.Optional[AppBuildContext], config: Config) -> t.Tuple[
ICache,
IEventBus,
ITaskService,
FileTransferManager,
LoginService,
MatrixService,
StudyService,
]:
event_bus, redis_client = create_event_bus(app_ctxt, config)
cache = build_cache(config=config, redis_client=redis_client)
filetransfer_service = build_filetransfer_service(app_ctxt, event_bus, config)
Expand Down
8 changes: 5 additions & 3 deletions antarest/study/business/general_management.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,9 +307,11 @@ def __get_building_mode_update_cmds(

return [
UpdateConfig(
target=f"{GENERAL_PATH}/custom-scenario"
if study_version >= STUDY_VERSION_8
else f"{GENERAL_PATH}/custom-ts-numbers",
target=(
f"{GENERAL_PATH}/custom-scenario"
if study_version >= STUDY_VERSION_8
else f"{GENERAL_PATH}/custom-ts-numbers"
),
data=new_value == BuildingMode.CUSTOM,
command_context=cmd_context,
study_version=study_version,
Expand Down
Loading

0 comments on commit e5d9996

Please sign in to comment.