Bug 264452 - devel/py-jsonschema: Include schemas in build
Summary: devel/py-jsonschema: Include schemas in build
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Muhammad Moinur Rahman
URL:
Keywords: regression
Depends on:
Blocks: 264448 264460
  Show dependency treegraph
 
Reported: 2022-06-04 16:40 UTC by Sascha Biberhofer
Modified: 2022-06-05 22:36 UTC (History)
2 users (show)

See Also:
koobs: maintainer-feedback+


Attachments
devel/py-jsonschema: include schemas in build (8.94 KB, patch)
2022-06-04 16:40 UTC, Sascha Biberhofer
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sascha Biberhofer 2022-06-04 16:40:22 UTC
Created attachment 234447 [details]
devel/py-jsonschema: include schemas in build

devel/py-jsonschema's build processes was moved to hatch with 4.6.0. Our port currently tries to rely on a setup.py stub, but this yields an incomplete package. Most notably, the JSON schema files are missing from the package, which basically breaks the port.

This diff includes a setup.py generated via a hatch sdist build and adds the schema files to the MANIFEST.in file to include them in the resulting package.

This was initially reported to me by Stefan Hämmerl <stefan.haemmerl@gmx.de>, who noticed the resulting breakage on his synapse server. :)
Comment 1 Sascha Biberhofer 2022-06-04 16:58:02 UTC
Addendum for future reference, perhaps:

The method I used for obtaining the setup.py file is to add

[tool.hatch.build.targets.sdist]
support-legacy = true

to pyproject.toml. Afterwards, building an sdist with `python3 -m build -s` yields a corresponding archive in dist/jsonschema-4.6.0.tar.gz, from which the setup.py file can be extracted. The latter build still doesn't contain the subdirectory in MANIFEST.in though, so it didn't fix the issue entirely.

I'm not entirely convinced if adding the graft entry to MANIFEST.in is the best way to resolve this issue, but it was the only one I could come up with. :-/
Comment 2 commit-hook freebsd_committer freebsd_triage 2022-06-05 16:35:30 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=924f4e5dfca078753a3b12db278625b7d5377857

commit 924f4e5dfca078753a3b12db278625b7d5377857
Author:     Sascha Biberhofer <ports@skyforge.at>
AuthorDate: 2022-06-05 16:27:04 +0000
Commit:     Muhammad Moinur Rahman <bofh@FreeBSD.org>
CommitDate: 2022-06-05 16:34:00 +0000

    devel/py-jsonschema: Include schemas

    After the latest upgrade to 4.6.0 the pkg was missing the schemas file
    as the new hatch build system which doesn't create the full files as our
    building procedure requires dependency on a stub setup.py file.

    For future reference:
    The method I used for obtaining the setup.py file is to add

    [tool.hatch.build.targets.sdist]
    support-legacy = true

    to pyproject.toml. Afterwards, building an sdist with `python3 -m build
    -s` yields a corresponding archive in dist/jsonschema-4.6.0.tar.gz, from
    which the setup.py file can be extracted. The latter build still doesn't
    contain the subdirectory in MANIFEST.in though, so it didn't fix the
    issue entirely.

    While there are lots of dependent ports for now I am committing this but
    will look into a better solution to adapt the situation.

    PR:             264452
    Reported by:    stefan.haemmerl@gmx.de

 devel/py-jsonschema/Makefile                      |  1 +
 devel/py-jsonschema/files/patch-MANIFEST.in (new) |  7 +++
 devel/py-jsonschema/files/patch-setup.py          | 76 ++++++++++++++++++++---
 3 files changed, 74 insertions(+), 10 deletions(-)
Comment 3 Muhammad Moinur Rahman freebsd_committer freebsd_triage 2022-06-05 16:40:27 UTC
Committed with changes.