From 11e0ecbe7b191cededffa56d3d49c91394448bd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Menard?= Date: Sun, 12 Nov 2023 11:05:47 -0500 Subject: [PATCH] build(tools): update project tools, settings, configs and enable profile --- .gitattributes | 2 ++ .github/workflows/semantic-pull-request.yaml | 21 ++++++++++++++++++++ .gitignore | 7 ------- .vscode/Python.code-profile | 1 + poetry.lock | 16 ++++++++++++++- pyproject.toml | 11 ++++++++-- src/__init__.py | 1 + 7 files changed, 49 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/semantic-pull-request.yaml create mode 100644 .vscode/Python.code-profile create mode 100644 src/__init__.py diff --git a/.gitattributes b/.gitattributes index e7c1d93..f4ba1f5 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1,4 @@ # Auto detect text files and perform LF normalization * text eol=lf +*.png binary +*.ico binary diff --git a/.github/workflows/semantic-pull-request.yaml b/.github/workflows/semantic-pull-request.yaml new file mode 100644 index 0000000..e1f38ba --- /dev/null +++ b/.github/workflows/semantic-pull-request.yaml @@ -0,0 +1,21 @@ +--- +name: semantic-pull-request +# description: Validate pull request title + +on: + pull_request_target: + types: + - opened + - edited + - synchronize + +permissions: + pull-requests: read + +jobs: + validate: + runs-on: ubuntu-latest + steps: + - uses: amannn/action-semantic-pull-request@v5 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index 43bb807..0dae5ad 100644 --- a/.gitignore +++ b/.gitignore @@ -1,11 +1,7 @@ # environments .env .venv/ -env/ venv/ -ENV/ -env.bak/ -venv.bak/ # mkdocs site/ @@ -36,6 +32,3 @@ __pycache__/ # tests coverage/ - -# vscode -.vscode/ diff --git a/.vscode/Python.code-profile b/.vscode/Python.code-profile new file mode 100644 index 0000000..a072eeb --- /dev/null +++ b/.vscode/Python.code-profile @@ -0,0 +1 @@ +{"name":"PY","settings":"{\"settings\":\"{\\r\\n \\\"workbench.colorTheme\\\": \\\"Default Dark Modern\\\",\\r\\n \\\"terminal.integrated.defaultProfile.windows\\\": \\\"Git Bash\\\",\\r\\n \\\"workbench.panel.defaultLocation\\\": \\\"right\\\",\\r\\n \\\"autoDocstring.docstringFormat\\\": \\\"numpy\\\",\\r\\n \\\"[css][html][handlebars][hbs][django-html][jinja-html][json][jsonc][markdown][python][scss][toml][yaml]\\\": {\\r\\n \\\"editor.formatOnSave\\\": true,\\r\\n \\\"editor.codeActionsOnSave\\\": {\\r\\n \\\"source.fixAll\\\": true\\r\\n }\\r\\n },\\r\\n \\\"[css][html][json][jsonc][scss][yaml]\\\": {\\r\\n \\\"editor.defaultFormatter\\\": \\\"esbenp.prettier-vscode\\\"\\r\\n },\\r\\n \\\"[handlebars][hbs][django-html][jinja-html]\\\": {\\r\\n \\\"editor.defaultFormatter\\\": \\\"monosans.djlint\\\",\\r\\n \\\"djlint.enableLinting\\\": true\\r\\n },\\r\\n \\\"[handlebars][hbs]\\\": {\\r\\n \\\"djlint.profile\\\": \\\"handlebars\\\"\\r\\n },\\r\\n \\\"[django-html]\\\": {\\r\\n \\\"djlint.profile\\\": \\\"django\\\"\\r\\n },\\r\\n \\\"[jinja-html]\\\": {\\r\\n \\\"djlint.profile\\\": \\\"jinja\\\"\\r\\n },\\r\\n \\\"[json][jsonc]\\\": {\\r\\n \\\"files.insertFinalNewline\\\": true\\r\\n },\\r\\n \\\"[markdown]\\\": {\\r\\n \\\"editor.defaultFormatter\\\": \\\"DavidAnson.vscode-markdownlint\\\"\\r\\n },\\r\\n \\\"[python]\\\": {\\r\\n \\\"editor.defaultFormatter\\\": \\\"ms-python.black-formatter\\\"\\r\\n },\\r\\n \\\"[toml]\\\": {\\r\\n \\\"editor.defaultFormatter\\\": \\\"tamasfe.even-better-toml\\\"\\r\\n }\\r\\n}\\r\\n\"}","extensions":"[{\"identifier\":{\"id\":\"charliermarsh.ruff\",\"uuid\":\"c2ca9b43-fa38-44fc-928e-5125970b9c00\"},\"displayName\":\"Ruff\"},{\"identifier\":{\"id\":\"davidanson.vscode-markdownlint\",\"uuid\":\"daf8b44d-8aae-4da2-80c5-1f770219f643\"},\"displayName\":\"markdownlint\"},{\"identifier\":{\"id\":\"eamodio.gitlens\",\"uuid\":\"4de763bd-505d-4978-9575-2b7696ecf94e\"},\"displayName\":\"GitLens — Git supercharged\"},{\"identifier\":{\"id\":\"esbenp.prettier-vscode\",\"uuid\":\"96fa4707-6983-4489-b7c5-d5ffdfdcce90\"},\"displayName\":\"Prettier - Code formatter\"},{\"identifier\":{\"id\":\"kevinrose.vsc-python-indent\",\"uuid\":\"f3cbfb84-b1e1-40ff-b70f-877253461260\"},\"displayName\":\"Python Indent\"},{\"identifier\":{\"id\":\"mikestead.dotenv\",\"uuid\":\"532533c9-a894-4a58-9eee-bbfbe7c06f71\"},\"displayName\":\"DotENV\"},{\"identifier\":{\"id\":\"monosans.djlint\",\"uuid\":\"181ca32f-b54d-46ed-a851-c7fa71ec4108\"},\"displayName\":\"djLint\"},{\"identifier\":{\"id\":\"mrmlnc.vscode-scss\",\"uuid\":\"beb68b20-7c55-471c-9b63-3486f9423566\"},\"displayName\":\"SCSS IntelliSense\"},{\"identifier\":{\"id\":\"ms-python.black-formatter\",\"uuid\":\"859e640c-c157-47da-8699-9080b81c8371\"},\"displayName\":\"Black Formatter\"},{\"identifier\":{\"id\":\"ms-python.python\",\"uuid\":\"f1f59ae4-9318-4f3c-a9b5-81b2eaa5f8a5\"},\"displayName\":\"Python\"},{\"identifier\":{\"id\":\"ms-python.vscode-pylance\",\"uuid\":\"364d2426-116a-433a-a5d8-a5098dc3afbd\"},\"displayName\":\"Pylance\"},{\"identifier\":{\"id\":\"njpwerner.autodocstring\",\"uuid\":\"2d6fea35-f68e-461d-9b7b-5cd05be99451\"},\"displayName\":\"autoDocstring - Python Docstring Generator\"},{\"identifier\":{\"id\":\"redhat.vscode-yaml\",\"uuid\":\"2061917f-f76a-458a-8da9-f162de22b97e\"},\"displayName\":\"YAML\"},{\"identifier\":{\"id\":\"stylelint.vscode-stylelint\",\"uuid\":\"ec35b5a3-9802-4c68-b5ff-e85f19ec0977\"},\"displayName\":\"Stylelint\"},{\"identifier\":{\"id\":\"tamasfe.even-better-toml\",\"uuid\":\"b2215d5f-675e-4a2b-b6ac-1ca737518b78\"},\"displayName\":\"Even Better TOML\"},{\"identifier\":{\"id\":\"visualstudioexptteam.intellicode-api-usage-examples\",\"uuid\":\"9fa2a00e-3bfa-4c2a-abc4-a865bb2b5cf3\"},\"displayName\":\"IntelliCode API Usage Examples\"},{\"identifier\":{\"id\":\"visualstudioexptteam.vscodeintellicode\",\"uuid\":\"876e8f93-74d0-4f4f-91b7-34a09f19f444\"},\"displayName\":\"IntelliCode\"},{\"identifier\":{\"id\":\"yzhang.markdown-all-in-one\",\"uuid\":\"98790d67-10fa-497c-9113-f6c7489207b2\"},\"displayName\":\"Markdown All in One\"}]"} \ No newline at end of file diff --git a/poetry.lock b/poetry.lock index 3fb6250..ec32f0f 100644 --- a/poetry.lock +++ b/poetry.lock @@ -985,6 +985,20 @@ files = [ [package.dependencies] six = ">=1.5" +[[package]] +name = "python-dotenv" +version = "1.0.0" +description = "Read key-value pairs from a .env file and set them as environment variables" +optional = false +python-versions = ">=3.8" +files = [ + {file = "python-dotenv-1.0.0.tar.gz", hash = "sha256:a8df96034aae6d2d50a4ebe8216326c61c3eb64836776504fcca410e5937a3ba"}, + {file = "python_dotenv-1.0.0-py3-none-any.whl", hash = "sha256:f5971a9226b701070a4bf2c38c89e5a3f0d64de8debda981d1db98583009122a"}, +] + +[package.extras] +cli = ["click (>=5.0)"] + [[package]] name = "pyyaml" version = "6.0.1" @@ -1431,4 +1445,4 @@ testing = ["big-O", "jaraco.functools", "jaraco.itertools", "more-itertools", "p [metadata] lock-version = "2.0" python-versions = "^3.11.1" -content-hash = "2c6de5766488659677e190041f25033fba05bd6c666694f74e718c046910555c" +content-hash = "a22f56efae22f4625f7b3f20080b6b97da09020fa415ad3b473ca77c9e8d78b5" diff --git a/pyproject.toml b/pyproject.toml index d089069..43cdf99 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,7 +22,7 @@ classifiers = [ "Operating System :: OS Independent", "Programming Language :: Python", ] -packages = [] +packages = [{ include = "*", from = "src" }] include = [{ path = "tests", format = "sdist" }] exclude = [] @@ -41,7 +41,7 @@ directory = "./coverage/html" output = "./coverage/lcov.info" [tool.coverage.report] -fail_under = 100 +# fail_under = 100 show_missing = true exclude_lines = ["if __name__ == \"__main__\":", "def __repr__", "def __str__"] @@ -54,12 +54,15 @@ omit = ["**/__init__.py", "**/__main__.py"] [tool.djlint] use_gitignore = true +ignore = "H006" [tool.mypy] ignore_missing_imports = true [tool.pymarkdown] plugins.line-length.enabled = false +plugins.first-line-h1.enabled = false +plugins.no-inline-html.enabled = false [tool.pytest.ini_options] pythonpath = "src" @@ -92,6 +95,9 @@ exclude = [] [tool.ruff.per-file-ignores] "tests/**/*.py" = ["S101", "PLR2004"] +[tool.ruff.pydocstyle] +convention = "numpy" + [tool.yamlfix] comments_min_spaces_from_content = 1 preserve_quotes = true @@ -100,6 +106,7 @@ whitelines = 1 [tool.poetry.dependencies] python = "^3.11.1" +python-dotenv = "^1.0.0" [tool.poetry.group.dev.dependencies] diff --git a/src/__init__.py b/src/__init__.py new file mode 100644 index 0000000..e5f6dba --- /dev/null +++ b/src/__init__.py @@ -0,0 +1 @@ +"""Package Source."""