Skip to content

Commit

Permalink
feat: add Python 3.11
Browse files Browse the repository at this point in the history
  • Loading branch information
andreoliwa committed Mar 27, 2023
1 parent 6a4fddd commit 7d670ee
Show file tree
Hide file tree
Showing 12 changed files with 21 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python.yaml
Expand Up @@ -16,7 +16,7 @@ jobs:
# ubuntu-latest is being moved from ubuntu-18.04 to ubuntu-20.04
# See https://github.com/actions/virtual-environments/issues/1816
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.7", "3.8", "3.9", "3.10"]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
runs-on: ${{ matrix.os }}
env:
PYTHONUNBUFFERED: 1
Expand Down
2 changes: 2 additions & 0 deletions README.rst
Expand Up @@ -251,6 +251,8 @@ python
- Description
* - `py://nitpick/resources/python/310 <src/nitpick/resources/python/310.toml>`_
- Python 3.10
* - `py://nitpick/resources/python/311 <src/nitpick/resources/python/311.toml>`_
- Python 3.11
* - `py://nitpick/resources/python/37 <src/nitpick/resources/python/37.toml>`_
- Python 3.7
* - `py://nitpick/resources/python/38 <src/nitpick/resources/python/38.toml>`_
Expand Down
4 changes: 2 additions & 2 deletions docs/ideas/yaml/contains.toml
Expand Up @@ -3,7 +3,7 @@
[[".github/workflows/python.yaml".contains]]
__jmespath = "jobs.build.strategy.matrix"
os = ["ubuntu-latest", "macos-latest", "windows-latest"]
"python-version" = ["3.7", "3.8", "3.9", "3.10"]
"python-version" = ["3.7", "3.8", "3.9", "3.10", "3.11"]

# 3. Same as item 4 on "jmespath-on-section.toml", but with a different syntax.
[[".github/workflows/python.yaml".contains]]
Expand Down Expand Up @@ -56,7 +56,7 @@ __yaml = "- uses: actions/checkout@v2"
[[".github/workflows/python.yaml".contains_sorted]]
__jmespath = "jobs.build.strategy.matrix"
os = ["ubuntu-latest", "macos-latest", "windows-latest"]
"python-version" = ["3.7", "3.8", "3.9", "3.10"]
"python-version" = ["3.7", "3.8", "3.9", "3.10", "3.11"]

[[".github/workflows/python.yaml".contains_sorted]]
__jmespath = "jobs.build"
Expand Down
2 changes: 1 addition & 1 deletion docs/ideas/yaml/merge_lists/merged_style.toml
@@ -1,4 +1,4 @@
# This should be the result of a parent style including all the styles in this directory
[".github/workflows/python.yaml".jobs.build.strategy.matrix]
os = ["ubuntu-latest", "macos-latest", "windows-latest"]
"python-version" = ["3.7", "3.8", "3.9", "3.10"]
"python-version" = ["3.7", "3.8", "3.9", "3.10", "3.11"]
2 changes: 2 additions & 0 deletions docs/ideas/yaml/merge_lists/py311.toml
@@ -0,0 +1,2 @@
[".github/workflows/python.yaml".jobs.build.strategy.matrix]
"python-version" = ["3.11"]
2 changes: 2 additions & 0 deletions docs/library.rst
Expand Up @@ -92,6 +92,8 @@ python
- Description
* - :gitref:`py://nitpick/resources/python/310 <src/nitpick/resources/python/310.toml>`
- Python 3.10
* - :gitref:`py://nitpick/resources/python/311 <src/nitpick/resources/python/311.toml>`
- Python 3.11
* - :gitref:`py://nitpick/resources/python/37 <src/nitpick/resources/python/37.toml>`
- Python 3.7
* - :gitref:`py://nitpick/resources/python/38 <src/nitpick/resources/python/38.toml>`
Expand Down
5 changes: 5 additions & 0 deletions src/nitpick/resources/python/311.toml
@@ -0,0 +1,5 @@
[nitpick.meta]
name = "Python 3.11"

["pyproject.toml".tool.poetry.dependencies]
python = "^3.11"
2 changes: 1 addition & 1 deletion src/nitpick/resources/python/github-workflow.toml
Expand Up @@ -11,7 +11,7 @@ fail-fast = false

[".github/workflows/python.yaml".jobs.build.strategy.matrix]
os = ["ubuntu-latest", "windows-latest", "macos-latest"]
python-version = ["3.7", "3.8", "3.9", "3.10"]
python-version = ["3.7", "3.8", "3.9", "3.10", "3.11"]

[".github/workflows/python.yaml".jobs.build]
name = "${{ matrix.python-version }} ${{ matrix.os }}"
Expand Down
2 changes: 2 additions & 0 deletions tests/test_builtin/python/311/pyproject.toml
@@ -0,0 +1,2 @@
[tool.poetry.dependencies]
python = "^3.11"
Expand Up @@ -15,6 +15,7 @@ jobs:
- '3.8'
- '3.9'
- '3.10'
- '3.11'
name: ${{ matrix.python-version }} ${{ matrix.os }}
runs-on: ${{ matrix.os }}
env:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_yaml/new-desired.toml
Expand Up @@ -12,7 +12,7 @@ with = {"python-version" = "${{ matrix.python-version }}"}

[".github/workflows/python.yaml".jobs.build.strategy.matrix]
os = ["ubuntu-latest", "macos-latest", "windows-latest"]
"python-version" = ["3.7", "3.8", "3.9", "3.10"]
"python-version" = ["3.7", "3.8", "3.9", "3.10", "3.11"]

[".github/workflows/python.yaml".jobs.build]
"runs-on" = "${{ matrix.os }}"
1 change: 1 addition & 0 deletions tests/test_yaml/new-expected.yaml
Expand Up @@ -17,4 +17,5 @@ jobs:
- '3.8'
- '3.9'
- '3.10'
- '3.11'
runs-on: ${{ matrix.os }}

0 comments on commit 7d670ee

Please sign in to comment.