Skip to content

Commit

Permalink
Add Python build dependencies for jsonschema >= 4.6.0
Browse files Browse the repository at this point in the history
The `jsonschema` module switched the packaging system to Hatch since
version 4.6.0 (python-jsonschema/jsonschema#957).  The build process for
`jsonschema` now requires the `hatchling` and `hatch-vcs` modules, but
the used Nixpkgs snapshot does not include Nix packages for these
modules; adding these modules to the `[tool.poetry.dev-dependencies]`
section makes them available for the (upcoming) poetry2nix override
without the need to bump the Nixpkgs snapshot.

However, simply adding `hatchling` and `hatch-vcs` to dependencies
produces some more dependency issues:

  1) The `pytest` module in the used Nixpkgs snapshot is old and has a
     dependency for the `pluggy` module with an upper bound for the
     version, which creates a version conflict with the dependency of
     the `hatchling` module.  Upgrading the `pytest` module to the
     current version fixes this compatibility issue.

  2) The `tomli` module, which is in the dependency tree of `hatchling`,
     requires a newer `flit-core` module than found in the used Nixpkgs
     snapshot.  Again, upgrading the `flit-core` module to the current
     version fixes the compatibility issue.

When the Nixpkgs snapshot gets bumped in the future, this commit should
probably be reverted (and `poetry.lock` should be regenerated to remove
the unneeded dependencies).
  • Loading branch information
sigprof committed Jun 12, 2022
1 parent b64e806 commit 7cebe50
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions nix/pyproject.toml
Expand Up @@ -32,6 +32,21 @@ flake8 = "*"
pep8-naming = "*"
yapf = "*"

# These dependencies are required by the jsonschema >= 4.6.0 build system, but
# are not detected automatically; they are also not present in the used Nixpkgs
# snapshot, so need to be obtained through Poetry.
hatchling = "*"
hatch-vcs = "*"

# The `pytest` module in the used Nixpkgs snapshot has an upper bound on the
# `pluggy` dependency, which conflicts with the dependency of the `hatchling`
# module; upgrading the `pytest` module fixes the conflict.
pytest = "*"

# Building the `tomli` module, which is in the dependency tree of `hatchling`,
# requires a newer `flit-core` module than found in the used Nixpkgs snapshot.
flit-core = "*"

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

0 comments on commit 7cebe50

Please sign in to comment.