diff --git a/README.md b/README.md index 4987ca0..06fe32a 100644 --- a/README.md +++ b/README.md @@ -2,5 +2,10 @@ This is a basic static site generator for my personal website. +To generate a site to: + +``` shell +dialann --build_dir $BUILD_DIR +``` diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..ac97a31 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,104 @@ +[project] +name = "dialann" +version = "0.0.0" +authors = [ + { name="James Grogan", email="james@jmsgrogan.com" }, +] +description = "Simple static site generator." +readme = "README.md" +requires-python = ">=3.8" +classifiers = [ + "Development Status :: 3 - Alpha", + "Programming Language :: Python :: 3", + "License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)", + "Operating System :: OS Independent", + "Topic :: System :: Distributed Computing" +] +keywords = ["Publishing", "Technical Reports"] + +dependencies = ["markdown-it-py", + "mdit_py_plugins", + "mdformat", + "beautifulsoup4", + "pyspelling"] + +[project.urls] +Repository = "https://git.jmsgrogan.com/jgrogan/dialann" +Homepage = "https://git.jmsgrogan.com/jgrogan/dialann" + +[project.optional-dependencies] +test = [ + "pytest", + "pytest-cov", + "pytest-sugar", + "black", + "mypy", + "flake8", + "pylint" +] + +[build-system] +requires = ["setuptools>=61.0", "wheel"] +build-backend = "setuptools.build_meta" + +[project.scripts] +dialann = "dialann.main_cli:main_cli" + +[tool.setuptools.package-data] +"dialann" = ["py.typed"] + +[tool.setuptools.packages.find] +where = ["src"] + +[tool.pytest.ini_options] +testpaths = ["test",] +log_cli = 1 +log_cli_level = "debug" +addopts = "--cov=dialann --cov-report term --cov-report xml:coverage.xml --cov-report html" + +[tool.mypy] +ignore_missing_imports = true + +[tool.tox] +legacy_tox_ini = """ +[tox] +requires = + tox>=4 +env_list = lint, type, style, py{311}, docs +skip_missing_interpreters = true + +[testenv] +description = run unit tests +deps = + pytest>=7 + pytest-cov + pytest-sugar +commands = + pytest {posargs:test} + +[testenv:lint] +description = run linters +skip_install = true +deps = + black +commands = black {posargs:src} + +[testenv:style] +description = run style check +skip_install = true +deps = + flake8 +commands = flake8 {posargs:src} + +[testenv:type] +description = run type checks +deps = + mypy>=0.991 +commands = + mypy {posargs:src test} + +[testenv:docs] +changedir = docs +deps = sphinx +commands = sphinx-build -W -b html -d {envtmpdir}/doctrees . {envtmpdir}/html +""" \ No newline at end of file diff --git a/src/dialann/main_cli.py b/src/dialann/main_cli.py new file mode 100644 index 0000000..62f39cd --- /dev/null +++ b/src/dialann/main_cli.py @@ -0,0 +1,23 @@ +#!/usr/bin/env python3 +import argparse +import logging +from pathlib import Path + +logger = logging.getLogger(__name__) + +def generate(build_dir: Path): + + pass + +def main_cli(): + parser = argparse.ArgumentParser() + parser.add_argument( + "--build_dir", + type=Path, + help="Path to the build output", + ) + args = parser.parse_args() + generate(args.build_dir) + +if __name__ == "__main__": + main_cli()