-
Notifications
You must be signed in to change notification settings - Fork 34
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
✨Create new project without internet #175
base: develop
Are you sure you want to change the base?
Conversation
new-project now has an --allow-online/--no-online switch that allows for creating a project with or without remote templates. also, made a helper _create_project function that new_project calls FIXME: ConnectionErrors are not being caught (to make projects with local templates if no internet), unpoggers!
Will elaborate in PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unless anyone else has any other comments, this seems to work and be good based on the test cases.
I'd rather just fix e.g. try block around: pros-cli/pros/conductor/conductor.py Lines 119 to 124 in 1d9f6ba
|
…ub.com/purduesigbots/pros-cli into origin/feature/new-project-no-internet
When I try to have the try in resolve_templates it generates a bunch of error messages, seemingly because it doesn't like calling itself... but makes the project anyways? I have no idea |
I'm not seeing the try except block anywhere, have you pushed it yet? Also, what are you doing with the exception after catching it? It seems like it's just getting printed and moving on. |
This thing spits out duplicate warnings (2 for kernel and 2 for okapilib) dunno why
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm approving this so we can get this shipped out the door a little quicker. The cosmetic issue of the warning appearing twice should be a seperate issue we open after the PR and somebody else could handle it as their entry level issue :P . Great work!
Summary:
new-project
to decide if remote templates can be used in creating projectsnew-project
into new helper function_create_project
for this purpose (and to make click happy)resolved_templates
so that it actually takes into account whether 'download-ok' is true or false before downloading from remoteallow_online: bool = True
from top ofresolve_templates
to make above features workallow_online=download_ok
fromtemplate = self.resolve_template(identifier=identifier, allow_online=download_ok, **kwargs)
becauseresolve_templates
now takes 'download_ok' into account seperatelyMotivation:
Let users make new project from local templates without internet
References (optional):
Closes #91
Test Plan:
(With internet) Purge templates, download 2nd most recent versions of okapilib and kernel, then run
pros c n . --no-download
to demonstrate that the most recent remote templates are not applied, and the local templates are used instead(Without internet) Create a new project with
pros c n .
. There will be an error that alerts the user that the CLI can't connect to GitHub, and it creates a project with the local templates you have instead.(Without internet)
pros c n . --download
. Even if --download is specified, if there is no internet it creates from local templates without problem.(With internet)
pros c n .
. Newest versions of templates from remote are automatically downloaded and applied as usual.(Without internet)
pros c n .
creates a new project with the most recent local templates.