Skip to content

Update setup.py#209

Merged
michaelmior merged 1 commit into
h2non:masterfrom
thanusiak:master
Feb 24, 2026
Merged

Update setup.py#209
michaelmior merged 1 commit into
h2non:masterfrom
thanusiak:master

Conversation

@thanusiak
Copy link
Copy Markdown

Handle:

jsonpath_ng/parser.py", line 5, in <module>
    import jsonpath_ng._ply.yacc
ModuleNotFoundError: No module named 'jsonpath_ng._ply'

Enable installing the package via pip with correct _ply resolution

Copy link
Copy Markdown

@kurtmckee kurtmckee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@michaelmior I'm able to confirm this bug. It appears that this is the classic "not-using-a-src-directory" bug. Having jsonpath_ng/ as a top-level directory appears to have masked this problem.

In addition to merging this PR to address the failure, jsonpath-ng needs to migrate to a src-based directory layout to detect failures like this in the future.

@michaelmior michaelmior merged commit ee53af8 into h2non:master Feb 24, 2026
7 checks passed
kurtmckee added a commit to kurtmckee/pr-jsonpath-ng that referenced this pull request Mar 22, 2026
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 h2non#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
```
kurtmckee added a commit to kurtmckee/pr-jsonpath-ng that referenced this pull request Mar 22, 2026
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 h2non#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
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants