From 022dc571f78748841a1f0c95da114a22738e39c4 Mon Sep 17 00:00:00 2001 From: Mayank Patibandla <34776435+mayankpatibandla@users.noreply.github.com> Date: Wed, 1 May 2024 18:23:59 -0400 Subject: [PATCH 1/5] =?UTF-8?q?=F0=9F=9A=B8=20Apply=20liblvgl=20when=20upg?= =?UTF-8?q?rading=20to=20PROS=204=20(#345)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Apply liblvgl when upgrading from PROS 3 to PROS 4 * Fetch template if necessary --- pros/cli/conductor.py | 2 +- pros/conductor/conductor.py | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/pros/cli/conductor.py b/pros/cli/conductor.py index 00a0ecb5..38d43235 100644 --- a/pros/cli/conductor.py +++ b/pros/cli/conductor.py @@ -159,7 +159,7 @@ def upgrade(ctx: click.Context, project: c.Project, query: c.BaseTemplate, **kwa """ analytics.send("upgrade-project") if not query.name: - for template in project.templates.keys(): + for template in tuple(project.templates.keys()): click.secho(f'Upgrading {template}', color='yellow') q = c.BaseTemplate.create_query(name=template, target=project.target, supported_kernels=project.templates['kernel'].version) diff --git a/pros/conductor/conductor.py b/pros/conductor/conductor.py index fb40d7e1..8e0d9e44 100644 --- a/pros/conductor/conductor.py +++ b/pros/conductor/conductor.py @@ -282,6 +282,8 @@ def apply_template(self, project: Project, identifier: Union[str, BaseTemplate], raise dont_send( InvalidTemplateException(f'Could not find a template satisfying {identifier} for {project.target}')) + apply_liblvgl = False # flag to apply liblvgl if upgrading to PROS 4 + # warn and prompt user if upgrading to PROS 4 or downgrading to PROS 3 if template.name == 'kernel': isProject = Project.find_project("") @@ -294,6 +296,7 @@ def apply_template(self, project: Project, identifier: Union[str, BaseTemplate], if not confirm: raise dont_send( InvalidTemplateException(f'Not upgrading')) + apply_liblvgl = True if template.version[0] == '3' and curr_proj.kernel[0] == '4': confirm = ui.confirm(f'Warning! Downgrading project to PROS 3 will cause breaking changes. ' f'Do you still want to downgrade?') @@ -333,6 +336,16 @@ def apply_template(self, project: Project, identifier: Union[str, BaseTemplate], force_user=kwargs.pop('force_user', False), remove_empty_directories=kwargs.pop('remove_empty_directories', False)) ui.finalize('apply', f'Finished applying {template.identifier} to {project.location}') + + # Apply liblvgl if upgrading to PROS 4 + if apply_liblvgl: + template = self.resolve_template(identifier="liblvgl", allow_online=download_ok, early_access=True) + if not isinstance(template, LocalTemplate): + with ui.Notification(): + template = self.fetch_template(self.get_depot(template.metadata['origin']), template, **kwargs) + assert isinstance(template, LocalTemplate) + project.apply_template(template) + ui.finalize('apply', f'Finished applying {template.identifier} to {project.location}') elif valid_action != TemplateAction.AlreadyInstalled: raise dont_send( InvalidTemplateException(f'Could not install {template.identifier} because it is {valid_action.name},' From 3335d172720bc0c0a6b41c0a9e5be0e67fdcd30c Mon Sep 17 00:00:00 2001 From: Ayush Shukla <71904196+ayushuk@users.noreply.github.com> Date: Tue, 7 May 2024 18:05:21 -0400 Subject: [PATCH 2/5] =?UTF-8?q?=F0=9F=A7=B9=20Remove=20PROS=204=20Prompts?= =?UTF-8?q?=20(#346)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pros/conductor/conductor.py | 33 +++------------------------------ 1 file changed, 3 insertions(+), 30 deletions(-) diff --git a/pros/conductor/conductor.py b/pros/conductor/conductor.py index 8e0d9e44..6c8c7235 100644 --- a/pros/conductor/conductor.py +++ b/pros/conductor/conductor.py @@ -303,20 +303,7 @@ def apply_template(self, project: Project, identifier: Union[str, BaseTemplate], if not confirm: raise dont_send( InvalidTemplateException(f'Not downgrading')) - elif not project.use_early_access and template.version[0] == '3' and not self.warn_early_access: - confirm = ui.confirm(f'PROS 4 is now in early access. ' - f'Please use the --early-access flag if you would like to use it.\n' - f'Do you want to use PROS 4 instead?') - self.warn_early_access = True - if confirm: # use pros 4 - project.use_early_access = True - project.save() - kwargs['version'] = '>=0' - kwargs['early_access'] = True - # Recall the function with early access enabled - return self.apply_template(project, identifier, **kwargs) - - self.save() + if not isinstance(template, LocalTemplate): with ui.Notification(): template = self.fetch_template(self.get_depot(template.metadata['origin']), template, **kwargs) @@ -371,22 +358,8 @@ def new_project(self, path: str, no_default_libs: bool = False, **kwargs) -> Pro else: use_early_access = self.use_early_access kwargs["early_access"] = use_early_access - if kwargs["version_source"]: # If true, then the user has not specified a version - if not use_early_access and self.warn_early_access: - ui.echo(f"PROS 4 is now in early access. " - f"If you would like to use it, use the --early-access flag.") - elif not use_early_access and not self.warn_early_access: - confirm = ui.confirm(f'PROS 4 is now in early access. ' - f'Please use the --early-access flag if you would like to use it.\n' - f'Do you want to use PROS 4 instead?') - self.warn_early_access = True - if confirm: - use_early_access = True - kwargs['early_access'] = True - elif use_early_access: - ui.echo(f'Early access is enabled. Using PROS 4.') - elif use_early_access: - ui.echo(f'Early access is enabled.') + if use_early_access: + ui.echo(f'Early access is enabled. Experimental features have been applied.') if not is_pathname_valid(str(Path(path).absolute())): raise dont_send(ValueError('Project path contains invalid characters.')) From 58927151b279ef723ac5ad0640b7cb026ad53501 Mon Sep 17 00:00:00 2001 From: Ayush Shukla <71904196+ayushuk@users.noreply.github.com> Date: Tue, 7 May 2024 18:10:16 -0400 Subject: [PATCH 3/5] =?UTF-8?q?=F0=9F=94=80=20Backmerge=20master=20(#339)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update version numbers * 🐛 Fix default template selection #318 * Update version numbers * Update version numbers --------- Co-authored-by: BennyBot <48661356+BennyBot@users.noreply.github.com> --- pip_version | 2 +- pros/conductor/conductor.py | 1 + version | 2 +- win_version | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/pip_version b/pip_version index e5b82034..3c8ff8c3 100644 --- a/pip_version +++ b/pip_version @@ -1 +1 @@ -3.5.0 \ No newline at end of file +3.5.1 \ No newline at end of file diff --git a/pros/conductor/conductor.py b/pros/conductor/conductor.py index 6c8c7235..3a07f7e5 100644 --- a/pros/conductor/conductor.py +++ b/pros/conductor/conductor.py @@ -382,6 +382,7 @@ def new_project(self, path: str, no_default_libs: bool = False, **kwargs) -> Pro if not no_default_libs: 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 + for library in libraries[proj.target]: try: # remove kernel version so that latest template satisfying query is correctly selected diff --git a/version b/version index e5b82034..3c8ff8c3 100644 --- a/version +++ b/version @@ -1 +1 @@ -3.5.0 \ No newline at end of file +3.5.1 \ No newline at end of file diff --git a/win_version b/win_version index ec9d2348..eebed617 100644 --- a/win_version +++ b/win_version @@ -1 +1 @@ -3.5.0.0 \ No newline at end of file +3.5.1.0 \ No newline at end of file From 842a79f59a1911926dbdb8147eaab63243d2b3c6 Mon Sep 17 00:00:00 2001 From: Ayush Shukla <71904196+ayushuk@users.noreply.github.com> Date: Fri, 17 May 2024 19:00:08 -0400 Subject: [PATCH 4/5] =?UTF-8?q?=F0=9F=A7=B9Remove=20Okapilib=20as=20a=20de?= =?UTF-8?q?fault=20template=20for=20PROS=204=20(#351)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pros/conductor/conductor.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pros/conductor/conductor.py b/pros/conductor/conductor.py index 3a07f7e5..4b195283 100644 --- a/pros/conductor/conductor.py +++ b/pros/conductor/conductor.py @@ -383,6 +383,9 @@ def new_project(self, path: str, no_default_libs: bool = False, **kwargs) -> Pro if not no_default_libs: 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 + if kwargs['version'][0] == '>' or kwargs['version'][0] == '4': + libraries[proj.target].remove('okapilib') + for library in libraries[proj.target]: try: # remove kernel version so that latest template satisfying query is correctly selected From f64e9df4ce5fa9c919208d7a7ee92f5f28a840f2 Mon Sep 17 00:00:00 2001 From: ayushuk Date: Fri, 17 May 2024 20:28:55 -0700 Subject: [PATCH 5/5] Update version numbers --- pip_version | 2 +- version | 2 +- win_version | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pip_version b/pip_version index 3c8ff8c3..87ce4929 100644 --- a/pip_version +++ b/pip_version @@ -1 +1 @@ -3.5.1 \ No newline at end of file +3.5.2 diff --git a/version b/version index 3c8ff8c3..87ce4929 100644 --- a/version +++ b/version @@ -1 +1 @@ -3.5.1 \ No newline at end of file +3.5.2 diff --git a/win_version b/win_version index eebed617..fcb1d758 100644 --- a/win_version +++ b/win_version @@ -1 +1 @@ -3.5.1.0 \ No newline at end of file +3.5.2.0