Skip to content

Commit 1de2b7b

Browse files
authored
Merge pull request #486 from claranet/build/poetry_v2
build!: update pyproject syntax for poetry v2 (PEP-621), drop py38, add py313
2 parents cb4cd92 + da7c0a0 commit 1de2b7b

20 files changed

+200
-935
lines changed

.github/workflows/main.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
name: Tests
22

33
env:
4-
POETRY_VERSION: "1.7.1"
5-
PYTHON_VERSION: "3.12"
4+
POETRY_VERSION: "2.1.1"
5+
PYTHON_VERSION: "3.13"
66

77
on:
88
merge_group:
@@ -37,7 +37,7 @@ jobs:
3737
runs-on: ubuntu-latest
3838
strategy:
3939
matrix:
40-
python_version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
40+
python_version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
4141
fail-fast: false
4242
steps:
4343
- uses: actions/checkout@v4

.github/workflows/release.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
name: Release
22

33
env:
4-
POETRY_VERSION: "1.7.1"
5-
PYTHON_VERSION: "3.12"
4+
POETRY_VERSION: "2.1.1"
5+
PYTHON_VERSION: "3.13"
66

77
on:
88
push:

.gitlab-ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ tox:
2323
image: python:${PYTHON_VERSION}
2424
parallel:
2525
matrix:
26-
- PYTHON_VERSION: ["3.8", "3.9", "3.10", "3.11", "3.12"]
26+
- PYTHON_VERSION: ["3.9", "3.10", "3.11", "3.12", "3.13"]
2727
script:
2828
- pip install poetry==${POETRY_VERSION}
2929
- poetry install

.pre-commit-config.yaml

+17-14
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,42 @@
11
default_install_hook_types: [commit-msg, pre-commit]
22
repos:
33
- repo: https://github.com/pre-commit/pre-commit-hooks
4-
rev: v4.5.0
4+
rev: v5.0.0
55
hooks:
66
- id: trailing-whitespace
7+
stages: [pre-commit]
78
- id: end-of-file-fixer
9+
stages: [pre-commit]
810
- id: check-added-large-files
11+
stages: [pre-commit]
912
- id: check-toml
13+
stages: [pre-commit]
1014
- id: check-yaml
15+
stages: [pre-commit]
1116

12-
- repo: https://github.com/pycqa/flake8
13-
rev: 7.0.0
17+
- repo: https://github.com/astral-sh/ruff-pre-commit
18+
rev: v0.9.9
1419
hooks:
15-
- id: flake8
16-
additional_dependencies:
17-
- flake8-docstrings
18-
- Flake8-pyproject
19-
20-
- repo: https://github.com/psf/black
21-
rev: 24.2.0
22-
hooks:
23-
- id: black
20+
- id: ruff
21+
args: [--fix]
22+
stages: [pre-commit]
23+
- id: ruff-format
24+
stages: [pre-commit]
2425

2526
- repo: https://codeberg.org/frnmst/md-toc
2627
rev: 9.0.0
2728
hooks:
2829
- id: md-toc
30+
stages: [pre-commit]
2931

3032
- repo: https://github.com/tox-dev/tox-ini-fmt
31-
rev: "1.3.1"
33+
rev: "1.5.0"
3234
hooks:
3335
- id: tox-ini-fmt
36+
stages: [pre-commit]
3437

3538
- repo: https://github.com/compilerla/conventional-pre-commit
36-
rev: v3.1.0
39+
rev: v4.0.0
3740
hooks:
3841
- id: conventional-pre-commit
3942
stages: [commit-msg]

CHANGELOG.md

+15
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
# 14.0.0 (unreleased)
2+
3+
BREAKING:
4+
5+
- Drop support for Python 3.8
6+
7+
ADDED:
8+
9+
- Add support for Python 3.13
10+
11+
UPDATES:
12+
13+
- Update pyproject syntax from poetry v1 to v2 respecting PEP-621
14+
- Replace black and flake8 with ruff for linting and formatting
15+
116
# 13.2.4 (2025/03/07)
217

318
FIXES:

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ Note: the term _Terraform_ is used in this documentation when talking about gene
6969

7070
## Setup Dependencies
7171

72-
- `python3` `>= 3.8.1 <4.0`
72+
- `python3` `>= 3.9 <4.0`
7373
- `python3-pip`
7474
- `python3-venv`
7575
- `pipx` (recommended)

poetry.lock

+30-739
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

+52-49
Original file line numberDiff line numberDiff line change
@@ -1,87 +1,90 @@
1-
[tool.poetry]
1+
[project]
22
name = "claranet-tfwrapper"
33
version = "13.2.5a0"
44
description = "Claranet's `tfwrapper` is a wrapper for [Terraform](https://www.terraform.io/) implemented in python which aims to simplify Terraform usage and enforce best practices"
55
authors = []
6-
license = "Mozilla Public License Version 2.0"
6+
license = { text = "Mozilla Public License Version 2.0" }
77
readme = "README.md"
8-
homepage = "https://github.com/claranet/tfwrapper"
8+
requires-python = ">=3.9,<4.0"
99
keywords = ["terraform", "wrapper"]
10-
11-
# For reference, see https://pypi.org/pypi?%3Aaction=list_classifiers
1210
classifiers = [
1311
"Development Status :: 5 - Production/Stable",
1412
"Intended Audience :: Developers",
1513
"Intended Audience :: Information Technology",
1614
"Intended Audience :: System Administrators",
1715
"License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)",
1816
"Programming Language :: Python :: 3",
19-
"Programming Language :: Python :: 3.8",
2017
"Programming Language :: Python :: 3.9",
2118
"Programming Language :: Python :: 3.10",
2219
"Programming Language :: Python :: 3.11",
2320
"Programming Language :: Python :: 3.12",
21+
"Programming Language :: Python :: 3.13",
2422
"Topic :: System :: Systems Administration",
2523
"Topic :: Utilities",
2624
]
25+
dependencies = [
26+
"argcomplete<4.0",
27+
"boto3>=1.17.94,<2.0.0",
28+
"cachecontrol[filecache]>=0.14.0,<0.15.0",
29+
"colorlog>=5.0.1,<7.0.0",
30+
"jinja2>=3.0.1,<4.0.0",
31+
"lockfile>=0.12.2,<0.13.0",
32+
"natsort>=7.1.1,<9.0.0",
33+
"packaging>=24,<25",
34+
"pyyaml>=6.0.1,<7.0.0",
35+
"requests>=2.25.1,<3.0.0",
36+
"schema>=0.7.4,<0.8.0",
37+
"semver>=3.0.1,<4.0.0",
38+
"termcolor>=1.1,<3.0",
39+
]
40+
41+
[project.urls]
42+
homepage = "https://github.com/claranet/tfwrapper"
2743

28-
[tool.poetry.dependencies]
29-
python = ">=3.8.1,<4.0"
30-
argcomplete = "<4.0"
31-
boto3 = "^1.17.94"
32-
cachecontrol = {extras = ["filecache"], version = "^0.14.0"}
33-
colorlog = ">=5.0.1,<7.0.0"
34-
jinja2 = "^3.0.1"
35-
lockfile = "^0.12.2"
36-
natsort = ">=7.1.1,<9.0.0"
37-
packaging = ">=24,<25"
38-
pyyaml = "^6.0.1"
39-
requests = "^2.25.1"
40-
schema = "^0.7.4"
41-
semver = "^3.0.1"
42-
termcolor = ">=1.1,<3.0"
44+
[project.scripts]
45+
tfwrapper = "claranet_tfwrapper:main"
46+
47+
[tool.poetry]
48+
# Poetry-specific configurations that don't fit in the PEP-621 schema
4349

4450
[tool.poetry.group.test.dependencies]
45-
black = "*"
4651
coverage = "*"
47-
flake8 = ">=6.0.0"
48-
flake8-docstrings = "*"
49-
flake8-pyproject = "*"
5052
md-toc = "*"
5153
mock = "*"
5254
pook = ">=1.0.2"
5355
pre-commit = "*"
5456
pytest = "*"
5557
pytest-mock = "*"
5658
requests-mock = "*"
59+
ruff = "*"
5760
toml = "*"
5861
tox = ">=4"
5962

60-
[tool.poetry.scripts]
61-
tfwrapper = 'claranet_tfwrapper:main'
62-
6363
[build-system]
6464
requires = ["poetry-core>=1.1.0"]
6565
build-backend = "poetry.core.masonry.api"
6666

67-
[tool.black]
68-
# Make sure to match flake8's max-line-length.
69-
line-length = 130 # black's default
70-
target-version = ['py38', 'py39', 'py310', 'py311', 'py312']
71-
exclude = '''
72-
/(
73-
\.git
74-
| \.pytest_cache
75-
| \.tox
76-
| \.venv
77-
)/
78-
'''
79-
80-
[tool.flake8]
81-
verbose = 3
82-
max-line-length = 130
83-
per-file-ignores = ['tests/*.py:D103']
84-
exclude = ['.git', '.tox', '.venv', '.virtualenv', '__pycache__']
85-
# See https://black.readthedocs.io/en/stable/faq.html#why-are-flake8-s-e203-and-w503-violated
86-
ignore = ['E203', 'W503']
87-
enable-extensions = ['W504']
67+
[tool.ruff]
68+
exclude = [
69+
".git",
70+
".tox",
71+
".venv",
72+
".virtualenv",
73+
"__pycache__",
74+
"venv",
75+
"build",
76+
".eggs",
77+
"setup.py",
78+
]
79+
line-length = 130
80+
lint.ignore = []
81+
lint.per-file-ignores."tests/*.py" = [
82+
"D100",
83+
"D101",
84+
"D102",
85+
"D103",
86+
"D104",
87+
"E501",
88+
]
89+
lint.select = ["D", "E", "F", "W"]
90+
target-version = "py39"

0 commit comments

Comments
 (0)