Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python3Packages.orange3: setup direct dependencies to fetch from GitHub + bump #354279

Merged
merged 10 commits into from
Dec 30, 2024
11 changes: 8 additions & 3 deletions pkgs/development/python-modules/orange-canvas-core/default.nix
Original file line number Diff line number Diff line change
@@ -16,6 +16,7 @@
lockfile,
numpy,
pip,
trubar,
qasync,
requests-cache,
typing-extensions,
@@ -26,18 +27,19 @@
pytestCheckHook,

stdenv,
gitUpdater,
}:

buildPythonPackage rec {
pname = "orange-canvas-core";
version = "0.2.2";
version = "0.2.4";
pyproject = true;

src = fetchFromGitHub {
owner = "biolab";
repo = "orange-canvas-core";
rev = "refs/tags/${version}";
hash = "sha256-Jp3vCQmRdkFADStVkbCFPiCBqpbI0a4JiJ8qs60rpqw=";
tag = version;
hash = "sha256-tLFWOXsAhqxFV0wdlAKestO/F/rDtdFnKDd0FXPeNpg=";
};

build-system = [ setuptools ];
@@ -55,6 +57,7 @@ buildPythonPackage rec {
qasync
requests-cache
typing-extensions
trubar
];

pythonImportsCheck = [ "orangecanvas" ];
@@ -85,6 +88,8 @@ buildPythonPackage rec {
"test_widgettoolgrid"
];

passthru.updateScript = gitUpdater { };

disabledTestPaths = [ "orangecanvas/canvas/items/tests/test_graphicstextitem.py" ];

meta = {
22 changes: 15 additions & 7 deletions pkgs/development/python-modules/orange-widget-base/default.nix
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
{
lib,
gitUpdater,
stdenv,
buildPythonPackage,
fetchPypi,
setuptools,
fetchFromGitHub,
pyqt5,
pyqtwebengine,
matplotlib,
@@ -17,15 +19,19 @@

buildPythonPackage rec {
pname = "orange-widget-base";
version = "4.24.0";
format = "setuptools";
version = "4.25.0";
pyproject = true;

src = fetchPypi {
inherit pname version;
hash = "sha256-2cBg7s4+qMrb2G4sMk5yednOzJCNheHIQ3lty4KAg18=";
build-system = [ setuptools ];

src = fetchFromGitHub {
owner = "biolab";
repo = "orange-widget-base";
tag = version;
hash = "sha256-tWo8vwC8xLA2ZKeab2GqpXGdlHhaqOT9wu1efqSHZSg=";
};

propagatedBuildInputs = [
dependencies = [
matplotlib
orange-canvas-core
pyqt5
@@ -53,6 +59,8 @@ buildPythonPackage rec {
"orangewidget/tests/test_widget.py"
];

passthru.updateScript = gitUpdater { };

meta = {
description = "Implementation of the base OWBaseWidget class and utilities for use in Orange Canvas workflows";
homepage = "https://github.com/biolab/orange-widget-base";
12 changes: 6 additions & 6 deletions pkgs/development/python-modules/orange3/default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
lib,
gitUpdater,
stdenv,
baycomp,
bottleneck,
@@ -17,7 +18,6 @@
keyrings-alt,
makeDesktopItem,
matplotlib,
nix-update-script,
numpy,
oldest-supported-numpy,
openpyxl,
@@ -60,7 +60,7 @@ let
src = fetchFromGitHub {
owner = "biolab";
repo = "orange3";
rev = "refs/tags/${version}";
tag = version;
hash = "sha256-3PybiHXH6oIYJb78/a7LnQA6cYUicDx4Mf65QhIhT4w=";
};

@@ -165,7 +165,7 @@ let
'';

passthru = {
updateScript = nix-update-script { };
updateScript = gitUpdater { };
tests.unittests = stdenv.mkDerivation {
name = "${self.name}-tests";
inherit (self) src;
@@ -211,12 +211,12 @@ let
};
};

meta = with lib; {
meta = {
description = "Data mining and visualization toolbox for novice and expert alike";
homepage = "https://orangedatamining.com/";
changelog = "https://github.com/biolab/orange3/blob/${version}/CHANGELOG.md";
license = with licenses; [ gpl3Plus ];
maintainers = with maintainers; [ lucasew ];
license = [ lib.licenses.gpl3Plus ];
maintainers = [ lib.maintainers.lucasew ];
mainProgram = "orange-canvas";
};
};
44 changes: 44 additions & 0 deletions pkgs/development/python-modules/trubar/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,
setuptools,
gitUpdater,
pytestCheckHook,
libcst,
pyyaml,
}:

buildPythonPackage rec {
pname = "trubar";
version = "0.3.4";
pyproject = true;

src = fetchFromGitHub {
owner = "janezd";
repo = "trubar";
tag = version;
hash = "sha256-ChKmeACEMnFcMYSdkdVlFiE3td171ihUS2A+qsP5ASk=";
};

build-system = [ setuptools ];

dependencies = [
libcst
pyyaml
];

pythonImportsCheck = [ "trubar" ];

nativeCheckInputs = [ pytestCheckHook ];

passthru.updateScript = gitUpdater { };
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not nix-update-script ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simpler, and the actual code is in nixpkgs already. BTW there is a generic updater that you can setup by just giving a command that list the versions available

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I was not aware of that. So basically it is (or should be) recommended over nix-update-script for all packages using fetchFromGit* ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anything using git should work.

If they use some kind of tag prefix such as v or sscg- then you pass it using the rev-prefix parameter and that's it.

If you want always the latest commit then you use unstableGitUpdater, and there is genericUpdater when the source is not git, you basically pass a script to list versions then it takes the latest one by comparison then change the hashes automatically. This version list is a bit clunky because the system expects you to pass a expression that takes package information as an argument, I did an example of that in #354277 tho.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok good to know ! Thank you for the explanation :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I think that specifying the updater is useless for packages under python3Packages as they all inherit an updater (nix-update-script I think) by default.

Hence, I would actually get rid of those.
Maybe @mweinelt can confirm.


meta = {
description = "Utility for translation of strings and f-strings in Python files";
homepage = "https://github.com/janezd/trubar";
changelog = "https://github.com/janezd/trubar/releases/tag/${version}";
license = [ lib.licenses.mit ];
maintainers = [ lib.maintainers.lucasew ];
};
}
2 changes: 2 additions & 0 deletions pkgs/top-level/python-packages.nix
Original file line number Diff line number Diff line change
@@ -16415,6 +16415,8 @@ self: super: with self; {

trove-classifiers = callPackage ../development/python-modules/trove-classifiers { };

trubar = callPackage ../development/python-modules/trubar { };

trueskill = callPackage ../development/python-modules/trueskill { };

truncnorm = callPackage ../development/python-modules/truncnorm { };