diff --git a/pkgs/applications/science/engineering/strictdoc/default.nix b/pkgs/applications/science/engineering/strictdoc/default.nix index 54a4e21a3f60..5097a936caaa 100644 --- a/pkgs/applications/science/engineering/strictdoc/default.nix +++ b/pkgs/applications/science/engineering/strictdoc/default.nix @@ -6,31 +6,20 @@ python3.pkgs.buildPythonApplication rec { pname = "strictdoc"; version = "0.0.40"; - format = "pyproject"; + pyproject = true; src = fetchFromGitHub { owner = "strictdoc-project"; - repo = pname; + repo = "strictdoc"; rev = "refs/tags/${version}"; hash = "sha256-kZ8qVhroSPSGAcgUFZb1vRI6JoFyjeg/0qYosbRnwyc="; }; - postPatch = '' - substituteInPlace pyproject.toml \ - --replace '"textx >= 3.0.0, == 3.*"' '"textx"' \ - --replace '"docutils >= 0.16, == 0.*"' '"docutils"' \ - --replace '"pygments >= 2.10.0, == 2.*"' '"pygments"' \ - --replace '"lxml >= 4.6.2, == 4.*"' '"lxml"' \ - --replace '"beautifulsoup4 >= 4.12.0, == 4.*"' '"beautifulsoup4"' \ - --replace '"python-datauri >= 0.2.9, == 0.*"' '"python-datauri"' \ - --replace '"XlsxWriter >= 1.3.7, == 1.*"' '"XlsxWriter"' \ - --replace '"xlrd >= 2.0.1, == 2.*"' '"xlrd"' \ - --replace '"reqif >= 0.0.33, == 0.*"' '"reqif"' \ - --replace '"pybtex >= 0.23.0, == 0.*"' '"pybtex"' - ''; + pythonRelaxDeps = true; nativeBuildInputs = with python3.pkgs; [ hatchling + pythonRelaxDepsHook ]; propagatedBuildInputs = with python3.pkgs; [ @@ -46,16 +35,20 @@ python3.pkgs.buildPythonApplication rec { pygments python-multipart reqif + selenium setuptools + spdx-tools textx toml uvicorn + webdriver-manager websockets xlrd xlsxwriter ] ++ uvicorn.optional-dependencies.standard; nativeCheckInputs = with python3.pkgs; [ + httpx pytestCheckHook ]; diff --git a/pkgs/development/python-modules/pybrowsers/default.nix b/pkgs/development/python-modules/pybrowsers/default.nix new file mode 100644 index 000000000000..07b686d2df69 --- /dev/null +++ b/pkgs/development/python-modules/pybrowsers/default.nix @@ -0,0 +1,49 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, poetry-core +, pythonOlder +, pyxdg +}: + +buildPythonPackage rec { + pname = "pybrowsers"; + version = "0.5.2"; + pyproject = true; + + disabled = pythonOlder "3.7"; + + src = fetchFromGitHub { + owner = "roniemartinez"; + repo = "browsers"; + rev = version; + hash = "sha256-bsmOUa33VzqWCv2jhu6oukdRhWfpkeAM3FBjiBBwjSQ="; + }; + + postPatch = '' + sed -i "/--cov/d" pyproject.toml + ''; + + nativeBuildInputs = [ + poetry-core + ]; + + propagatedBuildInputs = [ + pyxdg + ]; + + # Tests want to interact with actual browsers + doCheck = false; + + pythonImportsCheck = [ + "browsers" + ]; + + meta = with lib; { + description = "Python library for detecting and launching browsers"; + homepage = "https://github.com/roniemartinez/browsers"; + changelog = "https://github.com/roniemartinez/browsers/releases/tag/${version}"; + license = licenses.mit; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/development/python-modules/reqif/default.nix b/pkgs/development/python-modules/reqif/default.nix index e0ba5610ebd5..63f9984c5fa3 100644 --- a/pkgs/development/python-modules/reqif/default.nix +++ b/pkgs/development/python-modules/reqif/default.nix @@ -1,38 +1,39 @@ { lib +, beautifulsoup4 , buildPythonPackage -, python , fetchFromGitHub , hatchling -, beautifulsoup4 -, lxml , jinja2 +, lxml , pytestCheckHook +, python , pythonOlder +, pythonRelaxDepsHook }: buildPythonPackage rec { pname = "reqif"; version = "0.0.35"; - format = "pyproject"; + pyproject = true; disabled = pythonOlder "3.7"; src = fetchFromGitHub { owner = "strictdoc-project"; - repo = pname; + repo = "reqif"; rev = "refs/tags/${version}"; hash = "sha256-3yOLOflPqzJRv3qCQXFK3rIFftBq8FkYy7XhOfWH82Y="; }; postPatch = '' - substituteInPlace ./tests/unit/conftest.py --replace \ - "os.path.abspath(os.path.join(__file__, \"../../../../reqif\"))" \ + substituteInPlace ./tests/unit/conftest.py \ + --replace-fail "os.path.abspath(os.path.join(__file__, \"../../../../reqif\"))" \ "\"${placeholder "out"}/${python.sitePackages}/reqif\"" - substituteInPlace requirements.txt --replace "==" ">=" ''; nativeBuildInputs = [ hatchling + pythonRelaxDepsHook ]; propagatedBuildInputs = [ @@ -41,14 +42,14 @@ buildPythonPackage rec { jinja2 ]; - pythonImportsCheck = [ - "reqif" - ]; - nativeCheckInputs = [ pytestCheckHook ]; + pythonImportsCheck = [ + "reqif" + ]; + meta = with lib; { description = "Python library for ReqIF format"; homepage = "https://github.com/strictdoc-project/reqif"; diff --git a/pkgs/development/python-modules/webdriver-manager/default.nix b/pkgs/development/python-modules/webdriver-manager/default.nix new file mode 100644 index 000000000000..6680fa7eea6b --- /dev/null +++ b/pkgs/development/python-modules/webdriver-manager/default.nix @@ -0,0 +1,73 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, packaging +, pybrowsers +, pytestCheckHook +, python-dotenv +, pythonOlder +, requests +, selenium +, setuptools +}: + +buildPythonPackage rec { + pname = "webdriver-manager"; + version = "4.0.1"; + pyproject = true; + + disabled = pythonOlder "3.7"; + + src = fetchFromGitHub { + owner = "SergeyPirogov"; + repo = "webdriver_manager"; + rev = "refs/tags/v${version}"; + hash = "sha256-PdUlloJ4DncnktKQHofn/OLVrgSVyWhaeEEhl3Hgjek="; + }; + + nativeBuildInputs = [ + setuptools + ]; + + propagatedBuildInputs = [ + packaging + python-dotenv + requests + ]; + + nativeCheckInputs = [ + pybrowsers + pytestCheckHook + selenium + ]; + + pythonImportsCheck = [ + "webdriver_manager" + ]; + + disabledTestPaths = [ + # Tests require network access and browsers available + "tests_negative/" + "tests_xdist/" + "tests/test_brave_driver.py" + "tests/test_chrome_driver.py" + "tests/test_chrome_driver.py" + "tests/test_chromium_driver.py" + "tests/test_custom_http_client.py" + "tests/test_downloader.py" + "tests/test_edge_driver.py" + "tests/test_firefox_manager.py" + "tests/test_ie_driver.py" + "tests/test_opera_manager.py" + "tests/test_opera_manager.py" + "tests/test_silent_global_logs.py" + ]; + + meta = with lib; { + description = "Module to manage the binary drivers for different browsers"; + homepage = "https://github.com/SergeyPirogov/webdriver_manager/"; + changelog = "https://github.com/SergeyPirogov/webdriver_manager/blob/${version}/CHANGELOG.md"; + license = licenses.asl20; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index b50984ad81ce..e521fa549720 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -10255,6 +10255,8 @@ self: super: with self; { pybravia = callPackage ../development/python-modules/pybravia { }; + pybrowsers = callPackage ../development/python-modules/pybrowsers { }; + pybrowserid = callPackage ../development/python-modules/pybrowserid { }; pybtex = callPackage ../development/python-modules/pybtex { }; @@ -16248,6 +16250,8 @@ self: super: with self; { webdavclient3 = callPackage ../development/python-modules/webdavclient3 { }; + webdriver-manager = callPackage ../development/python-modules/webdriver-manager { }; + webencodings = callPackage ../development/python-modules/webencodings { }; webexteamssdk = callPackage ../development/python-modules/webexteamssdk { };