mirror of
https://github.com/getpelican/pelican.git
synced 2026-06-06 11:56:55 +02:00
Move livereload import inside docserve()
This fixes 'invoke setup' failing in fresh virtual environments. The top-level import of livereload caused tasks.py to fail on import before any task could execute, since livereload is a dev dependency only installed by pdm during the setup process.
This commit is contained in:
parent
de6df5ef7a
commit
91d6a1b1e3
2 changed files with 5 additions and 1 deletions
3
RELEASE.md
Normal file
3
RELEASE.md
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
Release type: patch
|
||||
|
||||
Move livereload import inside docserve() to fix invoke setup in fresh environments
|
||||
3
tasks.py
3
tasks.py
|
|
@ -3,7 +3,6 @@ from pathlib import Path
|
|||
from shutil import which
|
||||
|
||||
from invoke import task
|
||||
from livereload import Server
|
||||
|
||||
PKG_NAME = "pelican"
|
||||
PKG_PATH = Path(PKG_NAME)
|
||||
|
|
@ -30,6 +29,8 @@ def docbuild(c):
|
|||
@task(docbuild)
|
||||
def docserve(c):
|
||||
"""Serve docs at http://localhost:$DOCS_PORT/ (default port is 8000)"""
|
||||
from livereload import Server # noqa: PLC0415
|
||||
|
||||
server = Server()
|
||||
server.watch("docs/conf.py", lambda: docbuild(c))
|
||||
server.watch("CONTRIBUTING.rst", lambda: docbuild(c))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue