python3Packages.snappy: 3.2 -> 3.3.2, modernise (#477313)

This commit is contained in:
Sandro
2026-03-22 21:31:23 +00:00
committed by GitHub
8 changed files with 179 additions and 64 deletions
+7 -4
View File
@@ -10,13 +10,13 @@
tcl.mkTclDerivation {
pname = "tkgl";
version = "1.2.1-unstable-2025-06-01";
version = "1.2.1-unstable-2026-01-07";
src = fetchFromGitHub {
owner = "3-manifolds";
repo = "TkGL";
rev = "45bf16e6c28a070c70fc9a0eb8c47a0b6ff8a2e3";
hash = "sha256-AA5LZGhMTWmTZqI/wtycUYLsUe9BwO3voGMS7vGlCM0=";
rev = "e47636bc56f02ddca503f98abc65e31a0f0f0a7c";
hash = "sha256-Y5NIKWUjbtVn9qiVzc8TsKCm4M3KbNPiBjVTBWf7ALA=";
};
postPatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
@@ -46,6 +46,9 @@ tcl.mkTclDerivation {
description = "OpenGL drawing surface for Tk 8 and 9";
homepage = "https://github.com/3-manifolds/TkGL";
license = lib.licenses.tcltk;
maintainers = with lib.maintainers; [ noiioiu ];
maintainers = with lib.maintainers; [
noiioiu
alejo7797
];
};
}
@@ -1,45 +1,60 @@
{
lib,
fetchFromGitHub,
python,
buildPythonPackage,
fetchFromGitHub,
nix-update-script,
fetchurl,
fetchpatch,
# build-time dependencies
setuptools,
cython,
gmp,
pari,
perl,
# static libraries
pkgsStatic,
gmpStatic ? pkgsStatic.gmp,
pari,
pariStatic_2_15 ? pari.overrideAttrs (
finalAttrs: oldAttrs: {
version = "2.15.4";
src = fetchurl {
url = "https://pari.math.u-bordeaux.fr/pub/pari/OLD/${lib.versions.majorMinor finalAttrs.version}/pari-${finalAttrs.version}.tar.gz";
hash = "sha256-w1Rb/uDG37QLd/tLurr5mdguYAabn20ovLbPAEyMXA8=";
};
installTargets = [
"install"
"install-lib-sta"
];
}
),
}:
buildPythonPackage rec {
pname = "cypari";
version = "2.5.5";
version = "2.5.6";
pyproject = true;
src = fetchFromGitHub {
owner = "3-manifolds";
repo = "CyPari";
tag = "${version}_as_released";
hash = "sha256-RJ9O1KsDHmMkTCIFUrcSUkA5ijTsxmoI939QCsCib0Y=";
hash = "sha256-pzxnrWkoPW7fpxLbUQ+drIrdrjqaAiNnDfe9ky2IxaA=";
};
patches = [
(fetchpatch {
name = "support-aarch64-linux.patch";
url = "https://github.com/3-manifolds/CyPari/commit/6197171b52ee4f44a4954ddd0e2e36769b189dee.patch";
hash = "sha256-j2P7DEGD2B8q9Hh4G2mQng76fQdUpeAdFYoTD7Ui/Dk=";
})
(fetchpatch {
name = "fix-build-with-cython-3_1.patch";
url = "https://github.com/3-manifolds/CyPari/compare/622e112ffcf0383e2110954ff3ac3c42c006ebe1...50bcbd2b39177f5e4c5a3551a8a14f75ab05a5d6.patch";
hash = "sha256-6ayvtHMS3YtzzklHaaLzl9d4zHJhm0lVZQZFS9ykFY4=";
url = "https://github.com/3-manifolds/CyPari/compare/17bf39dc4508f2e46de75b95c65982c627652b60...d6cb914d2bdc74a51cc2a9136204ebf47b3e7369.diff";
hash = "sha256-c8sq80mYSMMvgFh7RXYwKcqwI7iVRQsm/8yaIL0+PHQ=";
})
];
preBuild = ''
mkdir libcache
ln -s ${gmp} libcache/gmp
ln -s ${pari} libcache/pari
ln -s ${gmpStatic} libcache/gmp
ln -s ${pariStatic_2_15} libcache/pari
'';
build-system = [
@@ -59,14 +74,21 @@ buildPythonPackage rec {
runHook postCheck
'';
passthru.updateScript = nix-update-script {
extraArgs = [
"--version-regex"
"(.*)_as_released"
];
};
meta = {
description = "Sage's PARI extension, modified to stand alone";
homepage = "https://github.com/3-manifolds/CyPari";
changelog = "https://github.com/3-manifolds/CyPari/releases/tag/${src.tag}";
license = lib.licenses.gpl2Plus;
maintainers = with lib.maintainers; [
noiioiu
alejo7797
];
changelog = "https://github.com/3-manifolds/CyPari/releases/tag/${src.tag}";
};
}
@@ -5,18 +5,19 @@
setuptools,
sphinx,
tkinter,
nix-update-script,
}:
buildPythonPackage rec {
pname = "plink";
version = "2.4.6";
version = "2.4.9";
pyproject = true;
src = fetchFromGitHub {
owner = "3-manifolds";
repo = "plink";
tag = "${version}_as_released";
hash = "sha256-+WUyQvQY9Fx47GikzJ4gcCpSIjvk5756FP0bDdF6Ack=";
hash = "sha256-+O371oWfvRvMfjXX6qZj91c7+4MBneZFNcfdrJQNCY8=";
};
build-system = [
@@ -28,6 +29,13 @@ buildPythonPackage rec {
pythonImportsCheck = [ "plink" ];
passthru.updateScript = nix-update-script {
extraArgs = [
"--version-regex"
"(.*)_as_released"
];
};
meta = {
description = "Full featured Tk-based knot and link editor";
mainProgram = "plink";
@@ -3,24 +3,32 @@
buildPythonPackage,
fetchFromGitHub,
setuptools,
nix-update-script,
}:
buildPythonPackage rec {
pname = "snappy-manifolds";
version = "1.2.1";
version = "1.4";
pyproject = true;
src = fetchFromGitHub {
owner = "3-manifolds";
repo = "snappy_manifolds";
tag = "${version}_as_released";
hash = "sha256-vxG3z6zWzG4S11fBxYGn4/c2f2sWOCIrzT+R27TR144=";
hash = "sha256-e+BoPvg0cuEqLq2f9ZPgqFMEYw7eeSEDkY42+l+kDCk=";
};
build-system = [ setuptools ];
pythonImportsCheck = [ "snappy_manifolds" ];
passthru.updateScript = nix-update-script {
extraArgs = [
"--version-regex"
"(.*)_as_released"
];
};
meta = {
description = "Database of snappy manifolds";
changelog = "https://github.com/3-manifolds/snappy_manifolds/releases/tag/${src.tag}";
@@ -1,16 +1,23 @@
{
lib,
stdenv,
fetchpatch,
fetchFromGitHub,
python,
buildPythonPackage,
fetchFromGitHub,
fetchpatch,
nix-update-script,
# build-time dependencies
setuptools,
cypari,
cython,
# non-Python runtime dependencies
libGL,
# Python runtime dependencies
cypari,
fxrays,
ipython,
libGL,
low-index,
packaging,
pickleshare,
@@ -20,14 +27,21 @@
snappy-15-knots,
snappy-manifolds,
spherogram,
tkinter-gl,
# documentation
sphinxHook,
sphinx-rtd-theme,
tkinter-gl,
# tests
runCommand,
sage,
writableTmpDirAsHomeHook,
}:
buildPythonPackage rec {
pname = "snappy";
version = "3.2";
version = "3.3.2";
pyproject = true;
outputs = [
@@ -39,7 +53,7 @@ buildPythonPackage rec {
owner = "3-manifolds";
repo = "SnapPy";
tag = "${version}_as_released";
hash = "sha256-IwPxuyVDsL5yML+J06HTKlz52sYrPkohLJ0XDXDwTlo=";
hash = "sha256-Pl4Nl0LXNvdtQ/EFVQy0QdUA/Fqoz2QAFWW5nz0bv78=";
};
patches = [
@@ -48,17 +62,12 @@ buildPythonPackage rec {
url = "https://github.com/3-manifolds/SnapPy/commit/c6aeeaaec7010a54e4ebdf2e8dad7b384c2ce8e5.patch";
hash = "sha256-OV3Qr5wO5UHNzVFTPTujIpp5ptel6gvAlcMgrJ8C0KY=";
})
(fetchpatch {
name = "fix-test-aarch64.patch";
url = "https://github.com/3-manifolds/SnapPy/commit/a8d57db39bc8f486746dc61027779168d0bc316a.patch";
hash = "sha256-RsuwaR+7UrVTKlPwQeHblTAN++La7b9BSMdFcJSiX5Q=";
})
];
postPatch =
lib.optionalString stdenv.hostPlatform.isLinux ''
substituteInPlace setup.py \
--replace-fail "/usr/include/GL" "${libGL.dev}/include/GL"
--replace-fail "/usr/include/GL" "${lib.getDev libGL}/include/GL"
substituteInPlace freedesktop/share/applications/snappy.desktop \
--replace-fail "Exec=/usr/bin/env python3 -m snappy.app" "Exec=SnapPy"
''
@@ -117,6 +126,32 @@ buildPythonPackage rec {
runHook postCheck
'';
passthru.tests.sage =
let
sage' = sage.override {
extraPythonPackages = ps: [ ps.snappy ];
requireSageTests = false;
};
in
runCommand "snappy-sage-tests"
{
nativeBuildInputs = [
sage'
writableTmpDirAsHomeHook
];
}
''
sage -python -m snappy.test --skip-gui
touch $out
'';
passthru.updateScript = nix-update-script {
extraArgs = [
"--version-regex"
"(.*)_as_released"
];
};
meta = {
description = "Studying the topology and geometry of 3-manifolds, with a focus on hyperbolic structures";
changelog = "https://snappy.computop.org/news.html";
@@ -1,26 +1,37 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,
python,
buildPythonPackage,
nix-update-script,
# build-time dependencies
setuptools,
cython,
networkx,
# runtime dependencies
decorator,
knot-floer-homology,
snappy-manifolds,
networkx,
snappy-15-knots,
snappy-manifolds,
# tests
runCommand,
sage,
writableTmpDirAsHomeHook,
}:
buildPythonPackage rec {
pname = "spherogram";
version = "2.3";
version = "2.4.1";
pyproject = true;
src = fetchFromGitHub {
owner = "3-manifolds";
repo = "spherogram";
tag = "${version}_as_released";
hash = "sha256-uqc+3xS4xulXR0tZlNuyC5Zz5OztR6c4PZWpsvU+4Pw=";
hash = "sha256-zQoNuy2rj02GAuRNDufMwA/wQ4U8ZeIADb8LpIvMFOY=";
};
build-system = [
@@ -39,6 +50,38 @@ buildPythonPackage rec {
pythonImportsCheck = [ "spherogram" ];
checkPhase = ''
runHook preCheck
${python.interpreter} -m spherogram.test
runHook postCheck
'';
passthru.tests.sage =
let
sage' = sage.override {
extraPythonPackages = ps: [ ps.spherogram ];
requireSageTests = false;
};
in
runCommand "spherogram-sage-tests"
{
nativeBuildInputs = [
sage'
writableTmpDirAsHomeHook
];
}
''
sage -python -m spherogram.test
touch $out
'';
passthru.updateScript = nix-update-script {
extraArgs = [
"--version-regex"
"(.*)_as_released"
];
};
meta = {
description = "Spherical diagrams for 3-manifold topology";
homepage = "https://snappy.computop.org/spherogram.html";
@@ -1,23 +1,25 @@
{
lib,
fetchFromGitHub,
python,
buildPythonPackage,
fetchFromGitHub,
setuptools,
setuptools-scm,
tkinter,
tkgl,
tkinter,
nix-update-script,
}:
buildPythonPackage rec {
pname = "tkinter-gl";
version = "1.0";
version = "1.1";
pyproject = true;
src = fetchFromGitHub {
owner = "3-manifolds";
repo = "tkinter_gl";
tag = "v${version}_as_released";
hash = "sha256-ObI8EEQ7mAOAuV6f+Ld4HH0xkFzqiAZqHDvzjwPA/wM";
hash = "sha256-PNxxjyVGoMw4J/SXWvVITuGMq/HypxUwDkSxeFy2Vag=";
};
postPatch = ''
@@ -25,11 +27,14 @@ buildPythonPackage rec {
rm -r src/tkinter_gl/tk
# Platform-specific directories are only necessary when using compiled TkGL
substituteInPlace src/tkinter_gl/__init__.py \
--replace-fail "pkg_dir = os.path.join(__path__[0], 'tk', sys.platform,)" \
--replace-fail "pkg_dir = os.path.join(__path__[0], 'tk', target)" \
"pkg_dir = os.path.join(__path__[0], 'tk')"
'';
build-system = [ setuptools-scm ];
build-system = [
setuptools
setuptools-scm
];
dependencies = [ tkinter ];
@@ -44,6 +49,13 @@ buildPythonPackage rec {
pythonImportsCheck = [ "tkinter_gl" ];
passthru.updateScript = nix-update-script {
extraArgs = [
"--version-regex"
"v(.*)_as_released"
];
};
meta = {
description = "Base class for GL rendering surfaces in tkinter";
changelog = "https://github.com/3-manifolds/tkinter_gl/releases/tag/${src.tag}";
+1 -17
View File
@@ -3476,23 +3476,7 @@ self: super: with self; {
cynthion = callPackage ../development/python-modules/cynthion { };
cypari = callPackage ../development/python-modules/cypari {
inherit (pkgs.pkgsStatic) gmp;
pari = pkgs.pari.overrideAttrs rec {
version = "2.15.4";
src = pkgs.fetchurl {
url = "https://pari.math.u-bordeaux.fr/pub/pari/OLD/${lib.versions.majorMinor version}/pari-${version}.tar.gz";
hash = "sha256-w1Rb/uDG37QLd/tLurr5mdguYAabn20ovLbPAEyMXA8=";
};
installTargets = [
"install"
"install-lib-sta"
];
};
};
cypari = callPackage ../development/python-modules/cypari { };
cypari2 = callPackage ../development/python-modules/cypari2 { };