-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Separate out the hosting CLI from main repo #2165
Conversation
config = get_config() | ||
|
||
|
||
def export( |
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.
this is the main logic inside the export typer command, rid it out into its own function so it can be passed into the hosting CLI as "callback" to run export.
# Set the log level. | ||
console.set_log_level(loglevel) | ||
|
||
# Override the config url values if provided. |
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.
this is added logic. Since hosting CLI does not have access to config, it can only pass back these for the reflex framework to override its config.
"Please provide a name for the deployed instance when not in interactive mode." | ||
) | ||
raise typer.Exit(1) | ||
|
||
dependency.check_requirements() |
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.
these are reordered to run first (they mostly should be anyway), so don't have to pass any functions into the hosting CLI.
Seems to be working for me just tried a deployment on the branch |
732d818
to
bd96790
Compare
This PR is ready. |
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.
Code looks good - just wondering if the initial requirements.txt logic creation should be moved back to this repo
reflex/reflex.py
Outdated
from reflex.utils import console, dependency, telemetry | ||
from reflex.utils import ( | ||
console, | ||
telemetry, |
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.
nit: can remove the last comma to fit this on one line
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.
👍
reflex/reflex.py
Outdated
@@ -103,7 +101,7 @@ def _init( | |||
prerequisites.initialize_gitignore() | |||
|
|||
# Initialize the requirements.txt. | |||
prerequisites.initialize_requirements_txt() | |||
dependency.initialize_requirements_txt() |
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.
Should this be part of this package since it's a bit unrelated to the hosting? The initial one will only have the reflex package in it anyways. If we want to update this it may make it harder
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.
Synced on discord. The desired code is in here now: https://discord.com/channels/@me/1141437177448906882/1179140841089007700, we'll move that back to reflex repo so open source can see what is actually done when we init.
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.
updated in the latest rev
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.
Tested a deploy and worked well for me
All Submissions:
Type of change
Please delete options that are not relevant.
New Feature Submission:
Changes To Core Features:
After these steps, you're ready to open a pull request.
reflex-hosting-cli
becomes a dependency ofreflex
, and make it>=
so it'll be easy to update hosting CLI without needing to upgrade reflex framework.websockets
,tabulate
.reflex export
command implementation by moving the underly function into its own fileutils/export.py
. This way the export util can be passed into hosting CLI as callback. Deploy command executesexport
in the middle of it. This part is less ideal, the flow of code runs back and forth. Ideally with hosting CLI as dependency, the flow should be from reflex to hosting CLI.