From 3b34f31d97016a9b61b2f029d9414530b4de4668 Mon Sep 17 00:00:00 2001 From: Christopher Lorton Date: Fri, 22 Nov 2024 00:54:50 +0000 Subject: [PATCH] custom devcontainer Avoid default with NumPy 2.x --- .devcontainer/devcontainer.json | 25 +++++++++++++++++++++++++ .devcontainer/postCreateCommands.sh | 3 +++ .pre-commit-config.yaml | 2 +- .readthedocs.yml | 2 +- MANIFEST.in | 1 + README.rst | 2 +- tox.ini | 2 +- 7 files changed, 33 insertions(+), 4 deletions(-) create mode 100644 .devcontainer/devcontainer.json create mode 100755 .devcontainer/postCreateCommands.sh diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..5424256 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,25 @@ +{ + "image": "mcr.microsoft.com/devcontainers/python:3.9", + "customizations": { + // Configure properties specific to VS Code. + "vscode": { + // Add the IDs of extensions you want installed when the container is created. + "extensions": [ + "ms-python.python", + "ms-python.debugpy", + "ms-toolsai.jupyter", + "ms-toolsai.jupyter-renderers", + "charliermarsh.ruff", + "github.codespace", + "github.copilot", + "github.copilot-chat", + "mechatroner.raincsv", + "vscode-icons-team.vscode-icons" + ] + } + }, + "postCreateCommand": { + // Run commands after the container is created. + "command": "./.devcontainer/postCreateCommand.sh" + } +} diff --git a/.devcontainer/postCreateCommands.sh b/.devcontainer/postCreateCommands.sh new file mode 100755 index 0000000..e82ad61 --- /dev/null +++ b/.devcontainer/postCreateCommands.sh @@ -0,0 +1,3 @@ +pip install --upgrade pip +pip install uv +uv tool install tox --with tox-uv diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f253289..2124ee7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -6,7 +6,7 @@ exclude: '^(\.tox|ci/templates|\.bumpversion\.cfg)(/|$)' # Note the order is intentional to avoid multiple passes of the hooks repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.7.0 + rev: v0.7.4 hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix, --show-fixes] diff --git a/.readthedocs.yml b/.readthedocs.yml index ab1ac0c..0c69ac3 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -6,7 +6,7 @@ formats: all build: os: ubuntu-22.04 tools: - python: "3" + python: "3.9" python: install: - requirements: docs/requirements.txt diff --git a/MANIFEST.in b/MANIFEST.in index f6c406c..97b8e7c 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -20,4 +20,5 @@ include LICENSE include README.rst include README.MD +recursive-exclude .devcontainer * global-exclude *.py[cod] __pycache__/* *.so *.dylib diff --git a/README.rst b/README.rst index a661cf5..525218f 100644 --- a/README.rst +++ b/README.rst @@ -14,7 +14,7 @@ Overview * - package - |version| |wheel| |supported-versions| |supported-implementations| |commits-since| .. |docs| image:: https://readthedocs.org/projects/laser-cholera/badge/?style=flat - :target: https://laser-cholera.readthedocs.org/en/latest/ + :target: https://laser-cholera.readthedocs.io/en/latest/ :alt: Documentation Status .. |github-actions| image:: https://github.com/InstituteforDiseaseModeling/laser-cholera/actions/workflows/github-actions.yml/badge.svg diff --git a/tox.ini b/tox.ini index 50fa9be..d4c318d 100644 --- a/tox.ini +++ b/tox.ini @@ -24,7 +24,7 @@ basepython = py310: {env:TOXPYTHON:python3.10} py311: {env:TOXPYTHON:python3.11} py312: {env:TOXPYTHON:python3.12} - {bootstrap,clean,check,report,docs,codecov}: {env:TOXPYTHON:python3} + {bootstrap,clean,check,report,docs,codecov}: {env:TOXPYTHON:python3.9} setenv = PYTHONPATH={toxinidir}/tests PYTHONUNBUFFERED=yes