Skip to content

Commit 3228bc5

Browse files
committed
proj: modernize project environment
Primarily introducing `uv`. Also bump minimum Python to 3.9. - remove reportImportCycles from pyright config because that doesn't respect the `TYPE_CHECKING` flag so doesn't actually report useful cycles in a project like this where some types are recursive.
1 parent 0cf6d71 commit 3228bc5

File tree

5 files changed

+460
-8
lines changed

5 files changed

+460
-8
lines changed

.fdignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.tox
2+
Session.vim
3+
build/
4+
docs/.build
5+
features/_scratch
6+
__pycache__/
7+
src/*.egg-info

.projections.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"src/docx/*.py" : {
3+
"alternate" : [
4+
"tests/{dirname}/test_{basename}.py"
5+
],
6+
"type" : "source"
7+
},
8+
"tests/**/test_*.py" : {
9+
"alternate" : [
10+
"src/docx/{dirname}/{basename}.py"
11+
],
12+
"type" : "test"
13+
}
14+
}

.rgignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.tox
2+
Session.vim
3+
build/
4+
docs/.build
5+
features/_scratch
6+
__pycache__/
7+
ref/
8+
src/*.egg-info
9+
tests/test_files

pyproject.toml

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,28 +30,26 @@ dynamic = ["version"]
3030
keywords = ["docx", "office", "openxml", "word"]
3131
license = { text = "MIT" }
3232
readme = "README.md"
33-
requires-python = ">=3.7"
33+
requires-python = ">=3.9"
3434

3535
[project.urls]
3636
Changelog = "https://github.com/python-openxml/python-docx/blob/master/HISTORY.rst"
3737
Documentation = "https://python-docx.readthedocs.org/en/latest/"
3838
Homepage = "https://github.com/python-openxml/python-docx"
3939
Repository = "https://github.com/python-openxml/python-docx"
4040

41-
[tool.black]
42-
line-length = 100
43-
target-version = ["py37", "py38", "py39", "py310", "py311"]
44-
4541
[tool.pyright]
4642
include = ["src/docx", "tests"]
4743
pythonPlatform = "All"
48-
pythonVersion = "3.8"
49-
reportImportCycles = true
44+
pythonVersion = "3.9"
45+
reportImportCycles = false
5046
reportUnnecessaryCast = true
5147
reportUnnecessaryTypeIgnoreComment = true
5248
stubPath = "./typings"
5349
typeCheckingMode = "strict"
5450
verboseOutput = true
51+
venvPath = "."
52+
venv = ".venv"
5553

5654
[tool.pytest.ini_options]
5755
filterwarnings = [
@@ -88,7 +86,6 @@ target-version = "py38"
8886
ignore = [
8987
"COM812", # -- over-aggressively insists on trailing commas where not desired --
9088
"PT001", # -- wants @pytest.fixture() instead of @pytest.fixture --
91-
"PT005", # -- wants @pytest.fixture() instead of @pytest.fixture --
9289
]
9390
select = [
9491
"C4", # -- flake8-comprehensions --
@@ -111,3 +108,13 @@ known-local-folder = ["helpers"]
111108

112109
[tool.setuptools.dynamic]
113110
version = {attr = "docx.__version__"}
111+
112+
[dependency-groups]
113+
dev = [
114+
"behave>=1.2.6",
115+
"pyparsing>=3.2.3",
116+
"pyright>=1.1.401",
117+
"pytest>=8.4.0",
118+
"ruff>=0.11.13",
119+
"types-lxml-multi-subclass>=2025.3.30",
120+
]

0 commit comments

Comments
 (0)