Skip to content

Commit 368373c

Browse files
committed
fix: get lint/tests running again
Some version-related changes caused lint and acceptance-test failures since the last release. Fix those up.
1 parent 71d1ca0 commit 368373c

File tree

5 files changed

+41
-7
lines changed

5 files changed

+41
-7
lines changed

.ruff.toml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# -- don't check these locations --
2+
exclude = [
3+
# -- docs/ - documentation Python code is incidental --
4+
"docs",
5+
# -- lab/ has some experimental code that is not disciplined --
6+
"lab",
7+
# -- ref/ is not source-code --
8+
"ref",
9+
# -- spec/ has some ad-hoc discovery code that is not disciplined --
10+
"spec",
11+
]

pptx/package.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,10 @@ def first_available_image_idx():
5555
[
5656
part.partname.idx
5757
for part in self.iter_parts()
58-
if part.partname.startswith("/ppt/media/image")
59-
and part.partname.idx is not None
58+
if (
59+
part.partname.startswith("/ppt/media/image")
60+
and part.partname.idx is not None
61+
)
6062
]
6163
)
6264
for i, image_idx in enumerate(image_idxs):

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ behave>=1.2.5
22
flake8>=2.0
33
lxml>=3.1.0
44
mock>=1.0.1
5-
Pillow>=3.3.2
5+
Pillow>=3.3.2,<=9.5.0
66
pyparsing>=2.0.1
77
pytest>=2.5
88
XlsxWriter>=0.5.7

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ def ascii_bytes_from(path, *paths):
3737
KEYWORDS = "powerpoint ppt pptx office open xml"
3838
AUTHOR = "Steve Canny"
3939
AUTHOR_EMAIL = "python-pptx@googlegroups.com"
40-
URL = "http://github.com/scanny/python-pptx"
40+
URL = "https://github.com/scanny/python-pptx"
4141
LICENSE = license
4242
PACKAGES = find_packages(exclude=["tests", "tests.*"])
4343
PACKAGE_DATA = {"pptx": ["templates/*"]}
4444

45-
INSTALL_REQUIRES = ["lxml>=3.1.0", "Pillow>=3.3.2", "XlsxWriter>=0.5.7"]
45+
INSTALL_REQUIRES = ["lxml>=3.1.0", "Pillow>=3.3.2,<=9.5.0", "XlsxWriter>=0.5.7"]
4646

4747
TEST_SUITE = "tests"
4848
TESTS_REQUIRE = ["behave", "mock", "pyparsing>=2.0.1", "pytest"]

tox.ini

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,42 @@
33

44
[flake8]
55
exclude = dist,docs,*.egg-info,.git,lab,ref,_scratch,spec,.tox
6+
ignore =
7+
# -- E203 - whitespace before ':'. Black disagrees for slice expressions.
8+
E203,
9+
10+
# -- W503 - line break before binary operator. Black has a different opinion about
11+
# -- this, that binary operators should appear at the beginning of new-line
12+
# -- expression segments. I agree because right is ragged and left lines up.
13+
W503
614
max-line-length = 88
715

816
[pytest]
17+
filterwarnings =
18+
# -- exit on any warning not explicitly ignored here --
19+
error
20+
21+
# -- pytest-xdist plugin may warn about `looponfailroots` deprecation --
22+
ignore::DeprecationWarning:xdist
23+
24+
# -- pytest complains when pytest-xdist is not installed --
25+
ignore:Unknown config option. looponfailroots:pytest.PytestConfigWarning
26+
27+
looponfailroots = pptx tests
928
norecursedirs = docs *.egg-info features .git pptx spec .tox
1029
python_classes = Test Describe
1130
python_functions = test_ it_ they_ but_ and_it_
1231

1332
[tox]
14-
envlist = py27, py38
33+
envlist = py27, py38, py311
34+
requires = virtualenv<20.22.0
35+
skip_missing_interpreters = false
1536

1637
[testenv]
1738
deps =
1839
behave==1.2.5
1940
lxml>=3.1.0
20-
Pillow>=3.3.2
41+
Pillow>=3.3.2,<=9.5.0
2142
pyparsing>=2.0.1
2243
pytest
2344
XlsxWriter>=0.5.7

0 commit comments

Comments
 (0)