-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bumping to Poetry 2 seems to be more problematic than switching to uv https://github.com/astral-sh/uv Given the main maintainer of poetry2nix now works on uv2nix it does not seem to be a bad bet to switch. nix-community/poetry2nix@f554d27 Part of request #41796 Update dev/build environment [W07 2025]
- Loading branch information
Showing
9 changed files
with
457 additions
and
621 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,25 @@ | ||
{ pkgs ? (import ./pinned-nixpkgs.nix) { } }: | ||
[ | ||
let | ||
pythonWorkspace = pkgs.uv2nix.lib.workspace.loadWorkspace { workspaceRoot = ../.; }; | ||
pythonSet = (pkgs.callPackage pkgs.pyproject-nix.build.packages { | ||
python = pkgs.python3; | ||
}).overrideScope | ||
( | ||
pkgs.lib.composeManyExtensions [ | ||
pkgs.pyproject-build-systems | ||
(pythonWorkspace.mkPyprojectOverlay { sourcePreference = "wheel"; }) | ||
(final: prev: { | ||
markupsafe = prev.markupsafe.overrideAttrs(old: { | ||
buildInputs = (old.buildInputs or [ ]) ++ final.resolveBuildSystem ( {setuptools = [];}); | ||
}); | ||
}) | ||
] | ||
); | ||
pythonVirtualenv = pythonSet.mkVirtualEnv "build-deps" pythonWorkspace.deps.all; | ||
in [ | ||
pkgs.gnumake | ||
pkgs.gnugrep | ||
pkgs.gnused | ||
pkgs.gawk | ||
(pkgs.poetry2nix.mkPoetryEnv { | ||
projectDir = ../.; | ||
# Some overrides are needed because some packages does not define their build deps correctly | ||
# or do not respect PEP 440 when defining the version | ||
# https://github.com/nix-community/poetry2nix/blob/master/docs/edgecases.md | ||
overrides = pkgs.poetry2nix.defaultPoetryOverrides.extend ( | ||
self: super: { | ||
sphinx = super.sphinx.overridePythonAttrs ( | ||
old: { | ||
buildInputs = (old.buildInputs or [ ]) ++ [ self.flit-core ]; | ||
} | ||
); | ||
sphinx-autobuild = super.sphinx-autobuild.overridePythonAttrs ( | ||
old: { | ||
buildInputs = (old.buildInputs or [ ]) ++ [ self.flit-core ]; | ||
} | ||
); | ||
sphinx-notfound-page = super.sphinx-notfound-page.overridePythonAttrs ( | ||
old: { | ||
buildInputs = (old.buildInputs or [ ]) ++ [ self.flit-core ]; | ||
} | ||
); | ||
sphinxcontrib-jquery = super.sphinxcontrib-jquery.overridePythonAttrs ( | ||
old: { | ||
buildInputs = (old.buildInputs or [ ]) ++ [ self.flit-core ]; | ||
} | ||
); | ||
sphinxext-rediraffe = super.sphinxext-rediraffe.overridePythonAttrs ( | ||
old: { | ||
buildInputs = (old.buildInputs or [ ]) ++ [ super.setuptools ]; | ||
postPatch = '' | ||
substituteInPlace setup.py --replace 'version = "main"' 'version = "${old.version}"' | ||
''; | ||
} | ||
); | ||
} | ||
); | ||
}) | ||
pythonVirtualenv | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ pkgs }: | ||
[ | ||
pkgs.poetry | ||
pkgs.uv | ||
pkgs.nodejs-slim | ||
pkgs.nodePackages.npm | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
FROM nixos/nix:2.26.2@sha256:3bb728719e2c4e478df4c50b80f93adbe27d5c561d1417c3a2306eb914d910da | ||
|
||
COPY build-support/*.nix /build-support/ | ||
COPY pyproject.toml poetry.lock / | ||
COPY pyproject.toml uv.lock / | ||
|
||
RUN nix-env -i -f build-support/build-tools.nix |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.