From a7833aab17dbada9022bc38604874d66f43ebac9 Mon Sep 17 00:00:00 2001 From: Cordero Core <127983572+uwcdc@users.noreply.github.com> Date: Thu, 31 Oct 2024 19:54:25 +0000 Subject: [PATCH] chore: Add pixi, Codespaces, and pre-commit support --- .coveragerc | 3 ++ .devcontainer/postBuild.sh | 0 .gitattributes | 2 + .github/dependabot.yml | 11 +++++ .gitignore | 5 +- .pre-commit-config.yaml | 97 ++++++++++++++++++++++++++++++++++++++ pixi.toml | 11 +++++ 7 files changed, 128 insertions(+), 1 deletion(-) create mode 100644 .coveragerc create mode 100644 .devcontainer/postBuild.sh create mode 100644 .gitattributes create mode 100644 .github/dependabot.yml create mode 100644 .pre-commit-config.yaml create mode 100644 pixi.toml diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 0000000..bb5cdb2 --- /dev/null +++ b/.coveragerc @@ -0,0 +1,3 @@ +[run] +omit = + */version.py \ No newline at end of file diff --git a/.devcontainer/postBuild.sh b/.devcontainer/postBuild.sh new file mode 100644 index 0000000..e69de29 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..07fe41c --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# GitHub syntax highlighting +pixi.lock linguist-language=YAML linguist-generated=true diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..4556ff4 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,11 @@ +version: 2 +updates: + # Maintain dependencies for GitHub Actions + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" + groups: + actions: + patterns: + - "*" \ No newline at end of file diff --git a/.gitignore b/.gitignore index 5ecd3fc..9287c8d 100644 --- a/.gitignore +++ b/.gitignore @@ -138,4 +138,7 @@ dmypy.json version.py # data -*.nc \ No newline at end of file +*.nc +# pixi environments +.pixi +*.egg-info diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..3cfda96 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,97 @@ +exclude: | + (?x)^( + docs/conf.py + ) + +ci: + autoupdate_commit_msg: "chore: update pre-commit hooks" + autofix_commit_msg: "style: pre-commit fixes" + +repos: + - repo: https://github.com/adamchainz/blacken-docs + rev: "1.18.0" + hooks: + - id: blacken-docs + additional_dependencies: [black==24.*] + + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: "v4.6.0" + hooks: + - id: check-added-large-files + - id: check-case-conflict + - id: check-merge-conflict + - id: check-symlinks + - id: check-yaml + - id: debug-statements + - id: end-of-file-fixer + - id: mixed-line-ending + - id: name-tests-test + args: ["--pytest-test-first"] + - id: requirements-txt-fixer + - id: trailing-whitespace + + - repo: https://github.com/pre-commit/pygrep-hooks + rev: "v1.10.0" + hooks: + - id: rst-backticks + - id: rst-directive-colons + - id: rst-inline-touching-normal + + - repo: https://github.com/pre-commit/mirrors-prettier + rev: "v4.0.0-alpha.8" + hooks: + - id: prettier + types_or: [yaml, markdown, html, css, scss, javascript, json] + args: [--prose-wrap=always] + + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: "v0.5.5" + hooks: + - id: ruff + args: ["--fix", "--show-fixes"] + - id: ruff-format + + - repo: https://github.com/pre-commit/mirrors-mypy + rev: "v1.11.0" + hooks: + - id: mypy + files: src|tests + args: [] + additional_dependencies: + - pytest + + - repo: https://github.com/codespell-project/codespell + rev: "v2.3.0" + hooks: + - id: codespell + + - repo: https://github.com/shellcheck-py/shellcheck-py + rev: "v0.10.0.1" + hooks: + - id: shellcheck + + - repo: local + hooks: + - id: disallow-caps + name: Disallow improper capitalization + language: pygrep + entry: PyBind|Numpy|Cmake|CCache|Github|PyTest + exclude: .pre-commit-config.yaml + + - repo: https://github.com/abravalheri/validate-pyproject + rev: "v0.18" + hooks: + - id: validate-pyproject + additional_dependencies: ["validate-pyproject-schema-store[all]"] + + - repo: https://github.com/python-jsonschema/check-jsonschema + rev: "0.29.1" + hooks: + - id: check-dependabot + - id: check-github-workflows + - id: check-readthedocs + + - repo: https://github.com/scientific-python/cookie + rev: "2024.04.23" + hooks: + - id: sp-repo-review \ No newline at end of file diff --git a/pixi.toml b/pixi.toml new file mode 100644 index 0000000..5f014f0 --- /dev/null +++ b/pixi.toml @@ -0,0 +1,11 @@ +[project] +authors = ["Cordero Core <127983572+uwcdc@users.noreply.github.com>"] +channels = ["conda-forge"] +description = "Add a short description here" +name = "biodiversity-horizons" +platforms = ["linux-64"] +version = "0.1.0" + +[tasks] + +[dependencies]