Files
millerson-overlay.nix/packages/graphify/package.nix
T
alex dcbde330e4
CI / check (push) Has been cancelled
fix(graphify): roll pin back to v0.9.77
The 1.0.0 bump took a bogus tag. Graphify-Labs/graphify carries a
v1.0.0 branch from 2026-04-05 that sits 2126 commits behind v0.9.77,
still ships pyproject name graphifyy 0.1.10, and never reached PyPI,
where 0.9.77 is the latest release. nix-update picked it because it is
the highest semver tag available.

It also does not build here. Its pyproject hard-requires graspologic,
which pulls python-future, and nixpkgs disables that for Python >= 3.13
(this flake is on 3.14). Lowering the interpreter is no way out either:
python312 fails further down the chain on falcon and hyppo. 0.9.x ships
a networkx Louvain fallback for a missing Leiden backend; 1.0.0 imports
graspologic.partition.leiden unconditionally, so it is worse code even
if it did build.

Dependency corrections for the pinned source:
- datasketch dropped: upstream vendored MinHash into
  graphify/_minhash.py, which also retires the pybloomfilter3
  dontCheckPythonMetadata workaround in default.nix
- numpy added: graphify/_minhash.py imports it directly

Verified with nix build .#graphify (pythonImportsCheck passes) and
graphify --version reporting 0.9.77.

Refs nix-overlay-olq
2026-10-06 19:50:01 +03:00

96 lines
3.4 KiB
Nix

{
lib,
python3Packages,
fetchFromGitHub,
}:
python3Packages.buildPythonApplication rec {
pname = "graphify";
version = "0.9.77";
pyproject = true;
# Do not bump to the v1.0.0 tag: it is a stale branch 2126 commits behind
# v0.9.77 (tagged 2026-04-05, pyproject still says graphifyy 0.1.10) and was
# never published to PyPI, where 0.9.77 is the latest release. nix-update
# picks v1.0.0 as the highest tag, so check PyPI before taking its result.
src = fetchFromGitHub {
owner = "Graphify-Labs";
repo = "graphify";
rev = "v${version}";
hash = "sha256-CvJ6GoV1nSzFGfLQbzKSHDUNOuOPQZaYOf/idcSHkPw=";
};
build-system = with python3Packages; [
setuptools
];
# Only tree-sitter grammars available in nixpkgs are included.
# Missing grammars will be downloaded by tree-sitter at runtime on demand.
dependencies = with python3Packages; [
networkx
numpy
rapidfuzz
tree-sitter
tree-sitter-python
tree-sitter-javascript
tree-sitter-rust
tree-sitter-c-sharp
tree-sitter-sql
];
# Remove unavailable tree-sitter grammars from pyproject.toml.
# Since 0.9.35 upstream pins versions ("tree-sitter-X>=v,<v"), and GNU sed
# mishandles `"` inside bracket expressions, match the name followed by
# either `>` (versioned) or `"` (bare) via alternation. This also avoids
# prefix collisions (e.g. tree-sitter-c vs tree-sitter-c-sharp).
postPatch = ''
# relax the build-backend pin: nixpkgs' setuptools is older than 83, but
# the PEP 639 license metadata graphify relies on needs only >=77.
sed -i 's/setuptools>=83\.[0-9.]*/setuptools/' pyproject.toml
sed -i \
-e '/tree-sitter-typescript>\|tree-sitter-typescript"/d' \
-e '/tree-sitter-go>\|tree-sitter-go"/d' \
-e '/tree-sitter-java>\|tree-sitter-java"/d' \
-e '/tree-sitter-groovy>\|tree-sitter-groovy"/d' \
-e '/tree-sitter-c>\|tree-sitter-c"/d' \
-e '/tree-sitter-cpp>\|tree-sitter-cpp"/d' \
-e '/tree-sitter-ruby>\|tree-sitter-ruby"/d' \
-e '/tree-sitter-kotlin>\|tree-sitter-kotlin"/d' \
-e '/tree-sitter-scala>\|tree-sitter-scala"/d' \
-e '/tree-sitter-php>\|tree-sitter-php"/d' \
-e '/tree-sitter-swift>\|tree-sitter-swift"/d' \
-e '/tree-sitter-lua>\|tree-sitter-lua"/d' \
-e '/tree-sitter-zig>\|tree-sitter-zig"/d' \
-e '/tree-sitter-powershell>\|tree-sitter-powershell"/d' \
-e '/tree-sitter-elixir>\|tree-sitter-elixir"/d' \
-e '/tree-sitter-objc>\|tree-sitter-objc"/d' \
-e '/tree-sitter-julia>\|tree-sitter-julia"/d' \
-e '/tree-sitter-verilog>\|tree-sitter-verilog"/d' \
-e '/tree-sitter-fortran>\|tree-sitter-fortran"/d' \
-e '/tree-sitter-bash>\|tree-sitter-bash"/d' \
-e '/tree-sitter-json>\|tree-sitter-json"/d' \
pyproject.toml
'';
doCheck = false;
pythonImportsCheck = [ "graphify" ];
passthru = {
category = "AI Coding Agents";
updateScript = [
"nix-update"
"--flake"
".#graphify"
];
};
meta = {
description = "AI coding assistant skill - turn any folder of code, docs, papers, images, or videos into a queryable knowledge graph";
homepage = "https://github.com/Graphify-Labs/graphify";
changelog = "https://github.com/Graphify-Labs/graphify/releases/tag/v${version}";
license = lib.licenses.asl20;
mainProgram = "graphify";
platforms = lib.platforms.all;
};
}