Skip to content

Commit c60537c

Browse files
committed
Move from legacy setup.py to pyproject.toml with flit
This change simplifies the build logic on the new packaging metadata format provided with `pyproject.toml` using the flit build backend. The setuptools build backend wasn't featureful enough to be usable. This still doesn't fix the fact that installing `deepdiff` results in a broken `deep` CLI command, but it at least pushes the ball towards a world where that will be possible, someday. Signed-off-by: Enji Cooper <[email protected]>
1 parent 0d55a11 commit c60537c

10 files changed

+141
-109
lines changed

setup.cfg renamed to .bumpversion.cfg

+1-8
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,7 @@ commit = True
44
tag = True
55
tag_name = {new_version}
66

7-
[flake8]
8-
max-line-length = 120
9-
builtins = json
10-
statistics = true
11-
ignore = E202
12-
exclude = ./data,./src,.svn,CVS,.bzr,.hg,.git,__pycache__
13-
14-
[bumpversion:file:setup.py]
7+
[bumpversion:file:pyproject.toml]
158

169
[bumpversion:file:README.md]
1710

pyproject.toml

+140
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
[build-system]
2+
requires = ["flit_core >=3.11,<4"]
3+
build-backend = "flit_core.buildapi"
4+
5+
[project]
6+
name = "deepdiff"
7+
version = "8.4.2"
8+
dependencies = [
9+
"orderly-set>=5.3.0,<6",
10+
]
11+
requires-python = ">=3.8"
12+
authors = [
13+
{ name = "Seperman", email = "[email protected]" }
14+
]
15+
maintainers = [
16+
{ name = "Seperman", email = "[email protected]" }
17+
]
18+
description = "Deep Difference and Search of any Python object/data. Recreate objects by adding adding deltas to each other."
19+
readme = "README.md"
20+
license = {file = "LICENSE"}
21+
keywords = []
22+
classifiers = [
23+
"Intended Audience :: Developers",
24+
"Operating System :: OS Independent",
25+
"Topic :: Software Development",
26+
"Programming Language :: Python :: 3.8",
27+
"Programming Language :: Python :: 3.9",
28+
"Programming Language :: Python :: 3.10",
29+
"Programming Language :: Python :: 3.11",
30+
"Programming Language :: Python :: 3.12",
31+
"Programming Language :: Python :: 3.13",
32+
"Programming Language :: Python :: Implementation :: PyPy",
33+
"Development Status :: 5 - Production/Stable",
34+
"License :: OSI Approved :: MIT License"
35+
]
36+
37+
# `dependency-groups` would make this a lot cleaner, in theory.
38+
[project.optional-dependencies]
39+
coverage = [
40+
"coverage~=7.6.0"
41+
]
42+
cli = [
43+
"click~=8.1.0",
44+
"pyyaml~=6.0.0"
45+
]
46+
dev = [
47+
"bump2version~=1.0.0",
48+
"jsonpickle~=4.0.0",
49+
"ipdb~=0.13.0",
50+
"numpy~=2.2.0; python_version >= '3.10'",
51+
"numpy~=2.0; python_version < '3.10'",
52+
"python-dateutil~=2.9.0",
53+
"orjson~=3.10.0",
54+
"tomli~=2.2.0",
55+
"tomli-w~=1.2.0",
56+
"pandas~=2.2.0",
57+
"polars~=1.21.0",
58+
]
59+
docs = [
60+
# We use the html style that is not supported in Sphinx 7 anymore.
61+
"Sphinx~=6.2.0",
62+
"sphinx-sitemap~=2.6.0",
63+
"sphinxemoji~=0.3.0"
64+
]
65+
static = [
66+
"flake8~=7.1.0",
67+
"flake8-pyproject~=1.2.3",
68+
"pydantic~=2.10.0",
69+
"types-setuptools~=75.8.0; python_version > '3.8'",
70+
]
71+
test = [
72+
"pytest~=8.3.0",
73+
"pytest-benchmark~=5.1.0",
74+
"pytest-cov~=6.0.0",
75+
"python-dotenv~=1.0.0",
76+
]
77+
78+
[project.scripts]
79+
deep = "deepdiff.commands:cli"
80+
81+
[project.urls]
82+
Homepage = "https://zepworks.com/deepdiff/"
83+
Documentation = "https://zepworks.com/deepdiff/"
84+
Repository = "https://github.com/seperman/deepdiff"
85+
Issues = "https://github.com/seperman/deepdiff/issues"
86+
87+
[tool.coverage.run]
88+
branch = true
89+
source = ["."]
90+
91+
[tool.flake8]
92+
max-line-length = 120
93+
builtins = "json"
94+
statistics = true
95+
ignore = "E202"
96+
exclude = "./data,./src,.svn,CVS,.bzr,.hg,.git,__pycache__"
97+
98+
[tool.pytest.ini_options]
99+
addopts = "--pdbcls=IPython.terminal.debugger:Pdb"
100+
101+
[tool.setuptools]
102+
packages = ["deepdiff"]
103+
104+
[tool.setuptools.package-metadata]
105+
deepdiff = ["py.typed"]
106+
107+
[tool.tox]
108+
legacy_tox_ini = """
109+
[tox]
110+
min_version = 4.0
111+
env_list =
112+
py38
113+
py39
114+
py310
115+
py311
116+
py312
117+
py313
118+
static
119+
120+
[testenv]
121+
deps =
122+
.[cli]
123+
.[coverage]
124+
.[dev]
125+
.[static]
126+
.[test]
127+
commands =
128+
python -m pytest --cov=deepdiff --cov-report term-missing {posargs:-vv tests}
129+
130+
[testenv:static]
131+
deps =
132+
.[cli]
133+
.[dev]
134+
.[static]
135+
.[test]
136+
mypy
137+
commands =
138+
-python -m flake8 {posargs:deepdiff}
139+
-python -m mypy --install-types --non-interactive {posargs:deepdiff}
140+
"""

pytest.ini

-2
This file was deleted.

requirements-cli.txt

-2
This file was deleted.

requirements-dev.txt

-22
This file was deleted.

requirements-docs.txt

-3
This file was deleted.

requirements-optimize.txt

-1
This file was deleted.

requirements.txt

-1
This file was deleted.

run_tests.sh

-1
This file was deleted.

setup.py

-69
This file was deleted.

0 commit comments

Comments
 (0)