1
0
Fork 0
forked from github/pelican

Support for python -m pelican

Addresses https://github.com/getpelican/pelican/issues/2523

Note: @avaris made a good point that there is no need to replace the existing
module runner for pelican quickstart or the other tools as this can be run
via:

> python -m pelican.tools.pelican_quickstart
This commit is contained in:
Tim Gates 2019-06-12 17:02:49 +10:00
commit 4bae94834e
No known key found for this signature in database
GPG key ID: AE3BE0D53823CF05
3 changed files with 18 additions and 1 deletions

10
pelican/__main__.py Normal file
View file

@ -0,0 +1,10 @@
"""
python -m pelican module entry point to run via python -m
"""
from __future__ import absolute_import
from . import main
if __name__ == '__main__':
main()

View file

@ -263,3 +263,10 @@ class TestPelican(LoggedTestCase):
count=1,
msg="Could not process .*parse_error.rst",
level=logging.ERROR)
def test_module_load(self):
"""Test loading via python -m pelican --help displays the help"""
output = subprocess.check_output([
sys.executable, '-m', 'pelican', '--help'
]).decode('ascii', 'replace')
assert 'usage:' in output

View file

@ -12,7 +12,7 @@ requires = ['feedgenerator >= 1.9', 'jinja2 >= 2.7', 'pygments', 'docutils',
entry_points = {
'console_scripts': [
'pelican = pelican:main',
'pelican = pelican.__main__:main',
'pelican-import = pelican.tools.pelican_import:main',
'pelican-quickstart = pelican.tools.pelican_quickstart:main',
'pelican-themes = pelican.tools.pelican_themes:main'