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
base: master
Are you sure you want to change the base?
Changes from all commits
374bc9c
66d8157
c555cc7
f9749e6
0a4952e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
@@ -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; | ||||
|
||||
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
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
but that is alread marked broken, is it? Then that propagates. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Related: #295645 (comment) There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||||
}; | ||||
} |
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
@@ -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
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
disabled = pythonOlder "3.7"; | ||||||||||
pyproject = true; | ||||||||||
|
||||||||||
src = fetchPypi { | ||||||||||
inherit pname version; | ||||||||||
hash = "sha256-T7fXlRdFtcVw5WURPqZhCmulUi1ZnCfCXgcLtTHeNas="; | ||||||||||
}; | ||||||||||
|
||||||||||
buildInputs = [ | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
setuptools | ||||||||||
setuptools-git | ||||||||||
]; | ||||||||||
|
||||||||||
propagatedBuildInputs = [ | ||||||||||
numpy | ||||||||||
pillow | ||||||||||
]; | ||||||||||
|
||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please execute the tests https://github.com/DaltonLens/DaltonLens-Python/tree/master/tests |
||||||||||
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 ]; | ||||||||||
}; | ||||||||||
} |
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
@@ -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
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
disabled = pythonOlder "3.5"; | ||||||||||
pyproject = true; | ||||||||||
|
||||||||||
src = fetchPypi { | ||||||||||
inherit pname version; | ||||||||||
hash = "sha256-aokLCuQq6iHpC90MLCcIQxeEArPyx1o6RU1224xZdxY="; | ||||||||||
}; | ||||||||||
|
||||||||||
buildInputs = [ | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
setuptools | ||||||||||
]; | ||||||||||
|
||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please execute the tests https://github.com/JarryShaw/lorem/blob/master/test_lorem.py |
||||||||||
pythonImportsCheck = [ | ||||||||||
"lorem" | ||||||||||
]; | ||||||||||
|
||||||||||
meta = with lib; { | ||||||||||
description = "Pythonic lorem ipsum generator"; | ||||||||||
homepage = "https://github.com/JarryShaw/lorem"; | ||||||||||
license = licenses.bsd3; | ||||||||||
maintainers = with maintainers; [ aleksana ]; | ||||||||||
}; | ||||||||||
} |
Original file line number | Diff line number | Diff line change | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -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
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||
pyphen | ||||||||||||||||||||
]; | ||||||||||||||||||||
|
||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||
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 ]; | ||||||||||||||||||||
}; | ||||||||||||||||||||
} |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -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 = [ | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
setuptools | ||||||
]; | ||||||
|
||||||
pythonImportsCheck = [ | ||||||
"uuid6" | ||||||
]; | ||||||
|
||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please execute the tests https://github.com/oittaa/uuid6-python/tree/main/test |
||||||
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 ]; | ||||||
}; | ||||||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.