Skip to content

Commit

Permalink
chore: housekeeping (#836)
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-gy authored Apr 15, 2024
1 parent a35df99 commit fdcbe71
Show file tree
Hide file tree
Showing 7 changed files with 387 additions and 374 deletions.
13 changes: 10 additions & 3 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// 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.231.6/containers/docker-existing-dockerfile
{
"name": "Draco 2 Development Environment",
"name": "Containerized Development Environment",

// Building the container from the local, root-level Dockerfile
"context": "..",
Expand Down Expand Up @@ -36,7 +36,7 @@
"python.formatting.provider": "black",
"python.testing.pytestEnabled": true,
"python.autoComplete.extraPaths": [
"/usr/local/lib/python3.10/site-packages"
"/usr/local/lib/python3.11/site-packages"
],
"editor.tabSize": 4,
"editor.detectIndentation": false,
Expand All @@ -48,9 +48,16 @@

// Defining handy Python extensions
"extensions": [
"abelcour.asp-syntax-highlight",
"charliermarsh.ruff",
"GitHub.copilot",
"ms-python.python",
"ms-toolsai.jupyter",
"ms-python.vscode-pylance",
"ms-toolsai.jupyter",
"ms-toolsai.jupyter-keymap",
"ms-toolsai.jupyter-renderers",
"ms-vscode.makefile-tools",
"njpwerner.autodocstring",
"VisualStudioExptTeam.vscodeintellicode"
],

Expand Down
2 changes: 1 addition & 1 deletion .python-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.11.7
3.11.9
9 changes: 7 additions & 2 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
{
"recommendations": [
"abelcour.asp-syntax-highlight",
"charliermarsh.ruff",
"GitHub.copilot",
"ms-python.python",
"ms-python.vscode-pylance",
"abelcour.asp-syntax-highlight",
"ms-toolsai.jupyter",
"ms-toolsai.jupyter-keymap",
"ms-toolsai.jupyter-renderers",
"ms-vscode.makefile-tools",
"njpwerner.autodocstring",
"visualstudioexptteam.vscodeintellicode"
"VisualStudioExptTeam.vscodeintellicode"
]
}
11 changes: 7 additions & 4 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,14 @@
"editor.formatOnSave": true,
"files.trimTrailingWhitespace": true,
"files.exclude": {
".mypy_cache": true,
".pytype": true,
".pytest_cache": true,
"**/*.py[co]": true,
"**/*ipynb_checkpoints": true,
"**/*pytest_cache*": true,
"**/__pycache__": true,
"**/*ipynb_checkpoints": true
"**/mypy_cache": true,
"**/ruff_cache": true,
".coverage.*": true,
".pytype": true
},
"autoDocstring.docstringFormat": "sphinx",
"autoDocstring.guessTypes": true
Expand Down
7 changes: 5 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.11.7-bookworm
FROM python:3.11.9-bookworm

# Install Node.js as it is needed for draco1 vs draco2 comparison demos
ENV NODE_MAJOR=20
Expand Down Expand Up @@ -30,14 +30,17 @@ COPY pyproject.toml poetry.lock ./
RUN python -m pip install --upgrade pip && \
pip install poetry && \
poetry config virtualenvs.create false && \
poetry install --with web
poetry install --with dev --with web

# Copy the project source code
COPY . .

# Install draco2 from local sources, needed for notebooks
RUN pip install -e .

# Install pre-commit hooks
RUN poetry run pre-commit install

# Grant permissions to the notebook user
RUN chown -R ${NB_USER} ${HOME}
USER ${NB_USER}
19 changes: 10 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -74,19 +74,20 @@ publish: build
.PHONY: clean
clean:
@poetry run jupyter-book clean docs
@rm -rf .coverage
@rm -rf dist
@rm -rf pyodide/pyodide-src
@rm -rf jupyterlite/lite-dir/static/pyodide
@rm -rf jupyterlite/lite-dir/files
@rm -f jupyterlite/.jupyterlite.doit.db
@find . -type d -name '.pytype' -exec rm -rf {} +
@find . -type d -name '*.ipynb_checkpoints' -exec rm -r {} +
@find . -type d -name '*pytest_cache*' -exec rm -rf {} +
@find . -type d -name '.mypy_cache' -exec rm -rf {} +
@find . -type d -name '.pytype' -exec rm -rf {} +
@find . -type d -name '.ruff_cache' -exec rm -rf {} +
@find . -type d -name '__pycache__' -exec rm -rf {} +
@find . -type d -name '*pytest_cache*' -exec rm -rf {} +
@find . -type f -name "*.py[co]" -exec rm -rf {} +
@find . -type f -name ".coverage.*" -exec rm -rf {} +
@find . -type d -name '*.ipynb_checkpoints' -exec rm -r {} +
@rm -f jupyterlite/.jupyterlite.doit.db
@rm -rf .coverage
@rm -rf dist
@rm -rf jupyterlite/lite-dir/files
@rm -rf jupyterlite/lite-dir/static/pyodide
@rm -rf pyodide/pyodide-src

.PHONY: serve
serve:
Expand Down
Loading

0 comments on commit fdcbe71

Please sign in to comment.