From a98a8c76d55e5144aee070a64d46334b2dc3d3bc Mon Sep 17 00:00:00 2001 From: Ayush Shukla <71904196+ayushuk@users.noreply.github.com> Date: Fri, 17 May 2024 14:59:56 -0700 Subject: [PATCH] =?UTF-8?q?Revert=20"=F0=9F=94=96=20Release=203.5.2"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pip_version | 2 +- pros/cli/conductor.py | 2 +- pros/conductor/conductor.py | 46 ++++++++++++++++++++++++------------- version | 2 +- win_version | 2 +- 5 files changed, 34 insertions(+), 20 deletions(-) diff --git a/pip_version b/pip_version index 80d13b7d..3c8ff8c3 100644 --- a/pip_version +++ b/pip_version @@ -1 +1 @@ -3.5.2 \ No newline at end of file +3.5.1 \ No newline at end of file diff --git a/pros/cli/conductor.py b/pros/cli/conductor.py index 38d43235..00a0ecb5 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 tuple(project.templates.keys()): + for template in 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 3a07f7e5..41ccbd11 100644 --- a/pros/conductor/conductor.py +++ b/pros/conductor/conductor.py @@ -282,8 +282,6 @@ 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("") @@ -296,14 +294,26 @@ 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?') 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) @@ -323,16 +333,6 @@ 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},' @@ -358,8 +358,22 @@ 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 use_early_access: - ui.echo(f'Early access is enabled. Experimental features have been applied.') + 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 not is_pathname_valid(str(Path(path).absolute())): raise dont_send(ValueError('Project path contains invalid characters.')) diff --git a/version b/version index 80d13b7d..3c8ff8c3 100644 --- a/version +++ b/version @@ -1 +1 @@ -3.5.2 \ No newline at end of file +3.5.1 \ No newline at end of file diff --git a/win_version b/win_version index 64b6522a..eebed617 100644 --- a/win_version +++ b/win_version @@ -1 +1 @@ -3.5.2.0 \ No newline at end of file +3.5.1.0 \ No newline at end of file