Skip to content

Commit

Permalink
Make Conan/Python installs available for whole project and not just t…
Browse files Browse the repository at this point in the history
…he AboutDialog

Generation of dependency list now happens in
Also cleaned up the AboutDialog.qml

CURA-10561
  • Loading branch information
casperlamboo committed Oct 19, 2023
1 parent 5f998f0 commit 6f1adaa
Show file tree
Hide file tree
Showing 10 changed files with 280 additions and 362 deletions.
20 changes: 9 additions & 11 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ jobs:
run: conan config set storage.download_cache="$HOME/.conan/conan_download_cache"

- name: Create the Packages (Bash)
run: conan install $CURA_CONAN_VERSION ${{ inputs.conan_args }} --build=missing --update -if cura_inst -g VirtualPythonEnv -o cura:enterprise=$ENTERPRISE -o cura:staging=$STAGING --json "cura_inst/conan_install_info.json"
run: conan install $CURA_CONAN_VERSION ${{ inputs.conan_args }} --build=missing --update -if cura_inst -g VirtualPythonEnv -o cura:enterprise=$ENTERPRISE -o cura:staging=$STAGING

- name: Upload the Package(s)
if: always()
Expand Down Expand Up @@ -206,12 +206,7 @@ jobs:
import json
from pathlib import Path
conan_install_info_path = Path("cura_inst/conan_install_info.json")
conan_info = {"installed": []}
if os.path.exists(conan_install_info_path):
with open(conan_install_info_path, "r") as f:
conan_info = json.load(f)
sorted_deps = sorted([dep["recipe"]["id"].replace('#', r' rev: ') for dep in conan_info["installed"]])
from cura.CuraVersion import ConanInstalls
summary_env = os.environ["GITHUB_STEP_SUMMARY"]
content = ""
Expand All @@ -223,14 +218,17 @@ jobs:
f.write(content)
f.writelines("# ${{ steps.filename.outputs.INSTALLER_FILENAME }}\n")
f.writelines("## Conan packages:\n")
for dep in sorted_deps:
f.writelines(f"`{dep}`\n")
for dep_name, dep_info in ConanDependencies.items():
f.writelines(f"`{dep_name} {dep_info["version"]} {dep_info["revision"]}`\n")
- name: Summarize the used Python modules
shell: python
run: |
import os
import pkg_resources
from cura.CuraVersion import ConanDependencies
summary_env = os.environ["GITHUB_STEP_SUMMARY"]
content = ""
if os.path.exists(summary_env):
Expand All @@ -240,8 +238,8 @@ jobs:
with open(summary_env, "w") as f:
f.write(content)
f.writelines("## Python modules:\n")
for package in pkg_resources.working_set:
f.writelines(f"`{package.key}/{package.version}`\n")
for dep_name, dep_info in ConanDependencies.items():
f.writelines(f"`{dep_name} {dep_info["version"]}`\n")
- name: Create the Linux AppImage (Bash)
run: |
Expand Down
20 changes: 9 additions & 11 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ jobs:
run: conan config set storage.download_cache="$HOME/.conan/conan_download_cache"

- name: Create the Packages (Bash)
run: conan install $CURA_CONAN_VERSION ${{ inputs.conan_args }} --build=missing --update -if cura_inst -g VirtualPythonEnv -o cura:enterprise=$ENTERPRISE -o cura:staging=$STAGING --json "cura_inst/conan_install_info.json"
run: conan install $CURA_CONAN_VERSION ${{ inputs.conan_args }} --build=missing --update -if cura_inst -g VirtualPythonEnv -o cura:enterprise=$ENTERPRISE -o cura:staging=$STAGING"

- name: Upload the Package(s)
if: ${{ inputs.operating_system != 'self-hosted' }}
Expand Down Expand Up @@ -210,12 +210,7 @@ jobs:
import json
from pathlib import Path
conan_install_info_path = Path("cura_inst/conan_install_info.json")
conan_info = {"installed": []}
if os.path.exists(conan_install_info_path):
with open(conan_install_info_path, "r") as f:
conan_info = json.load(f)
sorted_deps = sorted([dep["recipe"]["id"].replace('#', r' rev: ') for dep in conan_info["installed"]])
from cura.CuraVersion import ConanInstalls
summary_env = os.environ["GITHUB_STEP_SUMMARY"]
content = ""
Expand All @@ -227,14 +222,17 @@ jobs:
f.write(content)
f.writelines("# ${{ steps.filename.outputs.INSTALLER_FILENAME }}\n")
f.writelines("## Conan packages:\n")
for dep in sorted_deps:
f.writelines(f"`{dep}`\n")
for dep_name, dep_info in ConanDependencies.items():
f.writelines(f"`{dep_name} {dep_info["version"]} {dep_info["revision"]}`\n")
- name: Summarize the used Python modules
shell: python
run: |
import os
import pkg_resources
from cura.CuraVersion import PythonInstalls
summary_env = os.environ["GITHUB_STEP_SUMMARY"]
content = ""
if os.path.exists(summary_env):
Expand All @@ -244,8 +242,8 @@ jobs:
with open(summary_env, "w") as f:
f.write(content)
f.writelines("## Python modules:\n")
for package in pkg_resources.working_set:
f.writelines(f"`{package.key}/{package.version}`\n")
for dep_name, dep_info in ConanDependencies.items():
f.writelines(f"`{dep_name} {dep_info["version"]}`\n")
- name: Create the Macos dmg (Bash)
run: python ../cura_inst/packaging/MacOS/build_macos.py --source_path ../cura_inst --dist_path . --cura_conan_version $CURA_CONAN_VERSION --filename "${{ steps.filename.outputs.INSTALLER_FILENAME }}" --build_dmg --build_pkg --app_name "$CURA_APP_NAME"
Expand Down
20 changes: 9 additions & 11 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ jobs:
run: conan config set storage.download_cache="C:\Users\runneradmin\.conan\conan_download_cache"

- name: Create the Packages (Powershell)
run: conan install $Env:CURA_CONAN_VERSION ${{ inputs.conan_args }} --build=missing --update -if cura_inst -g VirtualPythonEnv -o cura:enterprise=$Env:ENTERPRISE -o cura:staging=$Env:STAGING --json "cura_inst/conan_install_info.json"
run: conan install $Env:CURA_CONAN_VERSION ${{ inputs.conan_args }} --build=missing --update -if cura_inst -g VirtualPythonEnv -o cura:enterprise=$Env:ENTERPRISE -o cura:staging=$Env:STAGING

- name: Upload the Package(s)
if: always()
Expand Down Expand Up @@ -169,12 +169,7 @@ jobs:
import json
from pathlib import Path
conan_install_info_path = Path("cura_inst/conan_install_info.json")
conan_info = {"installed": []}
if os.path.exists(conan_install_info_path):
with open(conan_install_info_path, "r") as f:
conan_info = json.load(f)
sorted_deps = sorted([dep["recipe"]["id"].replace('#', r' rev: ') for dep in conan_info["installed"]])
from cura.CuraVersion import ConanInstalls
summary_env = os.environ["GITHUB_STEP_SUMMARY"]
content = ""
Expand All @@ -186,14 +181,17 @@ jobs:
f.write(content)
f.writelines("# ${{ steps.filename.outputs.INSTALLER_FILENAME }}\n")
f.writelines("## Conan packages:\n")
for dep in sorted_deps:
f.writelines(f"`{dep}`\n")
for dep_name, dep_info in ConanDependencies.items():
f.writelines(f"`{dep_name} {dep_info["version"]} {dep_info["revision"]}`\n")
- name: Summarize the used Python modules
shell: python
run: |
import os
import pkg_resources
from cura.CuraVersion import PythonInstalls
summary_env = os.environ["GITHUB_STEP_SUMMARY"]
content = ""
if os.path.exists(summary_env):
Expand All @@ -203,8 +201,8 @@ jobs:
with open(summary_env, "w") as f:
f.write(content)
f.writelines("## Python modules:\n")
for package in pkg_resources.working_set:
f.writelines(f"`{package.key}/{package.version}`\n")
for dep_name, dep_info in ConanDependencies.items():
f.writelines(f"`{dep_name} {dep_info["version"]}`\n")
- name: Create PFX certificate from BASE64_PFX_CONTENT secret
id: create-pfx
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ graph_info.json
Ultimaker-Cura.spec
.run/
/printer-linter/src/printerlinter.egg-info/
/resources/qml/Dialogs/AboutDialogVersionsList.qml
/plugins/CuraEngineGradualFlow
/resources/bundled_packages/bundled_*.json
curaengine_plugin_gradual_flow
Expand Down
61 changes: 0 additions & 61 deletions AboutDialogVersionsList.qml.jinja

This file was deleted.

5 changes: 4 additions & 1 deletion CuraVersion.py.jinja
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2022 UltiMaker
# Copyright (c) 2023 UltiMaker
# Cura is released under the terms of the LGPLv3 or higher.

CuraAppName = "{{ cura_app_name }}"
Expand All @@ -12,3 +12,6 @@ CuraCloudAccountAPIRoot = "{{ cura_cloud_account_api_root }}"
CuraMarketplaceRoot = "{{ cura_marketplace_root }}"
CuraDigitalFactoryURL = "{{ cura_digital_factory_url }}"
CuraLatestURL = "{{ cura_latest_url }}"

ConanInstalls = {{ conan_installs }}
PythonInstalls = {{ python_installs }}
Loading

0 comments on commit 6f1adaa

Please sign in to comment.