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

devtoolbox: init at 1.1.1 (and dependencies) #295583

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
65 changes: 65 additions & 0 deletions pkgs/by-name/de/devtoolbox/incompatible_ruamel_yaml.patch
@@ -0,0 +1,65 @@
diff --git a/src/services/json_yaml.py b/src/services/json_yaml.py
index 619f69f..45fa8b8 100644
--- a/src/services/json_yaml.py
+++ b/src/services/json_yaml.py
@@ -3,9 +3,9 @@
# SPDX-License-Identifier: GPL-3.0-or-later

from gi.repository import Gio, GObject
-from ruamel import yaml
+from ruamel.yaml import YAML
import json
-
+from io import StringIO

class JsonYamlService():

@@ -25,15 +25,15 @@ class JsonYamlService():
task.return_value(outcome)

def _convert_json_to_yaml(self, json_str:str, indents:int) -> str:
- return yaml.dump(
- json.loads(json_str),
- indent=indents,
- default_flow_style=False
- )
+ output_buffer = StringIO()
+ yaml = YAML(typ='unsafe', pure=True)
+ yaml.dump(json.loads(json_str), output_buffer)
+ return output_buffer.getvalue()

def _convert_yaml_to_json(self, yaml_str:str, indents:int) -> str:
+ yaml = YAML(typ='rt')
return json.dumps(
- yaml.load(yaml_str, Loader=yaml.Loader),
+ yaml.load(yaml_str),
indent=indents,
ensure_ascii=False
)
diff --git a/src/utils.py b/src/utils.py
index e2aecb1..b7a6821 100644
--- a/src/utils.py
+++ b/src/utils.py
@@ -3,7 +3,7 @@
# SPDX-License-Identifier: GPL-3.0-or-later

from gi.repository import Gdk, GLib
-from ruamel import yaml
+from ruamel.yaml import YAML, YAMLError
from enum import Enum
from lxml import etree
from crontab import CronSlices
@@ -52,10 +52,11 @@ class Utils:

@staticmethod
def is_yaml(test_input) -> bool:
+ yaml = YAML(typ='rt')
try:
- yaml.load(test_input, Loader=yaml.Loader)
+ yaml.load(test_input)
return True
- except yaml.YAMLError:
+ except YAMLError:
return False

@staticmethod
118 changes: 118 additions & 0 deletions pkgs/by-name/de/devtoolbox/package.nix
@@ -0,0 +1,118 @@
{ lib
, python3Packages
, fetchFromGitHub
, meson
, ninja
, pkg-config
, gobject-introspection
, blueprint-compiler
, wrapGAppsHook4
, desktop-file-utils
, libadwaita
, gtksourceview5
, webkitgtk_6_0
, gcr_4
, gdk-pixbuf
}:

python3Packages.buildPythonApplication rec {
pname = "devtoolbox";
version = "1.1.1";
pyproject = false;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
pyproject = false;
pyproject = false; # uses meson


src = fetchFromGitHub {
owner = "aleiepure";
repo = "devtoolbox";
rev = "v${version}";
hash = "sha256-QFGEA+VhhRlvcch2AJrEzvRJGCSqtvZdMXWUvdAGkoU=";
};

# Upstream is using an incompatible version of ruamel.yaml
# May be removed in next update
patches = [ ./incompatible_ruamel_yaml.patch ];
Comment on lines +30 to +32
Copy link
Member

Choose a reason for hiding this comment

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

Is there a commit we can fetch?


nativeBuildInputs = [
meson
ninja
pkg-config
gobject-introspection
blueprint-compiler
wrapGAppsHook4
desktop-file-utils
];

buildInputs = [
libadwaita
gtksourceview5
webkitgtk_6_0
gcr_4
gdk-pixbuf
];

propagatedBuildInputs = with python3Packages; [
pygobject3
ruamel-yaml
lxml
python-crontab
jwt
jsonschema
pytz
tzlocal
python-lorem
uuid6
textstat
markdown2
daltonlens
asn1crypto
qrcode
sqlparse
jsbeautifier
cssbeautifier
humanize
croniter
python-dateutil
];

dontWrapGApps = true;

# Contains an unusable devtoolbox-run-script
postInstall = ''
rm -r $out/devtoolbox
'';

preFixup = ''
makeWrapperArgs+=("''${gappsWrapperArgs[@]}")
'';

meta = with lib; {
description = "Development tools at your fingertips";
longDescription = ''
If you're tired of endlessly looking online for the right
tool, or to find again that website of which you don't
recall the name to do a quick conversion, this is the
right app for you. This is a collection of powerful yet
simple-to-use tools and utilities to solve the most common
daily development problems:

- JSON to YAML converter and vice-versa
- CRON expressions parser
- Formatters for common languages
- Hash generators
- Regex tester
- Markdown Previewer
- Image converters
- Much more...
'';
homepage = "https://github.com/aleiepure/devtoolbox";
license = with licenses; [
gpl3Plus
cc0
lgpl3Only
mit
unlicense
];
mainProgram = "devtoolbox";
maintainers = with maintainers; [ aleksana ];
platforms = platforms.linux; # webkitgtk_6_0 is broken on darwin
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
platforms = platforms.linux; # webkitgtk_6_0 is broken on darwin

but that is alread marked broken, is it? Then that propagates.

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

If a package is broken on a particular platform that is not a reason to mark all packages that depend on it broken for that platform.

};
}
42 changes: 42 additions & 0 deletions pkgs/development/python-modules/daltonlens/default.nix
@@ -0,0 +1,42 @@
{ lib
, buildPythonPackage
, fetchPypi
, pythonOlder
, setuptools
, setuptools-git
, numpy
, pillow
}:

buildPythonPackage rec {
version = "0.1.5";
pname = "daltonlens";
Comment on lines +12 to +13
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
version = "0.1.5";
pname = "daltonlens";
pname = "daltonlens";
version = "0.1.5";

disabled = pythonOlder "3.7";
pyproject = true;

src = fetchPypi {
inherit pname version;
hash = "sha256-T7fXlRdFtcVw5WURPqZhCmulUi1ZnCfCXgcLtTHeNas=";
};

buildInputs = [
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
buildInputs = [
nativeBuildInputs = [

setuptools
setuptools-git
];

propagatedBuildInputs = [
numpy
pillow
];

Copy link
Member

Choose a reason for hiding this comment

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

pythonImportsCheck = [
"daltonlens"
];

meta = with lib; {
description = "R&D companion package for the desktop application DaltonLens";
homepage = "https://github.com/DaltonLens/DaltonLens-Python";
license = licenses.mit;
maintainers = with maintainers; [ aleksana ];
};
}
33 changes: 33 additions & 0 deletions pkgs/development/python-modules/python-lorem/default.nix
@@ -0,0 +1,33 @@
{ lib
, buildPythonPackage
, fetchPypi
, pythonOlder
, setuptools
}:

buildPythonPackage rec {
version = "1.3.0.post1";
pname = "python-lorem";
Comment on lines +9 to +10
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
version = "1.3.0.post1";
pname = "python-lorem";
pname = "python-lorem";
version = "1.3.0.post1";

disabled = pythonOlder "3.5";
pyproject = true;

src = fetchPypi {
inherit pname version;
hash = "sha256-aokLCuQq6iHpC90MLCcIQxeEArPyx1o6RU1224xZdxY=";
};

buildInputs = [
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
buildInputs = [
nativeBuildInputs = [

setuptools
];

Copy link
Member

Choose a reason for hiding this comment

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

pythonImportsCheck = [
"lorem"
];

meta = with lib; {
description = "Pythonic lorem ipsum generator";
homepage = "https://github.com/JarryShaw/lorem";
license = licenses.bsd3;
maintainers = with maintainers; [ aleksana ];
};
}
35 changes: 35 additions & 0 deletions pkgs/development/python-modules/textstat/default.nix
@@ -0,0 +1,35 @@
{ lib
, buildPythonPackage
, fetchPypi
, pythonOlder
, setuptools
, pyphen
}:

buildPythonPackage rec {
version = "0.7.3";
pname = "textstat";
disabled = pythonOlder "3.6";
pyproject = true;

src = fetchPypi {
inherit pname version;
hash = "sha256-YLY8+JSfRbuztCBeRBG7wc1m30wIrvElRYEcfm4k8BE=";
};

propagatedBuildInputs = [
setuptools
Comment on lines +19 to +21
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
propagatedBuildInputs = [
setuptools
nativeBuildInputs = [
setuptools
];
propagatedBuildInputs = [

pyphen
];

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
checkPhase = ''
./test.py
'';

pythonImportsCheck = [
"textstat"
];

meta = with lib; {
description = "Python package to calculate readability statistics of a text object";
homepage = "https://textstat.org";
license = licenses.mit;
maintainers = with maintainers; [ aleksana ];
};
}
33 changes: 33 additions & 0 deletions pkgs/development/python-modules/uuid6/default.nix
@@ -0,0 +1,33 @@
{ lib
, buildPythonPackage
, fetchPypi
, pythonOlder
, setuptools
}:

buildPythonPackage rec {
version = "2024.1.12";
pname = "uuid6";
disabled = pythonOlder "3.8";
pyproject = true;

src = fetchPypi {
inherit pname version;
hash = "sha256-7Qr7OpcwV1dfmIMgG67+QCeHyl4R4dJON3GQ8MQ/GZM=";
};

buildInputs = [
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
buildInputs = [
nativeBuildInputs = [

setuptools
];

pythonImportsCheck = [
"uuid6"
];

Copy link
Member

Choose a reason for hiding this comment

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

meta = with lib; {
description = "New time-based UUID formats which are suited for use as a database key";
homepage = "https://github.com/oittaa/uuid6-python";
license = licenses.mit;
maintainers = with maintainers; [ aleksana ];
};
}
8 changes: 8 additions & 0 deletions pkgs/top-level/python-packages.nix
Expand Up @@ -2622,6 +2622,8 @@ self: super: with self; {

dalle-mini = callPackage ../development/python-modules/dalle-mini { };

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

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

daqp = callPackage ../development/python-modules/daqp { };
Expand Down Expand Up @@ -8716,6 +8718,8 @@ self: super: with self; {

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

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

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

python-nvd3 = callPackage ../development/python-modules/python-nvd3 { };
Expand Down Expand Up @@ -14596,6 +14600,8 @@ self: super: with self; {

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

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

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

textual-dev = callPackage ../development/python-modules/textual-dev { };
Expand Down Expand Up @@ -16138,6 +16144,8 @@ self: super: with self; {

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

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

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

uvicorn = callPackage ../development/python-modules/uvicorn { };
Expand Down