From a6ede540e8c6c33ba3915645dee87b6971e3df99 Mon Sep 17 00:00:00 2001 From: jspijker Date: Fri, 24 Feb 2023 11:35:46 +0100 Subject: [PATCH] Move staging urls out-of conanfile Contributes to CURA-10317 Inconsitent material profiles in internal builds --- conandata.yml | 13 +++++++++++++ conanfile.py | 36 +++++++++--------------------------- 2 files changed, 22 insertions(+), 27 deletions(-) diff --git a/conandata.yml b/conandata.yml index 1f90437ab2..ec27469dc4 100644 --- a/conandata.yml +++ b/conandata.yml @@ -1,3 +1,16 @@ +urls: + default: + cloud_api_root: "https://api.ultimaker.com" + cloud_account_api_root: "https://account.ultimaker.com" + marketplace_root: "https://marketplace.ultimaker.com" + digital_factory_url: "https://digitalfactory.ultimaker.com" + cura_latest_url: "https://software.ultimaker.com/latest.json" + staging: + cloud_api_root: "https://api-staging.ultimaker.com" + cloud_account_api_root: "https://account-staging.ultimaker.com" + marketplace_root: "https://marketplace-staging.ultimaker.com" + digital_factory_url: "https://digitalfactory-staging.ultimaker.com" + cura_latest_url: "https://software.ultimaker.com/latest.json" pyinstaller: runinfo: entrypoint: "cura_app.py" diff --git a/conanfile.py b/conanfile.py index 828e5ce34d..76baec2100 100644 --- a/conanfile.py +++ b/conanfile.py @@ -71,10 +71,6 @@ class CuraConan(ConanFile): self._cura_env.define("QT_XKB_CONFIG_ROOT", "/usr/share/X11/xkb") return self._cura_env - @property - def _staging(self): - return self.options.staging in ["True", 'true'] - @property def _enterprise(self): return self.options.enterprise in ["True", 'true'] @@ -86,24 +82,10 @@ class CuraConan(ConanFile): return str(self.options.display_name) @property - def _cloud_api_root(self): - return "https://api-staging.ultimaker.com" if self._staging else "https://api.ultimaker.com" - - @property - def _cloud_account_api_root(self): - return "https://account-staging.ultimaker.com" if self._staging else "https://account.ultimaker.com" - - @property - def _marketplace_root(self): - return "https://marketplace-staging.ultimaker.com" if self._staging else "https://marketplace.ultimaker.com" - - @property - def _digital_factory_url(self): - return "https://digitalfactory-staging.ultimaker.com" if self._staging else "https://digitalfactory.ultimaker.com" - - @property - def _cura_latest_url(self): - return "https://software.ultimaker.com/latest.json" + def _urls(self): + if self.options.staging in ["True", 'true']: + return "staging" + return "default" @property def requirements_txts(self): @@ -173,12 +155,12 @@ class CuraConan(ConanFile): cura_version = cura_version, cura_build_type = "Enterprise" if self._enterprise else "", cura_debug_mode = self.options.cura_debug_mode, - cura_cloud_api_root = self._cloud_api_root, + cura_cloud_api_root = self.conan_data["urls"][self._urls]["cloud_api_root"], cura_cloud_api_version = self.options.cloud_api_version, - cura_cloud_account_api_root = self._cloud_account_api_root, - cura_marketplace_root = self._marketplace_root, - cura_digital_factory_url = self._digital_factory_url, - cura_latest_url = self._cura_latest_url)) + cura_cloud_account_api_root = self.conan_data["urls"][self._urls]["cloud_account_api_root"], + cura_marketplace_root = self.conan_data["urls"][self._urls]["marketplace_root"], + cura_digital_factory_url = self.conan_data["urls"][self._urls]["digital_factory_url"], + cura_latest_url = self.conan_data["urls"][self._urls]["cura_latest_url"])) def _generate_pyinstaller_spec(self, location, entrypoint_location, icon_path, entitlements_file): pyinstaller_metadata = self.conan_data["pyinstaller"]