Skip to content

Commit afd0388

Browse files
committed
Migrate to a src/ layout
This prevents the test suite from accidentally passing when a packaging problem is masked by `jsonpath_ng` being importable from the root of the repository. See #209 for a PR that demonstrates the consequences of having `jsonpath_ng/` as a folder in the root of the repo. In addition, this migrates from `setup.py` to `pyproject.toml`. With this change, the project can be built with these commands: ``` pip install build python -m build ```
1 parent 4b36862 commit afd0388

19 files changed

Lines changed: 31 additions & 37 deletions

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ __pycache__/
1010
# Build and test artifacts
1111
/README.txt
1212
/dist
13-
/*.egg-info
13+
*.egg-info
1414
parser.out
1515
.cache
1616
.coverage

pyproject.toml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,33 @@
1+
[build-system]
2+
requires = ["setuptools >= 77.0.3"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "jsonpath-ng"
7+
version = "1.8.0"
8+
description="A final implementation of JSONPath for Python that aims to be standard compliant, including arithmetic and binary comparison operators and providing clear AST for metaprogramming."
9+
authors = [
10+
{name = "Tomas Aparicio", email = "tomas@aparicio.me"},
11+
]
12+
license = "Apache-2.0"
13+
readme = "README.rst"
14+
classifiers=[
15+
"Development Status :: 5 - Production/Stable",
16+
"Intended Audience :: Developers",
17+
"Programming Language :: Python :: 3",
18+
"Programming Language :: Python :: 3.10",
19+
"Programming Language :: Python :: 3.11",
20+
"Programming Language :: Python :: 3.12",
21+
"Programming Language :: Python :: 3.13",
22+
"Programming Language :: Python :: 3.14",
23+
]
24+
25+
[project.urls]
26+
Source = "https://github.com/h2non/jsonpath-ng"
27+
28+
[project.scripts]
29+
jsonpath_ng = "jsonpath_ng.bin.jsonpath:entry_point"
30+
131
[tool.pytest.ini_options]
232
filterwarnings = [
333
# Escalate warnings to errors.

setup.py

Lines changed: 0 additions & 36 deletions
This file was deleted.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)