Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 17 additions & 5 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,30 @@
{
"name": "pip",
"image": "mcr.microsoft.com/devcontainers/python:3",
"remoteUser": "vscode",
"remoteEnv": {
"PATH": "/home/vscode/.local/bin:${containerEnv:PATH}"
},
"features": {
"ghcr.io/rocker-org/devcontainer-features/apt-packages:1": {
"packages": "mercurial,subversion,bzr"
"packages": "mercurial,subversion,bzr,python3-venv"
}
},
"postCreateCommand": "python -m venv .venv\nsource .venv/bin/activate\npip install nox\npip install -e .",
"postCreateCommand": "bash ${containerWorkspaceFolder}/.devcontainer/postCreate.sh",
"customizations": {
"vscode": {
"extensions": [
"hbenl.vscode-test-explorer",
"ms-python.python"
]
"ms-python.python",
"ms-python.black-formatter",
"charliermarsh.ruff"
],
"settings": {
"python.testing.pytestEnabled": true,
"python.testing.pytestArgs": [
"-n",
"auto"
]
}
}
}
}
12 changes: 12 additions & 0 deletions .devcontainer/postCreate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash
set -Eeuo pipefail

# Get the workspace directory
WORKSPACE_DIR="${WORKSPACE_DIR:-/workspaces/pip}"
cd "$WORKSPACE_DIR"

# Upgrade pip and install development dependencies
python -m pip install --upgrade pip
python -m pip install nox --group test
python -m nox -s common-wheels
python -m pip install -e .
23 changes: 17 additions & 6 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,8 @@ def should_update_common_wheels(session: nox.Session) -> bool:
return need_to_repopulate


# -----------------------------------------------------------------------------
# Development Commands
# -----------------------------------------------------------------------------
@nox.session(python=["3.9", "3.10", "3.11", "3.12", "3.13", "3.14", "pypy3"])
def test(session: nox.Session) -> None:
# Get the common wheels.
def get_common_wheels(session: nox.Session) -> None:
"""Build the common wheels needed by tests."""
if should_update_common_wheels(session):
# fmt: off
run_with_protected_pip(
Expand All @@ -115,6 +111,21 @@ def test(session: nox.Session) -> None:
msg = f"Reusing existing common-wheels at {LOCATIONS['common-wheels']}."
session.log(msg)


# -----------------------------------------------------------------------------
# Development Commands
# -----------------------------------------------------------------------------
@nox.session(name="common-wheels")
def common_wheels(session: nox.Session) -> None:
"""Build the common wheels needed by tests."""
get_common_wheels(session)


@nox.session(python=["3.9", "3.10", "3.11", "3.12", "3.13", "3.14", "pypy3"])
def test(session: nox.Session) -> None:
# Get the common wheels.
get_common_wheels(session)

# Build source distribution
# HACK: we want to skip building and installing pip when nox's --no-install
# flag is given (to save time when running tests back to back with different
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,7 @@ git-only = [
"tests/**",
"tools/**",
"news/.gitignore",
".devcontainer/**",
".gitattributes",
".gitignore",
".git-blame-ignore-revs",
Expand Down