Skip to content

Commit

Permalink
✨ Move PROS 4 to early access (#296)
Browse files Browse the repository at this point in the history
* mini-cleanup

* start "stablizing" beta

* deprecate v3

* v4 -> pros4

* oops + deprecation notice

* use early-access

* use new urls

* revert file validator

* Add beta alias for early access

* Slight naming adjustments

* Save early access preference

* Fix early access preference issue

* Remove whitespace

* Remove old print statement

* Apply suggestions from code review

Co-authored-by: BennyBot <48661356+BennyBot@users.noreply.github.com>

* upgrade fixes

* disable ea

* more readable

* redo early access warning

* rename flag

---------

Co-authored-by: ayushuk <ayushshukla30339@gmail.com>
Co-authored-by: Ayush Shukla <71904196+ayushuk@users.noreply.github.com>
Co-authored-by: BennyBot <48661356+BennyBot@users.noreply.github.com>
  • Loading branch information
4 people authored Jan 18, 2024
1 parent 25ea823 commit 1e32a53
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 78 deletions.
29 changes: 14 additions & 15 deletions pros/cli/conductor.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ def fetch(query: c.BaseTemplate):
help="Force apply the template, disregarding if the template is already installed.")
@click.option('--remove-empty-dirs/--no-remove-empty-dirs', 'remove_empty_directories', is_flag=True, default=True,
help='Remove empty directories when removing files')
@click.option('--beta', is_flag=True, default=False, show_default=True,
help='Allow applying beta templates')
@click.option('--early-access/--disable-early-access', '--early/--disable-early', '-ea/-dea', 'early_access', '--beta/--disable-beta', default=None,
help='Create a project using the PROS 4 kernel')
@project_option()
@template_query(required=True)
@default_options
Expand All @@ -117,8 +117,6 @@ def apply(project: c.Project, query: c.BaseTemplate, **kwargs):
help="Force apply the template, disregarding if the template is already installed.")
@click.option('--remove-empty-dirs/--no-remove-empty-dirs', 'remove_empty_directories', is_flag=True, default=True,
help='Remove empty directories when removing files')
@click.option('--beta', is_flag=True, default=False, show_default=True,
help='Allow applying beta templates')
@project_option()
@template_query(required=True)
@default_options
Expand All @@ -144,8 +142,8 @@ def install(ctx: click.Context, **kwargs):
help="Force apply the template, disregarding if the template is already installed.")
@click.option('--remove-empty-dirs/--no-remove-empty-dirs', 'remove_empty_directories', is_flag=True, default=True,
help='Remove empty directories when removing files')
@click.option('--beta', is_flag=True, default=False, show_default=True,
help='Allow upgrading to beta templates')
@click.option('--early-access/--disable-early-access', '--early/--disable-early', '-ea/-dea', 'early_access', '--beta/--disable-beta', default=None,
help='Create a project using the PROS 4 kernel')
@project_option()
@template_query(required=False)
@default_options
Expand Down Expand Up @@ -206,8 +204,8 @@ def uninstall_template(project: c.Project, query: c.BaseTemplate, remove_user: b
help='Compile the project after creation')
@click.option('--build-cache', is_flag=True, default=None, show_default=False,
help='Build compile commands cache after creation. Overrides --compile-after if both are specified.')
@click.option('--beta', is_flag=True, default=False, show_default=True,
help='Create a project with a beta template')
@click.option('--early-access/--disable-early-access', '--early/--disable-early', '-ea/-dea', 'early_access', '--beta/--disable-beta', default=None,
help='Create a project using the PROS 4 kernel')
@click.pass_context
@default_options
def new_project(ctx: click.Context, path: str, target: str, version: str,
Expand All @@ -219,6 +217,7 @@ def new_project(ctx: click.Context, path: str, target: str, version: str,
Visit https://pros.cs.purdue.edu/v5/cli/conductor.html to learn more
"""
analytics.send("new-project")
version_source = version.lower() == 'latest'
if version.lower() == 'latest' or not version:
version = '>0'
if not force_system and c.Project.find_project(path) is not None:
Expand All @@ -229,7 +228,7 @@ def new_project(ctx: click.Context, path: str, target: str, version: str,
_conductor = c.Conductor()
if target is None:
target = _conductor.default_target
project = _conductor.new_project(path, target=target, version=version,
project = _conductor.new_project(path, target=target, version=version, version_source=version_source,
force_user=force_user, force_system=force_system,
no_default_libs=no_default_libs, **kwargs)
ui.echo('New PROS Project was created:', output_machine=False)
Expand All @@ -256,13 +255,13 @@ def new_project(ctx: click.Context, path: str, target: str, version: str,
help='Force update all remote depots, ignoring automatic update checks')
@click.option('--limit', type=int, default=15,
help='The maximum number of displayed results for each library')
@click.option('--beta', is_flag=True, default=False, show_default=True,
help='View beta templates in the listing')
@click.option('--early-access/--disable-early-access', '--early/--disable-early', '-ea/-dea', 'early_access', '--beta/--disable-beta', default=None,
help='View a list of early access templates')
@template_query(required=False)
@click.pass_context
@default_options
def query_templates(ctx, query: c.BaseTemplate, allow_offline: bool, allow_online: bool, force_refresh: bool,
limit: int, beta: bool):
limit: int, early_access: bool):
"""
Query local and remote templates based on a spec
Expand All @@ -272,10 +271,10 @@ def query_templates(ctx, query: c.BaseTemplate, allow_offline: bool, allow_onlin
if limit < 0:
limit = 15
templates = c.Conductor().resolve_templates(query, allow_offline=allow_offline, allow_online=allow_online,
force_refresh=force_refresh, beta=beta)
if beta:
force_refresh=force_refresh, early_access=early_access)
if early_access:
templates += c.Conductor().resolve_templates(query, allow_offline=allow_offline, allow_online=allow_online,
force_refresh=force_refresh, beta=False)
force_refresh=force_refresh, early_access=False)

render_templates = {}
for template in templates:
Expand Down
Loading

0 comments on commit 1e32a53

Please sign in to comment.