Skip to content
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

feat: improve CLI parameter handling and cleanup unused code #4002

Merged
merged 10 commits into from
Oct 3, 2024

Conversation

italojohnny
Copy link
Member

This PR refines CLI parameter handling, adds default path values, enforces parameter hierarchy, and removes unused code for improved maintainability.

Fixes #3820

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. enhancement New feature or request labels Oct 3, 2024
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Oct 3, 2024
Copy link

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-4002.dmtpw4p5recq1.amplifyapp.com

@italojohnny
Copy link
Member Author

...reviewing the unit tests

Copy link
Contributor

@ogabrielluiz ogabrielluiz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Oct 3, 2024
@italojohnny italojohnny enabled auto-merge (squash) October 3, 2024 14:17
workers: int = typer.Option(1, help="Number of worker processes.", envvar="LANGFLOW_WORKERS"),
timeout: int = typer.Option(300, help="Worker timeout in seconds.", envvar="LANGFLOW_WORKER_TIMEOUT"),
port: int = typer.Option(7860, help="Port to listen on.", envvar="LANGFLOW_PORT"),
host: str | None = typer.Option(None, help="Host to bind the server to.", show_default=False),
Copy link
Collaborator

@cbornet cbornet Oct 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not related to this PR but it would probably be nice to use the syntax host: Annotated[str | None, typer.Option(None, help="Host to bind the server to.", show_default=False)] = None` for all the params for better type checking.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried applying the suggestion, but the code started breaking. I'll take a closer look at it later.

components_path: Path | None = typer.Option(
Path(__file__).parent / "components",
str(Path(__file__).parent / "components"),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should components_path type be changed to str ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops... that was a small oversight. It should be Path

@italojohnny italojohnny enabled auto-merge (squash) October 3, 2024 15:57
@italojohnny italojohnny merged commit ed7ec6a into main Oct 3, 2024
29 checks passed
@italojohnny italojohnny deleted the fix/config-priority-hierarchy branch October 3, 2024 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request lgtm This PR has been approved by a maintainer size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

langflow not respecting env file.
3 participants