Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
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
8 changes: 8 additions & 0 deletions .devcontainer/Dockerfile
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
30 changes: 30 additions & 0 deletions .devcontainer/devcontainer.json
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
}
}
}
9 changes: 9 additions & 0 deletions .devcontainer/post-create.sh
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]
52 changes: 52 additions & 0 deletions .github/CONTRIBUTING.md
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.
Comment on lines +17 to +20
Copy link
Member Author

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


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.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ dist/
htmlcov/

.tox/
.venv/
.cache/
.coverage
*.egg-info/
Expand Down
29 changes: 0 additions & 29 deletions .gitpod.yml

This file was deleted.

7 changes: 7 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,15 @@ Everyone interacting in the readme_renderer project's codebases, issue trackers,
chat rooms, and mailing lists is expected to follow the `PSF Code of Conduct`_.


Contributing
------------
Contributions are welcome, and they are greatly appreciated!
Every little bit helps. See `CONTRIBUTING.md`_ file for more information.


.. |twine check| replace:: ``twine check``
.. _twine check: https://packaging.python.org/guides/making-a-pypi-friendly-readme#validating-restructuredtext-markup
.. _PSF Code of Conduct: https://github.com/pypa/.github/blob/main/CODE_OF_CONDUCT.md
.. _CONTRIBUTING.md: https://github.com/pypa/readme_renderer/blob/main/.github/CONTRIBUTING.md

Copyright © 2014, [The Python Packaging Authority].
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ Home-page = "https://github.com/pypa/readme_renderer"
requires = ["setuptools>=40.8.0"]
build-backend = "setuptools.build_meta"

[tool.check-manifest]
ignore = [
".devcontainer/*",
]

[tool.coverage.run]
branch = true
Expand Down