Skip to content

Commit c64efd7

Browse files
committed
🔧 better betterleaks (#467)
1 parent 9696193 commit c64efd7

3 files changed

Lines changed: 72 additions & 50 deletions

File tree

‎.github/workflows/_static-analysis.yml‎

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,25 @@ jobs:
1919
fetch-depth: 0
2020

2121
- name: Run Betterleaks
22+
id: betterleaks
23+
continue-on-error: true
2224
uses: dortort/betterleaks-action@v0.1.0
2325
with:
2426
version: "v1.9.0"
2527
github-token: ${{ secrets.GITHUB_TOKEN }}
2628

29+
- name: Upload Betterleaks report
30+
if: always()
31+
uses: actions/upload-artifact@v7
32+
with:
33+
name: betterleaks-report
34+
path: betterleaks-report.sarif
35+
if-no-files-found: warn
36+
37+
- name: Fail if Betterleaks found leaks
38+
if: steps.betterleaks.outcome == 'failure'
39+
run: exit 1
40+
2741
- name: Set up Python ${{ matrix.python-version }}
2842
uses: actions/setup-python@v7
2943
with:
@@ -40,7 +54,6 @@ jobs:
4054
- name: Install dependencies
4155
run: |
4256
python -m pip install pip
43-
pip install pylic~=3.6.1
4457
pip install -e '.[lint]'
4558
4659
- name: License check

‎pyproject.toml‎

Lines changed: 57 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -5,32 +5,32 @@ build-backend = "setuptools.build_meta"
55
[project]
66
name = "mindee"
77
authors = [
8-
{ name = "Mindee", email = "opensource@mindee.com" },
8+
{ name = "Mindee", email = "opensource@mindee.com" },
99
]
1010
dynamic = ["version"]
1111
description = "Mindee API helper library for Python"
1212
readme = "README.md"
1313
license = "MIT"
1414
license-files = ["LICENSE"]
1515
classifiers = [
16-
"Programming Language :: Python :: 3",
17-
"Programming Language :: Python :: 3.10",
18-
"Programming Language :: Python :: 3.11",
19-
"Programming Language :: Python :: 3.12",
20-
"Programming Language :: Python :: 3.13",
21-
"Programming Language :: Python :: 3.14",
22-
"Operating System :: OS Independent",
23-
"Development Status :: 5 - Production/Stable",
24-
"Intended Audience :: Developers",
25-
"Topic :: Software Development :: Libraries",
16+
"Programming Language :: Python :: 3",
17+
"Programming Language :: Python :: 3.10",
18+
"Programming Language :: Python :: 3.11",
19+
"Programming Language :: Python :: 3.12",
20+
"Programming Language :: Python :: 3.13",
21+
"Programming Language :: Python :: 3.14",
22+
"Operating System :: OS Independent",
23+
"Development Status :: 5 - Production/Stable",
24+
"Intended Audience :: Developers",
25+
"Topic :: Software Development :: Libraries",
2626
]
2727

2828
requires-python = ">=3.10"
2929

3030
dependencies = [
31-
"pypdfium2>=4.0,<6.0",
32-
"Pillow>=12.2.0",
33-
"httpx[http2]>=0.28.1,<1.0",
31+
"pypdfium2>=4.0,<6.0",
32+
"Pillow>=12.2.0",
33+
"httpx[http2]>=0.28.1,<1.0",
3434
]
3535

3636
[project.urls]
@@ -42,26 +42,27 @@ Changelog = "https://github.com/mindee/mindee-api-python/blob/main/CHANGELOG.md"
4242

4343
[project.optional-dependencies]
4444
lint = [
45-
"pylint==4.1.1",
46-
"prek~=0.5.4",
47-
"pip-audit==2.10.1",
45+
"pylint==4.1.1",
46+
"prek~=0.5.4",
47+
"pip-audit==2.10.1",
48+
"pylic~=4.1.0",
4849
]
4950
test = [
50-
"tomli~=2.4.1",
51-
"pytest>=9.0.3,<9.2.0",
52-
"pytest-cov~=7.1.0",
53-
"respx~=0.23.1"
51+
"tomli~=2.4.1",
52+
"pytest>=9.0.3,<9.2.0",
53+
"pytest-cov~=7.1.0",
54+
"respx~=0.23.1",
5455
]
5556
docs = [
56-
"sphinx~=9.1.0",
57-
"sphinx_rtd_theme~=3.1.0",
58-
"sphinx-autodoc-typehints>=3.10.4,<4.0.0",
57+
"sphinx~=9.1.0",
58+
"sphinx_rtd_theme~=3.1.0",
59+
"sphinx-autodoc-typehints>=3.10.4,<4.0.0",
5960
]
6061
build = [
61-
"build",
62-
"twine",
63-
"tomli~=2.4.1",
64-
"tomli-w~=1.2.0"
62+
"build",
63+
"twine",
64+
"tomli~=2.4.1",
65+
"tomli-w~=1.2.0",
6566
]
6667

6768
[project.scripts]
@@ -75,13 +76,14 @@ version = { attr = "mindee.versions.__version__" }
7576

7677
[tool.setuptools.package-data]
7778
"mindee" = ["py.typed"]
79+
7880
[tool.coverage.run]
7981
omit = [
80-
"examples/*",
81-
"scripts/*",
82-
"mindee/cli.py",
83-
"mindee/v1/commands/*",
84-
"mindee/v2/commands/*",
82+
"examples/*",
83+
"scripts/*",
84+
"mindee/cli.py",
85+
"mindee/v1/commands/*",
86+
"mindee/v2/commands/*",
8587
]
8688

8789
[tool.ruff]
@@ -115,13 +117,20 @@ ignore_missing_imports = true
115117

116118
[tool.pylic]
117119
safe_licenses = [
118-
"Apache Software License",
119-
"MIT License",
120-
"Mozilla Public License 2.0 (MPL 2.0)",
121-
"BSD License",
122-
"BSD-3-Clause, Apache-2.0, PdfiumThirdParty",
123-
"Historical Permission Notice and Disclaimer (HPND)",
124-
"CMU License (MIT-CMU)",
120+
"Apache Software License",
121+
"Apache-2.0",
122+
"BSD License",
123+
"BSD-2-Clause",
124+
"BSD-3-Clause",
125+
"BSD-3-Clause, Apache-2.0, dependency licenses",
126+
"MIT-CMU",
127+
"Historical Permission Notice and Disclaimer (HPND)",
128+
"MIT",
129+
"MIT License",
130+
"Mozilla Public License 2.0 (MPL 2.0)",
131+
"Public Domain",
132+
"Python Software Foundation License",
133+
"PSF-2.0",
125134
]
126135

127136

@@ -130,14 +139,14 @@ addopts = "--pyargs --cov-report term:skip-covered --cov-report term-missing -m
130139
python_files = "test*.py"
131140
junit_family = "xunit2"
132141
markers = [
133-
"lineitems: debug line items",
134-
"integration: integration tests that send calls to the API - select with '-m integration'",
135-
"lite: tests for mindee-lite",
136-
"v2: tests specific to version 2 of the API",
137-
"pillow: tests that require the use of the Pillow (PIL) library",
138-
"pypdfium2: tests that require the usage of the pypdfium2 library",
139-
"regression: marks tests as regression tests - select with '-m regression'",
142+
"lineitems: debug line items",
143+
"integration: integration tests that send calls to the API - select with '-m integration'",
144+
"lite: tests for mindee-lite",
145+
"v2: tests specific to version 2 of the API",
146+
"pillow: tests that require the use of the Pillow (PIL) library",
147+
"pypdfium2: tests that require the usage of the pypdfium2 library",
148+
"regression: marks tests as regression tests - select with '-m regression'",
140149
]
141150
testpaths = [
142-
"tests",
151+
"tests",
143152
]

‎tests/v2/file_operations/test_crop_operation_integration.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def test_image_should_extract_crops():
5858
extracted_crops.save_all_to_disk(OUTPUT_PATH)
5959
crop0_size = os.path.getsize(OUTPUT_PATH / output_files[0])
6060
crop1_size = os.path.getsize(OUTPUT_PATH / output_files[1])
61-
assert 180000 <= crop0_size <= 230000
61+
assert 180000 <= crop0_size <= 231000
6262
assert 190000 <= crop1_size <= 230000
6363

6464

0 commit comments

Comments
 (0)