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

Implement aiohttp.web executable helper #733

Closed
asvetlov opened this issue Jan 12, 2016 · 8 comments
Closed

Implement aiohttp.web executable helper #733

asvetlov opened this issue Jan 12, 2016 · 8 comments

Comments

@asvetlov
Copy link
Member

python -m aiohttp.web HOST PORT pkg.module.main [ARGS]

See #690 for details

@asvetlov
Copy link
Member Author

Questions:

  1. How to support SSL context, do we need it at all?
  2. How to skip HOST PORT parameters and use localhost 8080?
  3. What pkg.module.main should be? I think it is either a regular function or await-able object (a coroutine or a Future) accepting ARGS. BTW I suggest pkg.module:main syntax to split import path and name inside imported module.
  4. Do we want support path-to-file instead of import-path-to-module?
  5. What's [ARGS] syntax? Is it just str params split by spaces or we want to use named parameters and apply type checking/conversions to ones?

@jashandeep-sohi
Copy link
Contributor

  1. Leave SSL out for now -- could always add a --ssl option later on that could create a SSLContext from a cert file.
  2. argparse.ArgumentParser supports optional positional arguments. Might have to move pkg.module.main argument first though. ArgumentParser.parse_known_args might also be of use to avoid parsing [ARGS].
  3. An async function that returns an web.Application instance.
  4. ?
  5. Use the leftover list of args returned by ArgumentParser.parse_known_args. The user can take care of the parsing in their main(args) implementation, if they need to.

@rutsky
Copy link
Member

rutsky commented Jan 13, 2016

  1. Perhaps do HOST PORT optional keyword arguments?
python -m aiohttp.web [--host HOST] [--port PORT] pkg.module.main [ARGS]

@asvetlov
Copy link
Member Author

Looks good.
Any volunteer?
The PR should use already merged web.run_app().

@jashandeep-sohi
Copy link
Contributor

I'll volunteer.

@asvetlov asvetlov added this to the 0.21 milestone Jan 16, 2016
@asvetlov
Copy link
Member Author

@jashandeep-sohi thank you too much. It will be significant addition, especially for newcomers.

I want to make aiohttp 0.21 release close to the end of January.
If you will not end the PR up to the date -- that's also fine, no rush. Looks like we have new release every month, 0.22 is expected in between of February last week end and March.

But, please, document the issue in PR.
You have much fluent English than me :)

@asvetlov
Copy link
Member Author

Fixed by #740

@lock
Copy link

lock bot commented Oct 29, 2019

This thread has been automatically locked since there has not been
any recent activity after it was closed. Please open a new issue for
related bugs.

If you feel like there's important points made in this discussion,
please include those exceprts into that new issue.

@lock lock bot added the outdated label Oct 29, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants