Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CURA-11939 upgrade to python 3.12 #19218

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
2 changes: 1 addition & 1 deletion conandata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ requirements:
- "cura_binary_data/(latest)@ultimaker/testing"
- "fdm_materials/(latest)@ultimaker/testing"
- "curaengine_plugin_gradual_flow/0.1.0-beta.3"
- "dulcificum/latest@ultimaker/testing"
- "dulcificum/0.3.0"
- "pysavitar/5.3.0"
- "pynest2d/5.3.0"
- "curaengine_grpc_definitions/0.2.0"
Expand Down
6 changes: 3 additions & 3 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from conan.tools.scm import Version
from conan.errors import ConanInvalidConfiguration, ConanException

required_conan_version = ">=1.58.0 <2.0.0"
required_conan_version = ">=1.64.0 <2.0.0"


class CuraConan(ConanFile):
Expand Down Expand Up @@ -176,7 +176,7 @@ def _python_installs(self):
inner = "'" if self.settings.os == "Windows" else '"'
buffer = StringIO()
with venv_vars.apply():
self.run(f"""python -c {outer}import pkg_resources; print({inner};{inner}.join([(s.key+{inner},{inner}+ s.version) for s in pkg_resources.working_set])){outer}""",
self.run(f"""python -c {outer}import importlib.metadata; print({inner};{inner}.join([(package.metadata[{inner}Name{inner}]+{inner},{inner}+ package.metadata[{inner}Version{inner}]) for package in importlib.metadata.distributions()])){outer}""",
env = "conanrun",
output = buffer)

Expand Down Expand Up @@ -351,7 +351,7 @@ def requirements(self):
if self._internal:
for req in self.conan_data["requirements_internal"]:
self.requires(req)
self.requires("cpython/3.10.4@ultimaker/stable")
self.requires("cpython/3.12.2")
self.requires("clipper/6.4.2@ultimaker/stable")
self.requires("openssl/3.2.0")
self.requires("protobuf/3.21.12")
Expand Down
2 changes: 1 addition & 1 deletion plugins/PostProcessingPlugin/Script.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def getValue(self, line: str, key: str, default = None) -> Any:
if not key in line or (';' in line and line.find(key) > line.find(';')):
return default
sub_part = line[line.find(key) + 1:]
m = re.search('^-?[0-9]+\.?[0-9]*', sub_part)
m = re.search(r'^-?[0-9]+\.?[0-9]*', sub_part)
if m is None:
return default
try:
Expand Down
2 changes: 1 addition & 1 deletion plugins/PostProcessingPlugin/scripts/ColorMix.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def getValue(self, line, key, default = None): #replace default getvalue due to
m = re.search("^[+-]?[0-9]*", subPart)
else:
#the minus at the beginning allows for negative values, e.g. for delta printers
m = re.search("^[-]?[0-9]*\.?[0-9]*", subPart)
m = re.search(r"^[-]?[0-9]*\.?[0-9]*", subPart)
if m == None:
return default
try:
Expand Down
2 changes: 1 addition & 1 deletion plugins/PostProcessingPlugin/scripts/PauseAtHeight.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ def execute(self, data: List[str]) -> List[str]:
nbr_negative_layers += 1

#Track the latest printing temperature in order to resume at the correct temperature.
if re.match("T(\d*)", line):
if re.match(r"T(\d*)", line):
current_t = self.getValue(line, "T")
m = self.getValue(line, "M")
if m is not None and (m == 104 or m == 109) and self.getValue(line, "S") is not None:
Expand Down
2 changes: 1 addition & 1 deletion plugins/UM3NetworkPrinting/src/ExportFileJob.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def __init__(self, file_handler: Optional[FileHandler], nodes: List[SceneNode],

# Determine the filename.
job_name = CuraApplication.getInstance().getPrintInformation().jobName
job_name = re.sub("[^\w\-. ()]", "-", job_name)
job_name = re.sub(r"[^\w\-. ()]", "-", job_name)
extension = self._mesh_format_handler.preferred_format.get("extension", "")
self.setFileName("{}.{}".format(job_name, extension))

Expand Down
6 changes: 3 additions & 3 deletions plugins/USBPrinting/USBPrinterOutputDevice.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,8 @@ def _update(self):
self.sendCommand("M105")
self._last_temperature_request = time()

if re.search(b"[B|T\d*]: ?\d+\.?\d*", line): # Temperature message. 'T:' for extruder and 'B:' for bed
extruder_temperature_matches = re.findall(b"T(\d*): ?(\d+\.?\d*)\s*\/?(\d+\.?\d*)?", line)
if re.search(r"[B|T\d*]: ?\d+\.?\d*", line): # Temperature message. 'T:' for extruder and 'B:' for bed
extruder_temperature_matches = re.findall(r"T(\d*): ?(\d+\.?\d*)\s*\/?(\d+\.?\d*)?", line)
# Update all temperature values
matched_extruder_nrs = []
for match in extruder_temperature_matches:
Expand All @@ -300,7 +300,7 @@ def _update(self):
if match[2]:
extruder.updateTargetHotendTemperature(float(match[2]))

bed_temperature_matches = re.findall(b"B: ?(\d+\.?\d*)\s*\/?(\d+\.?\d*)?", line)
bed_temperature_matches = re.findall(r"B: ?(\d+\.?\d*)\s*\/?(\d+\.?\d*)?", line)
if bed_temperature_matches:
match = bed_temperature_matches[0]
if match[0]:
Expand Down
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
pytest
pyinstaller==6.3.0
pyinstaller==6.8.0
pyinstaller-hooks-contrib
pyyaml
sip==6.5.1
Expand Down
Loading
Loading