mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
migrate configuration to PEP621 compatible config
- adapt documentation - add wheel tests to check wheel contents. - adapt pipeline to use pdm - adapt autopub config - add scripts as shortcuts to invoke tasks
This commit is contained in:
parent
c18f1a7308
commit
8b6d215934
13 changed files with 113 additions and 1495 deletions
7
pelican/tests/build_test/conftest.py
Normal file
7
pelican/tests/build_test/conftest.py
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
def pytest_addoption(parser):
|
||||
parser.addoption(
|
||||
"--check-wheel",
|
||||
action="store",
|
||||
default=False,
|
||||
help="Check wheel contents.",
|
||||
)
|
||||
28
pelican/tests/build_test/test_wheel.py
Normal file
28
pelican/tests/build_test/test_wheel.py
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
from pathlib import Path
|
||||
import pytest
|
||||
from zipfile import ZipFile
|
||||
|
||||
|
||||
@pytest.mark.skipif(
|
||||
"not config.getoption('--check-wheel')",
|
||||
reason="Only run when --check-wheel is given",
|
||||
)
|
||||
def test_wheel_contents(pytestconfig):
|
||||
"""
|
||||
This test, should test the contents of the wheel to make sure,
|
||||
that everything that is needed is included in the final build
|
||||
"""
|
||||
wheel_file = pytestconfig.getoption("--check-wheel")
|
||||
assert wheel_file.endswith(".whl")
|
||||
files_list = ZipFile(wheel_file).namelist()
|
||||
## Check is theme files are copiedto wheel
|
||||
simple_theme = Path("./pelican/themes/simple/templates")
|
||||
for x in simple_theme.iterdir():
|
||||
assert str(x) in files_list
|
||||
|
||||
## Check is tool templatesare copiedto wheel
|
||||
tools = Path("./pelican/tools/templates")
|
||||
for x in tools.iterdir():
|
||||
assert str(x) in files_list
|
||||
|
||||
assert "pelican/tools/templates/tasks.py.jinja2" in files_list
|
||||
Loading…
Add table
Add a link
Reference in a new issue