From 7dc6f0653ce2040593119fb2dbd4c74424212ed1 Mon Sep 17 00:00:00 2001 From: emaryn Date: Fri, 4 Jul 2025 09:57:02 +0800 Subject: [PATCH 1/2] python313Packages.dynaconf: init at 3.2.11 --- .../python-modules/dynaconf/default.nix | 102 ++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 104 insertions(+) create mode 100644 pkgs/development/python-modules/dynaconf/default.nix diff --git a/pkgs/development/python-modules/dynaconf/default.nix b/pkgs/development/python-modules/dynaconf/default.nix new file mode 100644 index 000000000000..c8540ba39bb0 --- /dev/null +++ b/pkgs/development/python-modules/dynaconf/default.nix @@ -0,0 +1,102 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + setuptools, + ansible-core, + boto3, + commentjson, + configobj, + django, + django-debug-toolbar, + flask, + hvac, + ipython, + pytest-cov-stub, + pytest-mock, + pytest-xdist, + pytestCheckHook, + python-dotenv, + radon, + toml, + tox, + versionCheckHook, +}: + +buildPythonPackage rec { + pname = "dynaconf"; + version = "3.2.11"; + pyproject = true; + + src = fetchFromGitHub { + owner = "dynaconf"; + repo = "dynaconf"; + tag = version; + hash = "sha256-9E9us6niUtPJkZ89uKXz6wByoEERwxS/xW5qvkIXIhQ="; + }; + + build-system = [ setuptools ]; + + dependencies = [ ansible-core ]; + + nativeCheckInputs = [ + boto3 + commentjson + configobj + django + django-debug-toolbar + flask + hvac + ipython + pytest-cov-stub + pytest-mock + pytest-xdist + pytestCheckHook + python-dotenv + radon + toml + tox + versionCheckHook + ]; + + disabledTestPaths = [ + # import file mismatch + # imported module 'app_test' has this __file__ attribute: + # /build/source/tests_functional/issues/1005-key-type-error/app_test.py + # which is not the same as the test file we want to collect: + # /build/source/tests_functional/issues/994_validate_on_update_fix/app_test.py + "tests_functional/django_pytest_pure/app/tests" + "tests_functional/issues/575_603_666_690__envvar_with_template_substitution/app_test.py" + "tests_functional/issues/658_nested_envvar_override/app_test.py" + "tests_functional/issues/835_926_enable-merge-equal-false/app_test.py" + "tests_functional/issues/994_validate_on_update_fix/app_test.py" + "tests_functional/pytest_example/app/tests" + "tests_functional/pytest_example/flask/tests" + # flask.cli.NoAppException: Failed to find Flask application or factory in module 'app' + # Use 'app:name' to specify one + "tests/test_cli.py" + # sqlite3.OperationalError: no such table: auth_user + "tests_functional/django_pytest/app/tests/test_app.py::test_admin_user" + # unable connect port + "tests/test_redis.py" + # need docker + "tests/test_vault.py" + ]; + + # django.core.exceptions.ImproperlyConfigured: Requested setting LOGGING_CONFIG + # but settings are not configured + env.DJANGO_SETTINGS_MODULE = "project.settings"; + + pythonImportsCheck = [ "dynaconf" ]; + + versionCheckProgramArg = "--version"; + + meta = { + description = "Dynamic configurator for Python Project"; + homepage = "https://github.com/dynaconf/dynaconf"; + changelog = "https://github.com/dynaconf/dynaconf/blob/${src.tag}/CHANGELOG.md"; + mainProgram = "dynaconf"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ emaryn ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 324afdf61bbe..9d4312ff9e4b 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -4396,6 +4396,8 @@ self: super: with self; { dyn = callPackage ../development/python-modules/dyn { }; + dynaconf = callPackage ../development/python-modules/dynaconf { }; + dynalite-devices = callPackage ../development/python-modules/dynalite-devices { }; dynalite-panel = callPackage ../development/python-modules/dynalite-panel { }; From 96bbead009d3de0eac5ff7b394cc30c95b84d7fc Mon Sep 17 00:00:00 2001 From: emaryn Date: Fri, 11 Jul 2025 21:50:41 +0800 Subject: [PATCH 2/2] ansible-doctor: 2.0.4 -> 7.0.8 --- pkgs/by-name/an/ansible-doctor/package.nix | 47 ++++++++++------------ 1 file changed, 22 insertions(+), 25 deletions(-) diff --git a/pkgs/by-name/an/ansible-doctor/package.nix b/pkgs/by-name/an/ansible-doctor/package.nix index 40ca46b861da..8bf83fc95f20 100644 --- a/pkgs/by-name/an/ansible-doctor/package.nix +++ b/pkgs/by-name/an/ansible-doctor/package.nix @@ -1,57 +1,54 @@ { lib, + stdenv, + python3Packages, fetchFromGitHub, - fetchpatch, - python3, + versionCheckHook, }: -python3.pkgs.buildPythonApplication rec { +python3Packages.buildPythonApplication rec { pname = "ansible-doctor"; - version = "2.0.4"; - format = "pyproject"; + version = "7.0.8"; + pyproject = true; src = fetchFromGitHub { owner = "thegeeklab"; repo = "ansible-doctor"; - rev = "refs/tags/v${version}"; - hash = "sha256-nZv1PdR0kGrke2AjcDWjDWBdsw64UpHYFNDFAe/UoJo="; + tag = "v${version}"; + hash = "sha256-BwmmAd1mmyGQ5QQo6uS3+JmPP9kmZe2OOBDNAKFqEl0="; }; - patches = [ - # https://github.com/thegeeklab/ansible-doctor/pull/541 - (fetchpatch { - name = "poetry-dynamic-versioning-pep517.patch"; - url = "https://github.com/thegeeklab/ansible-doctor/commit/b77ba9dccaef4b386bd54b128136c948665eb61a.patch"; - hash = "sha256-XfdTkRk9B857V5DQnxlbwxTb098YwHzKGzNQBTQzWCM="; - }) - ]; - - pythonRelaxDeps = true; - - nativeBuildInputs = with python3.pkgs; [ + build-system = with python3Packages; [ poetry-core poetry-dynamic-versioning ]; - propagatedBuildInputs = with python3.pkgs; [ + dependencies = with python3Packages; [ anyconfig appdirs colorama + dynaconf environs + gitpython jinja2 jsonschema nested-lookup pathspec python-json-logger ruamel-yaml + structlog ]; - # Module has no tests - doCheck = false; + pythonRelaxDeps = true; - pythonImportsCheck = [ - "ansibledoctor" - ]; + doCheck = true; + + pythonImportsCheck = [ "ansibledoctor" ]; + + # ansible.errors.AnsibleError: Unable to create local directories(/private/var/empty/.ansible/tmp) + nativeCheckInputs = lib.optionals (!stdenv.hostPlatform.isDarwin) [ versionCheckHook ]; + + versionCheckProgramArg = "--version"; meta = { description = "Annotation based documentation for your Ansible roles";