diff --git a/pkgs/development/python-modules/nicegui-highcharts/default.nix b/pkgs/development/python-modules/nicegui-highcharts/default.nix new file mode 100644 index 0000000000000..a46750ff08765 --- /dev/null +++ b/pkgs/development/python-modules/nicegui-highcharts/default.nix @@ -0,0 +1,57 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + poetry-core, + setuptools, + docutils, + nicegui, + pythonOlder, +}: + +buildPythonPackage rec { + pname = "nicegui-highcharts"; + version = "2.0.2"; + pyproject = true; + + disabled = pythonOlder "3.8"; + + src = fetchFromGitHub { + owner = "zauberzeug"; + repo = "nicegui-highcharts"; + rev = "refs/tags/v${version}"; + hash = "sha256-r4X4faU7Nlq/FDbIYbTpvnC1w14XskpsNGtkEXtGrFo="; + }; + + postPatch = '' + substituteInPlace pyproject.toml \ + --replace-fail '"setuptools>=30.3.0,<50",' "" + ''; + + pythonRelaxDeps = [ + "docutils" + "nicegui" + ]; + + build-system = [ + poetry-core + setuptools + ]; + + dependencies = [ + docutils + nicegui + ]; + + # Module has no tests + doCheck = false; + + pythonImportsCheck = [ "nicegui_highcharts" ]; + + meta = { + description = "NiceGUI with support for Highcharts"; + homepage = "https://github.com/zauberzeug/nicegui-highcharts"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ fab ]; + }; +} diff --git a/pkgs/development/python-modules/nicegui/default.nix b/pkgs/development/python-modules/nicegui/default.nix new file mode 100644 index 0000000000000..0951e8b5189dd --- /dev/null +++ b/pkgs/development/python-modules/nicegui/default.nix @@ -0,0 +1,123 @@ +{ + lib, + aiofiles, + aiohttp, + buildPythonPackage, + certifi, + pkgs, + docutils, + fastapi, + fetchFromGitHub, + httpx, + ifaddr, + itsdangerous, + jinja2, + libsass, + markdown2, + matplotlib, + orjson, + pandas, + plotly, + poetry-core, + pyecharts, + pygments, + pytest-asyncio, + pytest-selenium, + pytestCheckHook, + python-multipart, + python-socketio, + pythonOlder, + pywebview, + requests, + setuptools, + typing-extensions, + urllib3, + uvicorn, + vbuild, + watchfiles, + webdriver-manager, +}: + +buildPythonPackage rec { + pname = "nicegui"; + version = "2.5.0"; + pyproject = true; + + disabled = pythonOlder "3.8"; + + src = fetchFromGitHub { + owner = "zauberzeug"; + repo = "nicegui"; + rev = "refs/tags/v${version}"; + hash = "sha256-oT191QVpvE5xszgBFt3o4A2hU50zmzPUywmAQuKZ5OE="; + }; + + postPatch = '' + substituteInPlace pyproject.toml \ + --replace-fail '"setuptools>=30.3.0,<50",' "" + ''; + + build-system = [ + poetry-core + setuptools + ]; + + dependencies = [ + aiofiles + aiohttp + certifi + docutils + fastapi + httpx + ifaddr + itsdangerous + jinja2 + markdown2 + orjson + pygments + python-multipart + python-socketio + requests + typing-extensions + urllib3 + uvicorn + vbuild + watchfiles + ]; + + optional-dependencies = { + # Circular dependency + # highcharts = [ nicegui-highcharts ]; + matplotlib = [ matplotlib ]; + native = [ pywebview ]; + plotly = [ plotly ]; + sass = [ libsass ]; + }; + + nativeCheckInputs = [ + pandas + pkgs.chromedriver + pyecharts + pytest-asyncio + pytest-selenium + pytestCheckHook + webdriver-manager + ] ++ lib.flatten (builtins.attrValues optional-dependencies); + + preCheck = '' + export HOME=$(mktemp -d) + ''; + + pythonImportsCheck = [ "nicegui" ]; + + # chromedriver release doesn't seems to be supported, try with next release + doCheck = false; + + meta = { + description = "Module to create web-based user interfaces"; + homepage = "https://github.com/zauberzeug/nicegui/"; + changelog = "https://github.com/zauberzeug/nicegui/releases/tag/v${version}"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ fab ]; + }; +} diff --git a/pkgs/development/python-modules/pyecharts/default.nix b/pkgs/development/python-modules/pyecharts/default.nix new file mode 100644 index 0000000000000..72928f4d32cbf --- /dev/null +++ b/pkgs/development/python-modules/pyecharts/default.nix @@ -0,0 +1,66 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + jinja2, + numpy, + pandas, + pillow, + prettytable, + pytestCheckHook, + pythonOlder, + requests, + setuptools, + simplejson, +}: + +buildPythonPackage rec { + pname = "pyecharts"; + version = "2.0.6"; + pyproject = true; + + disabled = pythonOlder "3.8"; + + src = fetchFromGitHub { + owner = "pyecharts"; + repo = "pyecharts"; + rev = "refs/tags/v${version}"; + hash = "sha256-cD2jtiE2LDKCmhqM+qKYcsZyjDyMDpp8/Bn17csZgqo="; + }; + + build-system = [ setuptools ]; + + dependencies = [ + jinja2 + prettytable + simplejson + ]; + + optional-dependencies = { + images = [ pillow ]; + }; + + nativeCheckInputs = [ + numpy + pandas + pytestCheckHook + requests + ] ++ lib.flatten (builtins.attrValues optional-dependencies); + + pythonImportsCheck = [ "pyecharts" ]; + + disabledTests = [ + # Tests require network access + "test_render_embed_js" + "test_display_javascript_v2" + "test_lines3d_base" + ]; + + meta = { + description = "Python Echarts Plotting Library"; + homepage = "https://github.com/pyecharts/pyecharts"; + changelog = "https://github.com/pyecharts/pyecharts/releases/tag/v${version}"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ fab ]; + }; +} diff --git a/pkgs/development/python-modules/pytest-selenium/default.nix b/pkgs/development/python-modules/pytest-selenium/default.nix new file mode 100644 index 0000000000000..1cfb07705b9f3 --- /dev/null +++ b/pkgs/development/python-modules/pytest-selenium/default.nix @@ -0,0 +1,81 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + hatch-vcs, + hatchling, + pytest-base-url, + pytest-html, + pytest-mock, + pytest-variables, + pytest-xdist, + pytest, + pytestCheckHook, + pythonOlder, + requests, + selenium, + tenacity, +}: + +buildPythonPackage rec { + pname = "pytest-selenium"; + version = "4.1.0"; + pyproject = true; + + disabled = pythonOlder "3.8"; + + src = fetchFromGitHub { + owner = "pytest-dev"; + repo = "pytest-selenium"; + rev = "refs/tags/${version}"; + hash = "sha256-fIyos73haqTAgp5WVvMwJswQAtXnsnUeXKjPweXLGRM="; + }; + + build-system = [ + hatch-vcs + hatchling + ]; + + buildInput = [ pytest ]; + + dependencies = [ + pytest-base-url + pytest-html + pytest-variables + requests + selenium + tenacity + ]; + + nativeCheckInputs = [ + pytest-mock + pytest-xdist + pytestCheckHook + ]; + + pythonImportsCheck = [ "pytest_selenium" ]; + + disabledTests = [ + # Tests require additional setup and/or network features + "test_driver_quit" + "test_driver_retry_pass" + "test_event_listening_webdriver" + "test_invalid_credentials_env" + "test_invalid_credentials_file" + "test_invalid_host" + "test_launch_case_insensitive" + "test_launch" + "test_options" + "test_preferences_marker" + "test_profile" + "test_xdist" + ]; + + meta = { + description = "Plugin for running Selenium with pytest"; + homepage = "https://github.com/pytest-dev/pytest-selenium"; + changelog = "https://github.com/pytest-dev/pytest-selenium/releases/tag/${version}"; + license = lib.licenses.mpl20; + maintainers = with lib.maintainers; [ fab ]; + }; +} diff --git a/pkgs/development/python-modules/pytest-variables/default.nix b/pkgs/development/python-modules/pytest-variables/default.nix new file mode 100644 index 0000000000000..39cc09643e152 --- /dev/null +++ b/pkgs/development/python-modules/pytest-variables/default.nix @@ -0,0 +1,53 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + hatch-vcs, + hatchling, + pytest, + hjson, + toml, + pytestCheckHook, + pyyaml, + pythonOlder, +}: + +buildPythonPackage rec { + pname = "pytest-variables"; + version = "3.1.0"; + pyproject = true; + + disabled = pythonOlder "3.8"; + + src = fetchFromGitHub { + owner = "pytest-dev"; + repo = "pytest-variables"; + rev = "refs/tags/${version}"; + hash = "sha256-adKoE3td12JtF2f6/1/+TlSIy4i6gRDmeeWalsE6B/w="; + }; + + build-system = [ + hatch-vcs + hatchling + ]; + + buildInput = [ pytest ]; + + optional-dependencies = { + hjson = [ hjson ]; + toml = [ toml ]; + yaml = [ pyyaml ]; + }; + + nativeCheckInputs = [ pytestCheckHook ] ++ lib.flatten (builtins.attrValues optional-dependencies); + + pythonImportsCheck = [ "pytest_variables" ]; + + meta = { + description = "Plugin for providing variables to pytest tests/fixtures"; + homepage = "https://github.com/pytest-dev/pytest-variables"; + changelog = "https://github.com/pytest-dev/pytest-variables/blob/${src.rev}/CHANGES.rst"; + license = lib.licenses.mpl20; + maintainers = with lib.maintainers; [ fab ]; + }; +} diff --git a/pkgs/development/python-modules/vbuild/default.nix b/pkgs/development/python-modules/vbuild/default.nix new file mode 100644 index 0000000000000..12358ac9c3d6b --- /dev/null +++ b/pkgs/development/python-modules/vbuild/default.nix @@ -0,0 +1,54 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + poetry-core, + pscript, + pytestCheckHook, + pythonOlder, +}: + +buildPythonPackage rec { + pname = "vbuild"; + version = "0.8.2"; + pyproject = true; + + disabled = pythonOlder "3.8"; + + src = fetchFromGitHub { + owner = "manatlan"; + repo = "vbuild"; + rev = "refs/tags/v${version}"; + hash = "sha256-p9v1FiYn0cI+f/25hvjwm7eb1GqxXvNnmXBGwZe9fk0="; + }; + + postPatch = '' + # Switch to poetry-core, patch can't be applied, https://github.com/manatlan/vbuild/pull/12 + substituteInPlace pyproject.toml \ + --replace-fail 'version = "0.0.0"' 'version = "${version}"' \ + --replace-fail 'requires = ["poetry>=0.12"]' 'requires = ["poetry-core>=1.0.0"]' \ + --replace-fail 'build-backend = "poetry.masonry.api"' 'build-backend = "poetry.core.masonry.api"' + ''; + + build-system = [ poetry-core ]; + + dependencies = [ pscript ]; + + nativeCheckInputs = [ pytestCheckHook ]; + + pythonImportsCheck = [ "vbuild" ]; + + disabledTests = [ + # Tests require network access + "test_min" + "test_pycomp_onlineClosurable" + ]; + + meta = { + description = "Module to compile your VueJS components to standalone HTML/JS/CSS"; + homepage = "https://github.com/manatlan/vbuild"; + changelog = "https://github.com/manatlan/vbuild/blob/${src.rev}/changelog.md"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 58292dbd7085a..caa3cb5763e67 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -9158,6 +9158,10 @@ self: super: with self; { nice-go = callPackage ../development/python-modules/nice-go { }; + nicegui = callPackage ../development/python-modules/nicegui { }; + + nicegui-highcharts = callPackage ../development/python-modules/nicegui-highcharts { }; + nidaqmx = callPackage ../development/python-modules/nidaqmx { }; nikola = callPackage ../development/python-modules/nikola { }; @@ -11522,6 +11526,8 @@ self: super: with self; { pyebus = callPackage ../development/python-modules/pyebus { }; + pyecharts = callPackage ../development/python-modules/pyecharts { }; + pyechonest = callPackage ../development/python-modules/pyechonest { }; pyeclib = callPackage ../development/python-modules/pyeclib { }; @@ -12871,6 +12877,8 @@ self: super: with self; { pytest-responses = callPackage ../development/python-modules/pytest-responses { }; + pytest-selenium = callPackage ../development/python-modules/pytest-selenium { }; + pytest-server-fixtures = callPackage ../development/python-modules/pytest-server-fixtures { }; pytest-services = callPackage ../development/python-modules/pytest-services { }; @@ -12919,6 +12927,8 @@ self: super: with self; { pytest-unordered = callPackage ../development/python-modules/pytest-unordered { }; + pytest-variables = callPackage ../development/python-modules/pytest-variables { }; + pytest-vcr = callPackage ../development/python-modules/pytest-vcr { }; pytest-virtualenv = callPackage ../development/python-modules/pytest-virtualenv { }; @@ -17539,6 +17549,8 @@ self: super: with self; { vat-moss = callPackage ../development/python-modules/vat-moss { }; + vbuild = callPackage ../development/python-modules/vbuild { }; + vcard = callPackage ../development/python-modules/vcard { }; vcrpy = callPackage ../development/python-modules/vcrpy { };