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

Add sanic as an entry point command #1866

Merged
merged 4 commits into from
Jun 5, 2020
Merged

Add sanic as an entry point command #1866

merged 4 commits into from
Jun 5, 2020

Conversation

ahopkins
Copy link
Member

@ahopkins ahopkins commented Jun 2, 2020

One thing that I have always thought missing was this:

$ sanic server.app --port=5000 --workers=4

Since we already have...

$ python -m sanic server.app --port=5000 --workers=4

... this PR just goes one step further to adding the entrypoint to run the Sanic server with the sanic command.

@codecov
Copy link

codecov bot commented Jun 3, 2020

Codecov Report

Merging #1866 into master will increase coverage by 0.01%.
The diff coverage is 87.50%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1866      +/-   ##
==========================================
+ Coverage   94.79%   94.81%   +0.01%     
==========================================
  Files          24       24              
  Lines        2307     2314       +7     
  Branches      421      422       +1     
==========================================
+ Hits         2187     2194       +7     
  Misses         75       75              
  Partials       45       45              
Impacted Files Coverage Δ
sanic/__main__.py 76.92% <87.50%> (+5.04%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fa4f85e...eeb5777. Read the comment docs.

Copy link
Member

@yunstanford yunstanford left a comment

Choose a reason for hiding this comment

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

IMO, probably better to expose entry_points via "entry_points/console_scripts" in setup.py

@ashleysommer
Copy link
Member

ashleysommer commented Jun 5, 2020

@yunstanford

probably better to expose entry_points via "entry_points/console_scripts" in setup.py

I might be wrong, but I believe that is what this PR provides.

@ahopkins
Copy link
Member Author

ahopkins commented Jun 5, 2020

Exactly.

@yunstanford
Copy link
Member

ahh, sorry, didn't read that carefully.. just saw that

if __name__ == "__main__":
    main()

and thought differentlly.

@yunstanford yunstanford merged commit 496e87e into master Jun 5, 2020
@ahopkins ahopkins deleted the sanic-command branch July 29, 2020 10:43
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.

3 participants