Skip to content

Commit bd235a1

Browse files
authored
Merge pull request #2 from pamelafox/update-project
Update template
2 parents 127c6bb + d56f148 commit bd235a1

File tree

6 files changed

+23
-43
lines changed

6 files changed

+23
-43
lines changed

.devcontainer/Dockerfile

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1 @@
1-
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.245.0/containers/python-3/.devcontainer/base.Dockerfile
2-
3-
# [Choice] Python version (use -bullseye variants on local arm64/Apple Silicon): 3, 3.10, 3.9, 3.8, 3.7, 3.6, 3-bullseye, 3.10-bullseye, 3.9-bullseye, 3.8-bullseye, 3.7-bullseye, 3.6-bullseye, 3-buster, 3.10-buster, 3.9-buster, 3.8-buster, 3.7-buster, 3.6-buster
4-
ARG VARIANT="3.10-bullseye"
51
FROM mcr.microsoft.com/vscode/devcontainers/python:0-${VARIANT}

.devcontainer/devcontainer.json

Lines changed: 10 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,43 +2,29 @@
22
// https://github.com/microsoft/vscode-dev-containers/tree/v0.245.0/containers/python-3
33
{
44
"name": "Python 3",
5-
"forwardPorts": [8000],
6-
"build": {
7-
"dockerfile": "Dockerfile",
8-
"context": "..",
9-
"args": {
10-
// Update 'VARIANT' to pick a Python version: 3, 3.10, 3.9, 3.8, 3.7, 3.6
11-
// Append -bullseye or -buster to pin to an OS version.
12-
// Use -bullseye variants on local on arm64/Apple Silicon.
13-
"VARIANT": "3.10-bullseye"
14-
}
15-
},
5+
"image": "mcr.microsoft.com/vscode/devcontainers/python:3.11-bullseye",
166

177
// Configure tool-specific properties.
188
"customizations": {
199
// Configure properties specific to VS Code.
2010
"vscode": {
2111
// Set *default* container specific settings.json values on container create.
2212
"settings": {
23-
"python.defaultInterpreterPath": "/usr/local/bin/python",
24-
"python.linting.enabled": true,
25-
"python.linting.pylintEnabled": true,
26-
"python.formatting.autopep8Path": "/usr/local/py-utils/bin/autopep8",
27-
"python.formatting.blackPath": "/usr/local/py-utils/bin/black",
28-
"python.formatting.yapfPath": "/usr/local/py-utils/bin/yapf",
29-
"python.linting.banditPath": "/usr/local/py-utils/bin/bandit",
30-
"python.linting.mypyPath": "/usr/local/py-utils/bin/mypy",
31-
"python.linting.pycodestylePath": "/usr/local/py-utils/bin/pycodestyle",
32-
"python.linting.pydocstylePath": "/usr/local/py-utils/bin/pydocstyle",
33-
"python.linting.pylintPath": "/usr/local/py-utils/bin/pylint",
13+
"python.defaultInterpreterPath": "/usr/local/bin/python",
14+
"python.testing.pytestEnabled": true,
3415
"python.testing.unittestEnabled": false,
35-
"python.testing.pytestEnabled": true
16+
"files.exclude": {
17+
".coverage": true,
18+
".pytest_cache": true,
19+
"__pycache__": true
20+
}
3621
},
3722

3823
// Add the IDs of extensions you want installed when the container is created.
3924
"extensions": [
4025
"ms-python.python",
41-
"ms-python.vscode-pylance"
26+
"charliermarsh.ruff",
27+
"ms-python.black-formatter"
4228
]
4329
}
4430
},

.github/workflows/python.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- name: Set up Python 3
1515
uses: actions/setup-python@v3
1616
with:
17-
python-version: "3.10"
17+
python-version: "3.11"
1818
- name: Install dependencies
1919
run: |
2020
python -m pip install --upgrade pip

.pre-commit-config.yaml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v4.4.0
3+
rev: v4.5.0
44
hooks:
55
- id: check-yaml
66
- id: end-of-file-fixer
77
- id: trailing-whitespace
8-
- repo: https://github.com/charliermarsh/ruff-pre-commit
9-
rev: v0.0.252
8+
- repo: https://github.com/astral-sh/ruff-pre-commit
9+
rev: v0.1.0
1010
hooks:
1111
- id: ruff
1212
- repo: https://github.com/psf/black
13-
rev: 23.1.0
13+
rev: 23.9.1
1414
hooks:
1515
- id: black
16-
args: ['--config=./pyproject.toml']

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ It includes `pytest` for testing plus the `pytest-cov` plugin to measure coverag
1111

1212
The checks and tests are all run using Github actions on every pull request and merge to main.
1313

14-
This repository is setup for Python 3.10. To customize that, change the `VARIANT` argument in `.devcontainer/devcontainer.json`, change the config options in `.precommit-config.yaml` and change the version number in `.github/workflows/python.yaml`.
14+
This repository is setup for Python 3.11. To customize that, change the `VARIANT` argument in `.devcontainer/devcontainer.json`, change the config options in `.precommit-config.yaml` and change the version number in `.github/workflows/python.yaml`.
1515

1616
## Development instructions
1717

pyproject.toml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
[tool.ruff]
2-
line-length = 100
3-
target-version = "py310"
2+
line-length = 120
3+
target-version = "py311"
44
select = ["E", "F", "I", "UP"]
55
ignore = ["D203"]
6-
show-source = true
76

87
[tool.black]
9-
line-length = 100
10-
target-version = ["py310"]
11-
12-
[tool.pylint.messages_control]
13-
disable = "C0114,C0115,C0116"
8+
line-length = 120
9+
target-version = ["py311"]
1410

1511
[tool.pytest.ini_options]
1612
addopts = "-ra --cov"
1713
testpaths = ["tests"]
1814
pythonpath = ['.']
15+
16+
[tool.coverage.report]
17+
show_missing = true

0 commit comments

Comments
 (0)