Skip to content

Commit d8b8a6a

Browse files
authored
Merge pull request #353 from purduesigbots/release/3.5.2
🔖 Release 3.5.2
2 parents 1c5aa00 + 9bc2c5a commit d8b8a6a

File tree

5 files changed

+23
-34
lines changed

5 files changed

+23
-34
lines changed

pip_version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.5.1
1+
3.5.2

pros/cli/conductor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ def upgrade(ctx: click.Context, project: c.Project, query: c.BaseTemplate, **kwa
159159
"""
160160
analytics.send("upgrade-project")
161161
if not query.name:
162-
for template in project.templates.keys():
162+
for template in tuple(project.templates.keys()):
163163
click.secho(f'Upgrading {template}', color='yellow')
164164
q = c.BaseTemplate.create_query(name=template, target=project.target,
165165
supported_kernels=project.templates['kernel'].version)

pros/conductor/conductor.py

Lines changed: 19 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,8 @@ def apply_template(self, project: Project, identifier: Union[str, BaseTemplate],
282282
raise dont_send(
283283
InvalidTemplateException(f'Could not find a template satisfying {identifier} for {project.target}'))
284284

285+
apply_liblvgl = False # flag to apply liblvgl if upgrading to PROS 4
286+
285287
# warn and prompt user if upgrading to PROS 4 or downgrading to PROS 3
286288
if template.name == 'kernel':
287289
isProject = Project.find_project("")
@@ -294,26 +296,14 @@ def apply_template(self, project: Project, identifier: Union[str, BaseTemplate],
294296
if not confirm:
295297
raise dont_send(
296298
InvalidTemplateException(f'Not upgrading'))
299+
apply_liblvgl = True
297300
if template.version[0] == '3' and curr_proj.kernel[0] == '4':
298301
confirm = ui.confirm(f'Warning! Downgrading project to PROS 3 will cause breaking changes. '
299302
f'Do you still want to downgrade?')
300303
if not confirm:
301304
raise dont_send(
302305
InvalidTemplateException(f'Not downgrading'))
303-
elif not project.use_early_access and template.version[0] == '3' and not self.warn_early_access:
304-
confirm = ui.confirm(f'PROS 4 is now in early access. '
305-
f'Please use the --early-access flag if you would like to use it.\n'
306-
f'Do you want to use PROS 4 instead?')
307-
self.warn_early_access = True
308-
if confirm: # use pros 4
309-
project.use_early_access = True
310-
project.save()
311-
kwargs['version'] = '>=0'
312-
kwargs['early_access'] = True
313-
# Recall the function with early access enabled
314-
return self.apply_template(project, identifier, **kwargs)
315-
316-
self.save()
306+
317307
if not isinstance(template, LocalTemplate):
318308
with ui.Notification():
319309
template = self.fetch_template(self.get_depot(template.metadata['origin']), template, **kwargs)
@@ -333,6 +323,16 @@ def apply_template(self, project: Project, identifier: Union[str, BaseTemplate],
333323
force_user=kwargs.pop('force_user', False),
334324
remove_empty_directories=kwargs.pop('remove_empty_directories', False))
335325
ui.finalize('apply', f'Finished applying {template.identifier} to {project.location}')
326+
327+
# Apply liblvgl if upgrading to PROS 4
328+
if apply_liblvgl:
329+
template = self.resolve_template(identifier="liblvgl", allow_online=download_ok, early_access=True)
330+
if not isinstance(template, LocalTemplate):
331+
with ui.Notification():
332+
template = self.fetch_template(self.get_depot(template.metadata['origin']), template, **kwargs)
333+
assert isinstance(template, LocalTemplate)
334+
project.apply_template(template)
335+
ui.finalize('apply', f'Finished applying {template.identifier} to {project.location}')
336336
elif valid_action != TemplateAction.AlreadyInstalled:
337337
raise dont_send(
338338
InvalidTemplateException(f'Could not install {template.identifier} because it is {valid_action.name},'
@@ -358,22 +358,8 @@ def new_project(self, path: str, no_default_libs: bool = False, **kwargs) -> Pro
358358
else:
359359
use_early_access = self.use_early_access
360360
kwargs["early_access"] = use_early_access
361-
if kwargs["version_source"]: # If true, then the user has not specified a version
362-
if not use_early_access and self.warn_early_access:
363-
ui.echo(f"PROS 4 is now in early access. "
364-
f"If you would like to use it, use the --early-access flag.")
365-
elif not use_early_access and not self.warn_early_access:
366-
confirm = ui.confirm(f'PROS 4 is now in early access. '
367-
f'Please use the --early-access flag if you would like to use it.\n'
368-
f'Do you want to use PROS 4 instead?')
369-
self.warn_early_access = True
370-
if confirm:
371-
use_early_access = True
372-
kwargs['early_access'] = True
373-
elif use_early_access:
374-
ui.echo(f'Early access is enabled. Using PROS 4.')
375-
elif use_early_access:
376-
ui.echo(f'Early access is enabled.')
361+
if use_early_access:
362+
ui.echo(f'Early access is enabled. Experimental features have been applied.')
377363

378364
if not is_pathname_valid(str(Path(path).absolute())):
379365
raise dont_send(ValueError('Project path contains invalid characters.'))
@@ -397,6 +383,9 @@ def new_project(self, path: str, no_default_libs: bool = False, **kwargs) -> Pro
397383
if not no_default_libs:
398384
libraries = self.early_access_libraries if proj.use_early_access and (kwargs.get("version", ">").startswith("4") or kwargs.get("version", ">").startswith(">")) else self.default_libraries
399385

386+
if kwargs['version'][0] == '>' or kwargs['version'][0] == '4':
387+
libraries[proj.target].remove('okapilib')
388+
400389
for library in libraries[proj.target]:
401390
try:
402391
# remove kernel version so that latest template satisfying query is correctly selected

version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.5.1
1+
3.5.2

win_version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.5.1.0
1+
3.5.2.0

0 commit comments

Comments
 (0)