Skip to content

Commit 25aad07

Browse files
committed
Add dev container setup
1 parent a8ef67b commit 25aad07

12 files changed

+2049
-2
lines changed

.devcontainer/devcontainer.json

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
{
2+
"containerEnv": {
3+
"POETRY_VIRTUALENVS_IN_PROJECT": "true"
4+
},
5+
"customizations": {
6+
"codespaces": {
7+
"openFiles": [
8+
"README.md",
9+
"pyhilo/api.py",
10+
"pyhilo/devices.py"
11+
]
12+
},
13+
"vscode": {
14+
"extensions": [
15+
"charliermarsh.ruff",
16+
"esbenp.prettier-vscode",
17+
"esbenp.prettier-vscode",
18+
"GitHub.vscode-github-actions",
19+
"GitHub.vscode-pull-request-github",
20+
"ms-python.mypy-type-checker",
21+
"ms-python.pylint",
22+
"ms-python.python",
23+
"ms-python.vscode-pylance",
24+
"redhat.vscode-yaml",
25+
"redhat.vscode-yaml",
26+
"ryanluker.vscode-ecoverage-gutters",
27+
"visualstudioexptteam.vscodeintellicode"
28+
],
29+
"settings": {
30+
"[python]": {
31+
"editor.codeActionsOnSave": {
32+
"source.fixAll": true,
33+
"source.organizeImports": true,
34+
"files.trimTrailingWhitespace": true
35+
}
36+
},
37+
"coverage-gutters.customizable.context-menu": true,
38+
"coverage-gutters.customizable.status-bar-toggler-watchCoverageAndVisibleEditors-enabled": true,
39+
"coverage-gutters.showGutterCoverage": false,
40+
"coverage-gutters.showLineCoverage": true,
41+
"coverage-gutters.xmlname": "coverage.xml",
42+
"python.analysis.extraPaths": ["${workspaceFolder}/pyhilo"],
43+
"python.defaultInterpreterPath": ".venv/bin/python",
44+
"python.formatting.provider": "ruff",
45+
"python.testing.cwd": "${workspaceFolder}",
46+
"python.testing.pytestArgs": ["--cov-report=xml"],
47+
"python.testing.pytestEnabled": true,
48+
"ruff.importStrategy": "fromEnvironment",
49+
"ruff.interpreter": [".venv/bin/python"],
50+
"terminal.integrated.defaultProfile.linux": "zsh"
51+
}
52+
}
53+
},
54+
"features": {
55+
"ghcr.io/devcontainers-contrib/features/poetry:2": {},
56+
"ghcr.io/devcontainers/features/github-cli:1": {},
57+
"ghcr.io/devcontainers/features/node:1": {},
58+
"ghcr.io/devcontainers/features/python:1": {
59+
"installTools": false
60+
}
61+
},
62+
"image": "mcr.microsoft.com/devcontainers/python:3",
63+
"name": "A Python3, async interface to the Hilo API",
64+
"updateContentCommand": ". ${NVM_DIR}/nvm.sh && nvm install && nvm use && npm install && poetry install && poetry run pre-commit install"
65+
}

.editorconfig

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
indent_style = space
7+
insert_final_newline = true
8+
trim_trailing_whitespace = true
9+
indent_size = 2
10+
11+
[*.md]
12+
trim_trailing_whitespace = false

.gitattributes

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
* text eol=lf
2+
*.py whitespace=error

.gitignore

+7-1
Original file line numberDiff line numberDiff line change
@@ -132,4 +132,10 @@ dmypy.json
132132
.DS_Store
133133

134134
# Pycharm stuff
135-
*.idea
135+
*.idea
136+
137+
# Optional npm cache directory
138+
.npm
139+
140+
# Dependency directories
141+
node_modules/

.nvmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
22.14.0

.prettierignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.gitignore

.yamllint

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
---
2+
ignore:
3+
- .venv
4+
rules:
5+
braces:
6+
level: error
7+
min-spaces-inside: 0
8+
max-spaces-inside: 1
9+
min-spaces-inside-empty: -1
10+
max-spaces-inside-empty: -1
11+
brackets:
12+
level: error
13+
min-spaces-inside: 0
14+
max-spaces-inside: 0
15+
min-spaces-inside-empty: -1
16+
max-spaces-inside-empty: -1
17+
colons:
18+
level: error
19+
max-spaces-before: 0
20+
max-spaces-after: 1
21+
commas:
22+
level: error
23+
max-spaces-before: 0
24+
min-spaces-after: 1
25+
max-spaces-after: 1
26+
comments:
27+
level: error
28+
require-starting-space: true
29+
min-spaces-from-content: 1
30+
comments-indentation:
31+
level: error
32+
document-end:
33+
level: error
34+
present: false
35+
document-start:
36+
level: error
37+
present: true
38+
empty-lines:
39+
level: error
40+
max: 1
41+
max-start: 0
42+
max-end: 1
43+
hyphens:
44+
level: error
45+
max-spaces-after: 1
46+
indentation:
47+
level: error
48+
spaces: 2
49+
indent-sequences: true
50+
check-multi-line-strings: false
51+
key-duplicates:
52+
level: error
53+
line-length:
54+
level: warning
55+
max: 120
56+
allow-non-breakable-words: true
57+
allow-non-breakable-inline-mappings: true
58+
new-line-at-end-of-file:
59+
level: error
60+
new-lines:
61+
level: error
62+
type: unix
63+
trailing-spaces:
64+
level: error
65+
truthy:
66+
level: error

package-lock.json

+32
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"name": "python-hilo",
3+
"version": "2025.2.2",
4+
"private": true,
5+
"description": "A Python3, async interface to the Hilo API",
6+
"scripts": {
7+
"prettier": "prettier --write **/*.{json,js,md,yml,yaml} *.{json,js,md,yml,yaml}"
8+
},
9+
"author": "David Vallee Delisle <[email protected]>",
10+
"license": "MIT",
11+
"devDependencies": {
12+
"prettier": "3.5.1"
13+
}
14+
}

0 commit comments

Comments
 (0)