Skip to content

Commit f9d551f

Browse files
Update configuration and development tools
- Migrate from setup.cfg to pyproject.toml for modern Python packaging - Add .flake8 configuration for linting - Update pre-commit hooks with black, isort, flake8, pylint, and bandit - Remove obsolete config files (.pylintrc, mypy.ini, pytest.ini, setup.cfg) - Update requirements and development dependencies - Update pyproject.toml
1 parent 9febc63 commit f9d551f

11 files changed

Lines changed: 75 additions & 127 deletions

.pre-commit-config.yaml

Lines changed: 20 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,22 @@
11
repos:
2-
- repo: https://github.com/psf/black
3-
rev: 25.9.0
4-
hooks:
5-
- id: black
6-
additional_dependencies: [black]
7-
language_version: python3
8-
- repo: https://github.com/pre-commit/mirrors-pylint
9-
rev: v3.0.0a5
10-
hooks:
11-
- id: pylint
12-
additional_dependencies:
13-
- pylint
14-
- PyJWT
15-
- pytest
16-
- requests
17-
language_version: python3
18-
entry: bash -c 'PYTHONPATH=. pylint "$@"' --
19-
- repo: https://github.com/PyCQA/isort
20-
rev: 6.0.1
21-
hooks:
22-
- id: isort
23-
additional_dependencies: [isort]
24-
language_version: python3
25-
- repo: https://github.com/pycqa/flake8
26-
rev: 7.3.0
27-
hooks:
28-
- id: flake8
29-
additional_dependencies: [flake8]
30-
language_version: python3
31-
- repo: https://github.com/pre-commit/pre-commit-hooks
32-
rev: v6.0.0
33-
hooks:
34-
- id: trailing-whitespace
35-
- id: end-of-file-fixer
36-
- id: check-yaml
37-
- id: check-added-large-files
38-
- repo: https://github.com/PyCQA/bandit
39-
rev: 1.8.6
40-
hooks:
41-
- id: bandit
42-
files: ^ilovepdf/
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v6.0.0
4+
hooks:
5+
- id: trailing-whitespace
6+
- id: end-of-file-fixer
7+
- id: check-yaml
8+
- id: check-added-large-files
9+
- id: check-toml
4310

44-
default_language_version:
45-
python: python3
11+
- repo: https://github.com/astral-sh/ruff-pre-commit
12+
rev: v0.15.5
13+
hooks:
14+
- id: ruff
15+
args: [--fix]
16+
- id: ruff-format
17+
18+
- repo: https://github.com/RobertCraigie/pyright-python
19+
rev: v1.1.408
20+
hooks:
21+
- id: pyright
22+
language: system

.pylintrc

Lines changed: 0 additions & 2 deletions
This file was deleted.

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 iLovePDF
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

MANIFEST.in

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,9 @@ global-exclude .pytest_cache
2929
prune tests
3030
prune .docker
3131
prune .gitea
32-
exclude AGENTS.md
3332
exclude requirements_test.txt
3433
exclude requirements_dev.txt
3534
exclude .dockerignore
36-
exclude pytest.ini
3735

3836
# Exclude editor and IDE files
3937
global-exclude .vscode

mypy.ini

Lines changed: 0 additions & 15 deletions
This file was deleted.

pyproject.toml

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,15 @@ name = "ilovepdf"
33
description = "iLovePDF Python API"
44
version = "0.0.1"
55
authors = [{ name = "ilovepdf", email = "info@ilovepdf.com" }]
6-
license = { file = "LICENSE" }
6+
license = "MIT"
77
readme = "README.md"
88

99
requires-python = ">=3.10"
10-
dependencies = ["requests>=2.28.0", "pyjwt>=2.4.0"]
10+
dependencies = ["requests>=2.28.0", "pyjwt>=2.4.0", "python-dotenv>=1.0.0"]
1111

1212
classifiers = [
1313
"Development Status :: 3 - Alpha",
1414
"Intended Audience :: Developers",
15-
"License :: OSI Approved :: MIT License",
1615
"Programming Language :: Python :: 3",
1716
"Programming Language :: Python :: 3.10",
1817
"Programming Language :: Python :: 3.11",
@@ -33,33 +32,35 @@ where = ["."]
3332
requires = ["setuptools>=61.0", "wheel"]
3433
build-backend = "setuptools.build_meta"
3534

36-
[tool.black]
37-
line-length = 88
38-
target-version = ["py310", "py311", "py312", "py313", "py314"]
39-
skip-string-normalization = false
40-
extend-exclude = "samples/"
35+
[tool.pytest.ini_options]
36+
pythonpath = ["ilovepdf"]
37+
testpaths = ["tests"]
38+
python_files = ["test_*.py", "*_test.py"]
39+
addopts = "--color=yes -vv --reruns 1 --reruns-delay 3 --tb=short"
40+
log_cli = true
41+
log_cli_level = "INFO"
4142

42-
[tool.isort]
43-
profile = "black"
44-
line_length = 88
45-
py_version = 310
46-
combine_as_imports = true
47-
include_trailing_comma = true
48-
force_grid_wrap = 0
49-
skip_glob = ["samples/*"]
43+
[tool.ruff]
44+
line-length = 88
45+
target-version = "py310"
46+
extend-exclude = ["samples/"]
5047

51-
known_first_party = ["ilovepdf"]
48+
[tool.ruff.lint]
49+
select = ["E", "F", "I", "B", "S", "UP"]
5250

53-
[tool.flake8]
54-
exclude = ".git,future,venv,samples"
55-
max-line-length = 88
56-
extend-ignore = ["E203"]
5751

58-
[tool.pylint.format]
59-
max-line-length = 88
52+
[tool.ruff.lint.per-file-ignores]
53+
"tests/*" = ["S101", "S105" , "S106"]
6054

61-
[tool.pylint."MESSAGES CONTROL"]
62-
disable = ["C0116"]
55+
[tool.pyright]
56+
include = ["ilovepdf", "tests", "samples"]
57+
exclude = [
58+
"**/venv", "**/.venv", "**/build", "**/dist",
59+
"**/.pytest_cache", "**/__pycache__"
60+
]
61+
pythonVersion = "3.10"
62+
pythonPlatform = "Linux"
63+
typeCheckingMode = "basic"
64+
reportDeprecated = true
6365

64-
[tool.pylint.master]
65-
ignore = ["samples"]
66+
reportMissingImports = true

pyrightconfig.json

Lines changed: 0 additions & 18 deletions
This file was deleted.

pytest.ini

Lines changed: 0 additions & 7 deletions
This file was deleted.

requirements.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
requests;
2-
PyJWT>=2.10.1
1+
requests>=2.28.0
2+
PyJWT>=2.4.0
3+
python-dotenv>=1.0.0

requirements_dev.txt

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
-r requirements.txt
2-
black>=23.1.0;
3-
flake8>=6.0.0;
4-
flake8-bugbear
5-
isort>=5.12.0;
6-
pre-commit>=3.3.0;
7-
pylint
8-
pyright
2+
pre-commit>=3.3.0
3+
pyright>=1.1.408
94
python-lsp-server
10-
autopep8
11-
python-dotenv
5+
ruff>=0.15.5

0 commit comments

Comments
 (0)