Skip to content

Commit

Permalink
Environment setup
Browse files Browse the repository at this point in the history
  • Loading branch information
tyler-richardett committed Nov 21, 2024
1 parent 1b569a4 commit a571b4b
Show file tree
Hide file tree
Showing 6 changed files with 1,653 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.222.0/containers/python-3-miniconda
{
"name": "${localWorkspaceFolderBasename}",
"image": "mcr.microsoft.com/devcontainers/python:3.10",
"features": {
"ghcr.io/devcontainers-contrib/features/poetry:2": {}
},
"remoteEnv": {
"WORKSPACE": "${containerWorkspaceFolder}"
},
"postCreateCommand": [
"/bin/sh",
"-c",
"/bin/sh ./.devcontainer/postCreateCommand.sh"
],
"customizations": {
"vscode": {
"extensions": [
"ms-python.python",
"charliermarsh.ruff",
"ms-toolsai.jupyter",
"ms-vscode.makefile-tools",
"tamasfe.even-better-toml",
"editorconfig.editorconfig",
"github.vscode-pull-request-github",
"njpwerner.autodocstring",
"ryanluker.vscode-coverage-gutters"
],
"settings": {
"editor.formatOnSave": true,
"editor.formatOnPaste": true,
"[json]": {
"editor.defaultFormatter": "vscode.json-language-features"
},
"[python]": {
"editor.defaultFormatter": "charliermarsh.ruff"
},
"python.defaultInterpreterPath": "/workspaces/${localWorkspaceFolderBasename}/.venv/bin/python",
"python.terminal.activateEnvInCurrentTerminal": true,
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true,
"python.testing.pytestPath": "/workspaces/${localWorkspaceFolderBasename}/.venv/bin/pytest",
"python.testing.pytestArgs": ["tests"]
}
}
}
}
10 changes: 10 additions & 0 deletions .devcontainer/postCreateCommand.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#! /usr/bin/env bash

# Install dependencies
poetry install --no-root

# Mark the workspace folder as safe
git config --global --add safe.directory ${WORKSPACE}

# Install pre-commit hooks
poetry run pre-commit install --install-hooks
29 changes: 29 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: "v4.4.0"
hooks:
- id: check-case-conflict
- id: check-merge-conflict
- id: check-toml
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.6.8"
hooks:
- id: ruff
args: [--exit-non-zero-on-fix]
- id: ruff-format

- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v3.0.3"
hooks:
- id: prettier

- repo: https://github.com/PyCQA/docformatter
rev: v1.7.5
hooks:
- id: docformatter
additional_dependencies: [tomli]
args: ["--config", "./pyproject.toml"]
Loading

0 comments on commit a571b4b

Please sign in to comment.