From 6dce5aafd3553d75d4879b6bbe89efb6676d7c31 Mon Sep 17 00:00:00 2001 From: Peder Bergebakken Sundt Date: Fri, 9 Aug 2024 03:28:15 +0200 Subject: [PATCH 1/4] python312Packages.sqlalchemy-file: init at 0.6.0 --- .../sqlalchemy-file/default.nix | 78 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 80 insertions(+) create mode 100644 pkgs/development/python-modules/sqlalchemy-file/default.nix diff --git a/pkgs/development/python-modules/sqlalchemy-file/default.nix b/pkgs/development/python-modules/sqlalchemy-file/default.nix new file mode 100644 index 000000000000..3fad04838acd --- /dev/null +++ b/pkgs/development/python-modules/sqlalchemy-file/default.nix @@ -0,0 +1,78 @@ +{ + lib, + stdenv, + buildPythonPackage, + fetchFromGitHub, + hatchling, + fasteners, + libcloud, + pillow, + pytestCheckHook, + sqlalchemy, + sqlmodel, +}: + +buildPythonPackage rec { + pname = "sqlalchemy-file"; + version = "0.6.0"; + pyproject = true; + + src = fetchFromGitHub { + owner = "jowilf"; + repo = "sqlalchemy-file"; + rev = version; + hash = "sha256-gtW7YA/rQ48tnqPdypMnSqqtwb90nhAkiQNhgEr1M3I="; + }; + + build-system = [ hatchling ]; + + dependencies = [ + libcloud + sqlalchemy + ]; + + nativeCheckInputs = [ + pytestCheckHook + fasteners + pillow + sqlmodel + ]; + + preCheck = '' + # used in get_test_container in tests/utils.py + # fixes FileNotFoundError: [Errno 2] No such file or directory: '/tmp/storage/...' + mkdir .storage + export LOCAL_PATH="$PWD/.storage" + ''; + + disabledTestPaths = lib.optionals stdenv.isDarwin [ + # very flaky, sandbox issues? + # libcloud.storage.types.ContainerDoesNotExistError + # sqlite3.OperationalError: attempt to write a readonly database + "tests/test_content_type_validator.py" + "tests/test_image_field.py" + "tests/test_image_validator.py" + "tests/test_metadata.py" + "tests/test_multiple_field.py" + "tests/test_multiple_storage.py" + "tests/test_processor.py" + "tests/test_single_field.py" + "tests/test_size_validator.py" + "tests/test_sqlmodel.py" + ]; + + pythonImportsCheck = [ + "sqlalchemy_file" + "sqlalchemy_file.file" + "sqlalchemy_file.types" + "sqlalchemy_file.helpers" + ]; + + meta = with lib; { + description = "SQLAlchemy extension for attaching files to SQLAlchemy model and uploading them to various storage with Apache Libcloud"; + homepage = "https://github.com/jowilf/sqlalchemy-file"; + changelog = "https://github.com/jowilf/sqlalchemy-file/blob/${src.rev}/CHANGELOG.md"; + license = licenses.mit; + maintainers = with maintainers; [ pbsds ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 7010d1d8a410..594df1ed974d 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -14864,6 +14864,8 @@ self: super: with self; { sqlalchemy-continuum = callPackage ../development/python-modules/sqlalchemy-continuum { }; + sqlalchemy-file = callPackage ../development/python-modules/sqlalchemy-file { }; + sqlalchemy-i18n = callPackage ../development/python-modules/sqlalchemy-i18n { }; sqlalchemy-jsonfield = callPackage ../development/python-modules/sqlalchemy-jsonfield { }; From 23c20c44cf3ddbb552111c80ac2576b42bf6e5b0 Mon Sep 17 00:00:00 2001 From: Peder Bergebakken Sundt Date: Fri, 9 Aug 2024 03:29:07 +0200 Subject: [PATCH 2/4] python312Packages.starlette-admin: init at 0.14.1 --- .../starlette-admin/default.nix | 127 ++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 129 insertions(+) create mode 100644 pkgs/development/python-modules/starlette-admin/default.nix diff --git a/pkgs/development/python-modules/starlette-admin/default.nix b/pkgs/development/python-modules/starlette-admin/default.nix new file mode 100644 index 000000000000..41f3a1001345 --- /dev/null +++ b/pkgs/development/python-modules/starlette-admin/default.nix @@ -0,0 +1,127 @@ +{ + lib, + stdenv, + buildPythonPackage, + fetchFromGitHub, + hatchling, + aiosqlite, + arrow, + babel, + cacert, + colour, + fasteners, + httpx, + jinja2, + mongoengine, + motor, + passlib, + phonenumbers, + pillow, + psycopg2, + pydantic, + pytest-asyncio, + pytestCheckHook, + python-multipart, + requests, + sqlalchemy, + sqlalchemy-file, + sqlalchemy-utils, + sqlmodel, + starlette, +}: + +buildPythonPackage rec { + pname = "starlette-admin"; + version = "0.14.1"; + pyproject = true; + + src = fetchFromGitHub { + owner = "jowilf"; + repo = "starlette-admin"; + rev = version; + hash = "sha256-DoYD8Hc5pd68+BhASw3mwwCdhu0vYHiELjVmVwU8FHs="; + }; + + build-system = [ hatchling ]; + + dependencies = [ + jinja2 + python-multipart + starlette + ]; + + optional-dependencies = { + i18n = [ babel ]; + }; + + nativeCheckInputs = [ + aiosqlite + arrow + babel + cacert + colour + fasteners + httpx + mongoengine + motor + passlib + phonenumbers + pillow + psycopg2 + pydantic + pytest-asyncio + pytestCheckHook + requests + sqlalchemy + sqlalchemy-file + sqlalchemy-utils + sqlmodel + ]; + + preCheck = '' + # used in get_test_container in tests/sqla/utils.py + # fixes FileNotFoundError: [Errno 2] No such file or directory: '/tmp/storage/...' + mkdir .storage + export LOCAL_PATH="$PWD/.storage" + ''; + + disabledTests = lib.optionals stdenv.isDarwin [ + # flaky, depends on test order + "test_ensuring_pk" + # flaky, of-by-one + "test_api" + ]; + + disabledTestPaths = + [ + # odmantic is not packaged + "tests/odmantic" + # needs mongodb running on port 27017 + "tests/mongoengine" + ] + ++ lib.optionals stdenv.isDarwin [ + # very flaky, sandbox issues? + # libcloud.storage.types.ContainerDoesNotExistError + # sqlite3.OperationalError: attempt to write a readonly database + "tests/sqla/test_sync_engine.py" + "tests/sqla/test_async_engine.py" + ]; + + pythonImportsCheck = [ + "starlette_admin" + "starlette_admin.actions" + "starlette_admin.base" + "starlette_admin.fields" + "starlette_admin.i18n" + "starlette_admin.tools" + "starlette_admin.views" + ]; + + meta = with lib; { + description = "Fast, beautiful and extensible administrative interface framework for Starlette & FastApi applications"; + homepage = "https://github.com/jowilf/starlette-admin"; + changelog = "https://github.com/jowilf/starlette-admin/blob/${src.rev}/CHANGELOG.md"; + license = licenses.mit; + maintainers = with maintainers; [ pbsds ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 594df1ed974d..22a87016bbde 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -14956,6 +14956,8 @@ self: super: with self; { starlette = callPackage ../development/python-modules/starlette { }; + starlette-admin = callPackage ../development/python-modules/starlette-admin { }; + starlette-context = callPackage ../development/python-modules/starlette-context { }; starlette-wtf = callPackage ../development/python-modules/starlette-wtf { }; From 71f977f8a70b9a84a3a20fccdc2417720a2e3bb0 Mon Sep 17 00:00:00 2001 From: Peder Bergebakken Sundt Date: Fri, 9 Aug 2024 03:29:53 +0200 Subject: [PATCH 3/4] python312Packages.reflex-hosting-cli: init at 0.1.13 --- .../reflex-hosting-cli/default.nix | 62 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 64 insertions(+) create mode 100644 pkgs/development/python-modules/reflex-hosting-cli/default.nix diff --git a/pkgs/development/python-modules/reflex-hosting-cli/default.nix b/pkgs/development/python-modules/reflex-hosting-cli/default.nix new file mode 100644 index 000000000000..52cc78f0ee55 --- /dev/null +++ b/pkgs/development/python-modules/reflex-hosting-cli/default.nix @@ -0,0 +1,62 @@ +{ + lib, + buildPythonPackage, + fetchPypi, + poetry-core, + charset-normalizer, + httpx, + pipdeptree, + platformdirs, + pydantic, + python-dateutil, + rich, + tabulate, + typer, + websockets, +}: + +buildPythonPackage rec { + pname = "reflex-hosting-cli"; + version = "0.1.13"; + pyproject = true; + + # source is not published https://github.com/reflex-dev/reflex/issues/3762 + src = fetchPypi { + pname = "reflex_hosting_cli"; + inherit version; + hash = "sha256-xdav3P63TO4EajdN29WRFquO15fa5oj8x0TauuJNxXE="; + }; + + pythonRelaxDeps = [ "pipdeptree" ]; + + build-system = [ poetry-core ]; + + dependencies = [ + charset-normalizer + httpx + pipdeptree + platformdirs + pydantic + python-dateutil + rich + tabulate + typer + websockets + ]; + + pythonImportsCheck = [ + "reflex_cli" + "reflex_cli.cli" + "reflex_cli.deployments" + ]; + + # no tests on pypi + doCheck = false; + + meta = with lib; { + description = "Reflex Hosting CLI"; + homepage = "https://pypi.org/project/reflex-hosting-cli/"; + license = licenses.asl20; + maintainers = with maintainers; [ pbsds ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 22a87016bbde..2a0a39a32b04 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -13508,6 +13508,8 @@ self: super: with self; { refery = callPackage ../development/python-modules/refery { }; + reflex-hosting-cli = callPackage ../development/python-modules/reflex-hosting-cli { }; + reflink = callPackage ../development/python-modules/reflink { }; refoss-ha = callPackage ../development/python-modules/refoss-ha { }; From bc0a29f049300020a8e91239d647d9a9a16838c3 Mon Sep 17 00:00:00 2001 From: Peder Bergebakken Sundt Date: Fri, 9 Aug 2024 03:33:08 +0200 Subject: [PATCH 4/4] python312Packages.reflex: init at 0.5.9 --- .../python-modules/reflex/default.nix | 136 ++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 138 insertions(+) create mode 100644 pkgs/development/python-modules/reflex/default.nix diff --git a/pkgs/development/python-modules/reflex/default.nix b/pkgs/development/python-modules/reflex/default.nix new file mode 100644 index 000000000000..75b5198e0663 --- /dev/null +++ b/pkgs/development/python-modules/reflex/default.nix @@ -0,0 +1,136 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + poetry-core, + alembic, + attrs, + build, + charset-normalizer, + dill, + distro, + fastapi, + gunicorn, + httpx, + jinja2, + lazy-loader, + numpy, + pandas, + pillow, + platformdirs, + plotly, + psutil, + pydantic, + pytest-asyncio, + pytest-mock, + pytestCheckHook, + python-engineio, + python-multipart, + python-socketio, + redis, + reflex-hosting-cli, + rich, + sqlmodel, + starlette-admin, + tomlkit, + twine, + typer, + unzip, + uvicorn, + watchdog, + watchfiles, + wrapt, +}: + +buildPythonPackage rec { + pname = "reflex"; + version = "0.5.9"; + pyproject = true; + + src = fetchFromGitHub { + owner = "reflex-dev"; + repo = "reflex"; + rev = "v${version}"; + hash = "sha256-QeEggHPilCLjUQ76AYDkqdf1iWLwCyAYTnf17RdhDq0="; + }; + + pythonRelaxDeps = [ "fastapi" ]; + pythonRemoveDeps = [ + "setuptools" + "build" + ]; + + build-system = [ poetry-core ]; + + dependencies = [ + alembic + build # used in custom_components/custom_components.py + charset-normalizer + dill + distro + fastapi + gunicorn + httpx + jinja2 + lazy-loader + platformdirs + psutil + pydantic + python-engineio + python-multipart + python-socketio + redis + reflex-hosting-cli + rich + sqlmodel + starlette-admin + tomlkit + twine # used in custom_components/custom_components.py + typer + uvicorn + watchdog + watchfiles + wrapt + ]; + + nativeCheckInputs = [ + pytestCheckHook + pytest-asyncio + pytest-mock + attrs + numpy + plotly + pandas + pillow + unzip + ]; + + disabledTests = [ + # touches network + "test_find_and_check_urls" + "test_event_actions" + "test_upload_file" + # /proc is too funky in nix sandbox + "test_get_cpu_info" + # broken + "test_potentially_dirty_substates" # AssertionError: Extra items in the left set + # flaky + "test_preprocess" # KeyError: 'reflex___state____state' + "test_send" # AssertionError: Expected 'post' to have been called once. Called 0 times. + ]; + disabledTestPaths = [ + "benchmarks/" + "integration/" + ]; + + pythonImportsCheck = [ "reflex" ]; + + meta = with lib; { + description = "Web apps in pure Python"; + homepage = "https://github.com/reflex-dev/reflex"; + changelog = "https://github.com/reflex-dev/reflex/releases/tag/${src.rev}"; + license = licenses.asl20; + maintainers = with maintainers; [ pbsds ]; + mainProgram = "reflex"; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 2a0a39a32b04..a0fb3f526ae8 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -13508,6 +13508,8 @@ self: super: with self; { refery = callPackage ../development/python-modules/refery { }; + reflex = callPackage ../development/python-modules/reflex { }; + reflex-hosting-cli = callPackage ../development/python-modules/reflex-hosting-cli { }; reflink = callPackage ../development/python-modules/reflink { };