commit cb674a9642090f23ed41fc75fbba133195a9f375 Author: Corentin Séchet Date: Sun May 19 19:15:38 2024 +0200 chore: create project diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1ef8410 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +**/__pycache__ +jean_website.egg-info diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..f06eaad --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,15 @@ +default_stages: [commit, merge-commit, push, manual] +default_install_hook_types: [commit-msg, pre-commit] +repos: + - repo: https://github.com/compilerla/conventional-pre-commit + rev: v2.3.0 + hooks: + - id: conventional-pre-commit + stages: [commit-msg] + args: [] + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.3.3 + hooks: + - id: ruff + args: [ --fix ] + - id: ruff-format diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29 diff --git a/jwebsite/__init__.py b/jwebsite/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/jwebsite/cli.py b/jwebsite/cli.py new file mode 100644 index 0000000..2df8fb7 --- /dev/null +++ b/jwebsite/cli.py @@ -0,0 +1,6 @@ +from click import command + + +@command +def main() -> None: + print("Hello world") diff --git a/noxfile.py b/noxfile.py new file mode 100644 index 0000000..c7312c9 --- /dev/null +++ b/noxfile.py @@ -0,0 +1,22 @@ +"""Nox configuration file.""" + +from nox import Session, session + + +@session() +def lint(session: Session) -> None: + session.install("ruff") + session.run("ruff", "check", "--fix") + session.run("ruff", "format") + + +@session() +def mypy(session: Session) -> None: + session.install("-e", ".[dev]") + session.install("mypy") + session.run("mypy") + + +@session() +def devenv(session: Session) -> None: + session.install("-e", ".[dev]") diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..2ebc963 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,54 @@ +[project] +name = "jean-website" +version = "0.0.1" +authors = [ + {name = "Jean-Website", email ="team@collectivit.org"} +] + +description = "Static site generator" +license = {text = "WTFPL"} + +readme = "README.md" + +dependencies = [ + "click", + "jinja2", + "pymarkdown", +] + +[project.optional-dependencies] +dev = [ + "nox", +] + +[project.scripts] +jwebsite = "jwebsite.cli:main" + +[build-system] +requires = ["setuptools>=45"] + +[tool.mypy] +strict = true +files = "jwebsite/**/*.py,noxfile.py" + +[tool.ruff] +line-length = 110 + +[tool.ruff.lint] +select = [ + "E", + "F", + "W", + "UP", + "B", + "SIM", + "I", + "N", + "U", + "YTT", + "ASYNC", + "RUF" +] + +[tool.pytest.ini_options] +asyncio_mode = "auto"