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

fix: module params #967

Merged
merged 1 commit into from
Sep 28, 2024
Merged

Conversation

VishnuSanal
Copy link
Contributor

Description

This PR fixes #966

Summary

This PR fixes params issue when running as a module

PR Checklist

Please ensure that:

  • The PR contains a descriptive title
  • The PR contains a descriptive summary of the changes
  • You build and test your changes before submitting a PR.
  • You have added relevant documentation
  • You have added relevant tests. We prefer integration tests wherever possible

Pre-Commit Instructions:

Copy link

vercel bot commented Sep 24, 2024

@VishnuSanal is attempting to deploy a commit to the sparckles Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Contributor Author

@VishnuSanal VishnuSanal left a comment

Choose a reason for hiding this comment

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

it would suffice to pass argv values directly to the subprocess, since we are def doing the argument parsing inside Robyn#init. the previous issue was changes getting overwritten from robyn#init (when doing Config() call in the ocnstructor.)

also, there were issues with #parse_known_args returning a log_level=DEBUG & the config expecting a log-level=DEBUG. similarly for disable openapi

Comment on lines -93 to -100
# Parsing the known and unknown arguments
known_arguments, unknown_args = config.parser.parse_known_args()
command = [sys.executable]

# Convert known arguments to a list of strings suitable for subprocess.run
known_args_list = [f"{key}={value}" for key, value in vars(known_arguments).items() if value is not None]

# Combine the python executable, unknown arguments, and known arguments
command = [sys.executable, *unknown_args, *known_args_list]
Copy link
Contributor Author

@VishnuSanal VishnuSanal Sep 24, 2024

Choose a reason for hiding this comment

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

@sansyrox please enlighten me on why there was the need for this much jargon here...? ! 🤔 were there a reason to not pass them directly? am I missing somehtign?

Copy link
Member

Choose a reason for hiding this comment

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

@VishnuSanal , good find. I don't see a reason why this should exist.

Let me do a final review

@VishnuSanal
Copy link
Contributor Author

The failing tests are that of the web sockets, please try rerunning.

Copy link

codspeed-hq bot commented Sep 26, 2024

CodSpeed Performance Report

Merging #967 will not alter performance

Comparing VishnuSanal:fix-module-params (b520e93) with main (399f5b1)

Summary

✅ 116 untouched benchmarks

Copy link

vercel bot commented Sep 28, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
robyn ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 28, 2024 0:24am

Copy link
Member

@sansyrox sansyrox left a comment

Choose a reason for hiding this comment

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

LGTM! 👍 🔥

@sansyrox
Copy link
Member

Great work @VishnuSanal !

@sansyrox sansyrox merged commit 88f6b5b into sparckles:main Sep 28, 2024
60 checks passed
@VishnuSanal VishnuSanal deleted the fix-module-params branch September 28, 2024 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

log level reseting when invoking the server command through robyn app.py --log-level=DEBUG
2 participants