mirror of
https://github.com/getpelican/pelican.git
synced 2026-06-02 02:46:55 +02:00
fix: Move livereload import inside docserve() task
This fixes `invoke setup` failing in fresh virtual environments. The top-level import of `livereload` caused tasks.py to fail before any task could execute, since `livereload` is a development dependency only installed by PDM as part of the setup task.
This commit is contained in:
parent
de6df5ef7a
commit
77e88ae3f2
1 changed files with 2 additions and 1 deletions
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