-
Notifications
You must be signed in to change notification settings - Fork 92
chore(dev): replace gitpod with devcontainer #326
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
miketheman
wants to merge
1
commit into
pypa:main
Choose a base branch
from
miketheman:devcontainer
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
FROM ubuntu:noble | ||
ARG PYTHON_PACKAGES="python3.13 python3.12 python3.11 python3.10 python3.9 python3.9-distutils python3 python3-pip python3-venv pipx" | ||
RUN apt-get update \ | ||
&& apt-get install --no-install-recommends -yq software-properties-common git \ | ||
&& add-apt-repository ppa:deadsnakes/ppa && apt-get update \ | ||
&& apt-get install -yq --no-install-recommends ${PYTHON_PACKAGES} \ | ||
&& pipx ensurepath \ | ||
&& pipx install tox |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the | ||
// README at: https://github.com/devcontainers/templates/tree/main/src/python | ||
{ | ||
"name": "Python 3", | ||
"build": { | ||
"dockerfile": "Dockerfile" | ||
}, | ||
// "features": { | ||
// // Rust is necessary for the `nh3` package if wheels are unavailable. | ||
// // The current Python versions tested have wheels, so this is commented out. | ||
// "ghcr.io/devcontainers/features/rust:1": {} | ||
// }, | ||
// Use 'postCreateCommand' to run commands after the container is created. | ||
"postCreateCommand": "bash .devcontainer/post-create.sh", | ||
// Configure tool-specific properties. | ||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"EditorConfig.EditorConfig", | ||
"ms-python.python", | ||
"ms-python.mypy-type-checker", | ||
"tamasfe.even-better-toml" | ||
] | ||
}, | ||
"settings": { | ||
"python.defaultInterpreterPath": ".venv/bin/python", | ||
"python.terminal.activateEnvInCurrentTerminal": true | ||
} | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
|
||
# `tox` testing manages its own environments | ||
# Create virtualenv for local development, editor completion, etc. | ||
python3 -m venv .venv | ||
source .venv/bin/activate | ||
pip install --upgrade pip | ||
pip install -e .[md] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# Contributing | ||
|
||
The following is a set of guidelines for contributing to this project. | ||
These are just guidelines, not rules. | ||
Use your best judgment, and feel free to propose changes to this document in a pull request. | ||
|
||
## Development Setup | ||
|
||
### The Easy Way | ||
|
||
Use the supplied [Development Container](https://containers.dev/) configuration | ||
to get a development environment up and running quickly. | ||
The configurations can be found in the `.devcontainer` directory. | ||
|
||
[GitHub Codespaces](https://github.com/features/codespaces) can provide | ||
a development environment in the cloud. | ||
GitHub Codespaces also provides a prebuilt image for this repository | ||
from the most recent commit on the `main` branch | ||
to speed up the setup process, including many of the Python runtimes | ||
and tools needed to run the tests. | ||
|
||
Other tools like Visual Studio Code may use the devcontainer configuration | ||
to provide a consistent development environment locally, | ||
if you have a compatible version of a container runtime. | ||
|
||
### The Less-Easy Way | ||
|
||
1. Fork the repository and clone it to your local machine. | ||
1. Install any Python runtimes you wish to test against. | ||
1. Install the `tox` test runner | ||
|
||
Note: You may need other development tools depending on the environment you are working in. | ||
|
||
## Running Tests | ||
|
||
Once started up, in a shell, run `tox -l` to see the available test environments. | ||
To run the tests, use `tox -e <environment>` | ||
where `<environment>` is one of the environments listed by `tox -l`. | ||
|
||
Alternatively, you can run `tox` without any arguments to run all the tests. | ||
|
||
### Parallel Testing | ||
|
||
To run all Python tests in parallel on all available CPUs: | ||
|
||
tox -p auto | ||
|
||
Read more about [parallel mode](https://tox.wiki/en/latest/user_guide.html#parallel-mode). | ||
|
||
## Testing Guidelines | ||
|
||
TODO: Explain test fixtures and how to create/update them. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ dist/ | |
htmlcov/ | ||
|
||
.tox/ | ||
.venv/ | ||
.cache/ | ||
.coverage | ||
*.egg-info/ | ||
|
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: This will only be true after it's been merged to
main
and enabled and Codespaces hasn't hit a spending limit.https://docs.github.com/en/codespaces/managing-codespaces-for-your-organization/choosing-who-owns-and-pays-for-codespaces-in-your-organization