From 1b15ea190d9f37543a02bccc6043677004a5fca6 Mon Sep 17 00:00:00 2001 From: stecalde Date: Mon, 16 Feb 2026 14:47:40 +0100 Subject: [PATCH 1/6] Fix bug related to breaking changes in new dulwich versioN --- airflow_dbt_python/hooks/fs/git.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/airflow_dbt_python/hooks/fs/git.py b/airflow_dbt_python/hooks/fs/git.py index c2deb97..173dcdd 100644 --- a/airflow_dbt_python/hooks/fs/git.py +++ b/airflow_dbt_python/hooks/fs/git.py @@ -93,7 +93,12 @@ def _upload( if self.upload_filter(f) is False: continue + # Starting from dulwich version 1.0.0, stage is an attribute of WorkTree class + try: repo.stage(str(f.relative_to(source))) + except AttributeError: + repo.get_worktree().stage(str(f.relative_to(source))) + ts = dt.datetime.now(dt.timezone.utc) repo.do_commit( From 8399101c63b48461b1efaeb0a4e12345cbb9f933 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Far=C3=ADas=20Santana?= Date: Mon, 16 Feb 2026 22:38:02 +0100 Subject: [PATCH 2/6] fix: Lint --- airflow_dbt_python/hooks/fs/git.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/airflow_dbt_python/hooks/fs/git.py b/airflow_dbt_python/hooks/fs/git.py index 173dcdd..6bdc5af 100644 --- a/airflow_dbt_python/hooks/fs/git.py +++ b/airflow_dbt_python/hooks/fs/git.py @@ -93,13 +93,12 @@ def _upload( if self.upload_filter(f) is False: continue - # Starting from dulwich version 1.0.0, stage is an attribute of WorkTree class + # Starting from dulwich version 1.0.0, stage is an attribute of WorkTree class try: repo.stage(str(f.relative_to(source))) except AttributeError: repo.get_worktree().stage(str(f.relative_to(source))) - ts = dt.datetime.now(dt.timezone.utc) repo.do_commit( self.commit_msg.format(ts=ts).encode(), self.commit_author.encode() From 2c00b450bb10d1fe8d801ef890f1a01e39f0bee1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Far=C3=ADas=20Santana?= Date: Mon, 16 Feb 2026 22:54:30 +0100 Subject: [PATCH 3/6] fix: Also update tests --- tests/hooks/test_git_hook.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/hooks/test_git_hook.py b/tests/hooks/test_git_hook.py index 41e30e0..b9801e2 100644 --- a/tests/hooks/test_git_hook.py +++ b/tests/hooks/test_git_hook.py @@ -317,18 +317,19 @@ def repo_dir(tmp_path): def repo(repo_dir, dbt_project_file, test_files, profiles_file, repo_branch): """Initialize a git repo with some dbt test files.""" repo = Repo.init(repo_dir, default_branch=repo_branch) + shutil.copyfile(dbt_project_file, repo_dir / "dbt_project.yml") - repo.stage("dbt_project.yml") + repo.get_worktree().stage("dbt_project.yml") shutil.copyfile(profiles_file, repo_dir / "profiles.yml") - repo.stage("profiles.yml") + repo.get_worktree().stage("profiles.yml") for test_file in test_files: remote_subdir = repo_dir / test_file.parent.name remote_subdir.mkdir(exist_ok=True) shutil.copyfile(test_file, remote_subdir / test_file.name) - repo.stage(f"{test_file.parent.name}/{test_file.name}") + repo.get_worktree().stage(f"{test_file.parent.name}/{test_file.name}") repo.do_commit(b"Test first commit", committer=b"Test user ") From 566f4cf4fce9c73c095244314c71f100dd336bd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Far=C3=ADas=20Santana?= Date: Mon, 16 Feb 2026 22:54:44 +0100 Subject: [PATCH 4/6] chore: Require dulwich>=1.0.0 --- pyproject.toml | 2 +- uv.lock | 56 +++++++++++++++++++++++++------------------------- 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 26e6b89..84020c5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -51,7 +51,7 @@ gcs = [ ] git = [ "apache-airflow-providers-ssh>=3.0.0", - "dulwich>=0.24.3", + "dulwich>=1.0.0", ] postgres = [ "dbt-postgres>=1.8.0,<2.0.0", diff --git a/uv.lock b/uv.lock index 0b2f6b1..f51a5df 100644 --- a/uv.lock +++ b/uv.lock @@ -190,7 +190,7 @@ wheels = [ [[package]] name = "airflow-dbt-python" -version = "3.2.2" +version = "3.2.3" source = { virtual = "." } dependencies = [ { name = "apache-airflow" }, @@ -290,7 +290,7 @@ requires-dist = [ { name = "dbt-snowflake", marker = "extra == 'snowflake'", specifier = ">=1.8.0,<2.0.0" }, { name = "dbt-spark", marker = "extra == 'spark'", specifier = ">=1.8.0,<2.0.0" }, { name = "dbt-spark", extras = ["all"], marker = "extra == 'adapters'", specifier = ">=1.8.0,<2.0.0" }, - { name = "dulwich", marker = "extra == 'git'", specifier = ">=0.24.3" }, + { name = "dulwich", marker = "extra == 'git'", specifier = ">=1.0.0" }, ] provides-extras = ["airflow-providers", "adapters", "bigquery", "gcs", "git", "postgres", "redshift", "s3", "snowflake", "spark"] @@ -1689,37 +1689,37 @@ wheels = [ [[package]] name = "dulwich" -version = "0.24.7" +version = "1.0.0" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "typing-extensions", marker = "python_full_version < '3.12'" }, { name = "urllib3" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/3a/40/ac6b7a749395edacd057278ac30cd66f15261581fe20c440327aa6fa9c5e/dulwich-0.24.7.tar.gz", hash = "sha256:f10bffa1395a8dedc3d38ac05164f761ae838a6a18f9a09a966f27dd651850d4", size = 968411, upload-time = "2025-10-23T11:01:34.894Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/b2/25/f576e3415c4434b01dd42eef58f2093babe51a7e9854edd86c03ab7833ac/dulwich-0.24.7-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:d55ccb9b89c00334a372bd1a8ac8203669251af0d1747dff36730eca617f941f", size = 1203966, upload-time = "2025-10-23T11:00:45.174Z" }, - { url = "https://files.pythonhosted.org/packages/ac/9b/a54fdcad2d9a756a3e22a834bc8e34515a9b787224256cc655d5f8432915/dulwich-0.24.7-cp310-cp310-manylinux_2_28_aarch64.whl", hash = "sha256:03baba91e4c143e8cacf1e55c91061a401a266de4ced5904909825a934b43cbb", size = 1283883, upload-time = "2025-10-23T11:00:47.813Z" }, - { url = "https://files.pythonhosted.org/packages/d8/06/1d4bf1fca40fb3bb65eaccb6e8ec069ac8f58a11ba4bb179896cd434b1e9/dulwich-0.24.7-cp310-cp310-manylinux_2_28_x86_64.whl", hash = "sha256:1476379539c60a689ccfefbde3ec3b5e584cd6fc8669de89e69c4ea6a404520f", size = 1309976, upload-time = "2025-10-23T11:00:49.064Z" }, - { url = "https://files.pythonhosted.org/packages/c7/6c/8e680917c4cc26571ba42672a44f1d22cf570f5c6840abf861730cbded8c/dulwich-0.24.7-cp310-cp310-win32.whl", hash = "sha256:e3675065022ec06a9ddc339e317900a1b4e6cc020516704e7c58eb3ba990458a", size = 873827, upload-time = "2025-10-23T11:00:50.692Z" }, - { url = "https://files.pythonhosted.org/packages/9c/28/f32471fe5d72084183651e61b6c64767b2b2b4540312193e88077d6f44b8/dulwich-0.24.7-cp310-cp310-win_amd64.whl", hash = "sha256:7c9f59c4089667f64e9f6c3711a444067882f1ae3d27e6475acf2c12ec9aeadc", size = 888277, upload-time = "2025-10-23T11:00:51.95Z" }, - { url = "https://files.pythonhosted.org/packages/b2/25/9ecbd82016a27cc9599554039adc1ac3b5ab89020b65493d864c685e7183/dulwich-0.24.7-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:381baadd6b4af9264586b91fe09260ccf790b08dae5ef688645503c199094c7a", size = 1203387, upload-time = "2025-10-23T11:00:53.683Z" }, - { url = "https://files.pythonhosted.org/packages/b7/6e/f6c2da48ffbfa94938579efec5fb9071dc345585327ce8d545eb12c97ea5/dulwich-0.24.7-cp311-cp311-manylinux_2_28_aarch64.whl", hash = "sha256:f88c2e7f6c369f2d988e14b76d2228a48d3aea475e7ff13ceb156edb3a18b2f9", size = 1283164, upload-time = "2025-10-23T11:00:55.296Z" }, - { url = "https://files.pythonhosted.org/packages/5e/e3/f94789b688b56e9b8383af7745605cd5b3c6ad1c835e7b0228a1a33e7313/dulwich-0.24.7-cp311-cp311-manylinux_2_28_x86_64.whl", hash = "sha256:bb12ace558b3f4ba37bbd069d0f6bd4add7416693a3bc95e3286c5acff0c05a1", size = 1309442, upload-time = "2025-10-23T11:00:57.672Z" }, - { url = "https://files.pythonhosted.org/packages/62/b7/c4eb362b5cd3138835519592190f1662055ca1b323c82bc9f2d03ee5c1d5/dulwich-0.24.7-cp311-cp311-win32.whl", hash = "sha256:ae60eec025625e65f7caf37a69076b12cdb4b63ddb317990ff0cb817c8132988", size = 872557, upload-time = "2025-10-23T11:00:59.39Z" }, - { url = "https://files.pythonhosted.org/packages/67/17/0bc77b51263b0bca688056afb608645cdd5458f84bb368138b0abf45846f/dulwich-0.24.7-cp311-cp311-win_amd64.whl", hash = "sha256:d328200d3caa20557e0568e8dd6c46714406b45abd4e0b333eeb5436614e4f3c", size = 888456, upload-time = "2025-10-23T11:01:00.665Z" }, - { url = "https://files.pythonhosted.org/packages/f1/0d/70e305ff1a666f157acac2bc3c73c94ce267e9112173fa2fcf852216430f/dulwich-0.24.7-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:5cb46d76558147529d8de295f8ca22bce0a4cb62163f708c54fc92f2a8d8728f", size = 1196408, upload-time = "2025-10-23T11:01:02.388Z" }, - { url = "https://files.pythonhosted.org/packages/6f/dc/e3628cc61ecc3ff7193639728f2c2cea8865d4e0e355edd8f941a441639c/dulwich-0.24.7-cp312-cp312-manylinux_2_28_aarch64.whl", hash = "sha256:ba0a121b148dffa5cc3d5fdceb32a002cb6b75a6b79abd89750584baa5021c0b", size = 1278919, upload-time = "2025-10-23T11:01:03.932Z" }, - { url = "https://files.pythonhosted.org/packages/11/09/2a70e2bbf07ee7be5b7d5c9c4324fb18a54df99d174daca6e84c3c3f1bb5/dulwich-0.24.7-cp312-cp312-manylinux_2_28_x86_64.whl", hash = "sha256:23182ca6bd54b74109c2fb2bb70b6c34e7dc3bbcc08ecb5c6c31a3a4aa1b30c3", size = 1305337, upload-time = "2025-10-23T11:01:05.844Z" }, - { url = "https://files.pythonhosted.org/packages/5c/37/f229c33be8104703a62364f33d10582a278356f4b6e2c1ab78d85cc73b89/dulwich-0.24.7-cp312-cp312-win32.whl", hash = "sha256:1c154a8f33acd815ad990e85d230497de892dde2476e35370f5762d34a1f70fa", size = 867545, upload-time = "2025-10-23T11:01:07.526Z" }, - { url = "https://files.pythonhosted.org/packages/2a/16/5afbd1ef7927f9d0bc230121c94a991b41ed667a9e033603c9919118e7d3/dulwich-0.24.7-cp312-cp312-win_amd64.whl", hash = "sha256:19f7a90377f5814716beaaeec34897d181c200a666baf477650e0cd4c699443f", size = 884404, upload-time = "2025-10-23T11:01:09.185Z" }, - { url = "https://files.pythonhosted.org/packages/bf/09/f24980d91916c5c374b0749071d1d531a072242905c5746787531e3db32c/dulwich-0.24.7-cp313-cp313-android_21_arm64_v8a.whl", hash = "sha256:461f2a894e1045fc6faad1ca0123aac87554f5dd40cbb5772e35933f1f6f1e32", size = 1301845, upload-time = "2025-10-23T11:01:10.617Z" }, - { url = "https://files.pythonhosted.org/packages/58/72/7c122b7e3ea8d98219df58e63abbd55b5b1980bd491ac81a32dfbebf9eec/dulwich-0.24.7-cp313-cp313-android_21_x86_64.whl", hash = "sha256:c8f44cb89d85fe40fa91ec34190d70a016be917ee841591fdbe9fd7e0ff61fc2", size = 1301838, upload-time = "2025-10-23T11:01:11.894Z" }, - { url = "https://files.pythonhosted.org/packages/4a/e8/76c642258967a694fb313a3fbc0f0ca3c376292f0de60654f91cd0eefebe/dulwich-0.24.7-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:06219dd38d553f18184dc885fbabe27d3d344ab0327d4ab3f1606617c09d8b32", size = 1197035, upload-time = "2025-10-23T11:01:13.225Z" }, - { url = "https://files.pythonhosted.org/packages/78/ec/c422e81037a537dac21a18357e1e828e67346c6f3af101821c3a089745b2/dulwich-0.24.7-cp313-cp313-manylinux_2_28_aarch64.whl", hash = "sha256:3eb5af24dd2c760701f4b7780b1a9fb5a0da731053fe5d1d0a2f92daa4c62240", size = 1278914, upload-time = "2025-10-23T11:01:14.717Z" }, - { url = "https://files.pythonhosted.org/packages/91/c3/bfaf8426ebd44d4834f7578e543727543a2ccdda8e7b40be919b857872b5/dulwich-0.24.7-cp313-cp313-manylinux_2_28_x86_64.whl", hash = "sha256:d8c42e45c217506759170b01b09e194acce1463aafd61f71fb7094b192ad09aa", size = 1304168, upload-time = "2025-10-23T11:01:16.677Z" }, - { url = "https://files.pythonhosted.org/packages/8a/52/3a7d40831ba5ab0701fc3bf67d28cc10c4fcddfc8ae5a600232837e1ffe1/dulwich-0.24.7-cp313-cp313-win32.whl", hash = "sha256:32e7e18edfad5dfb978ccf8e575b5776234110b722ea677d4e843058a1df1dd0", size = 867697, upload-time = "2025-10-23T11:01:18.654Z" }, - { url = "https://files.pythonhosted.org/packages/5a/b7/8d026a8ee3186c3a939ae41248eee47b374427547bd660088f4b8beb5920/dulwich-0.24.7-cp313-cp313-win_amd64.whl", hash = "sha256:265549c96680be1f6322cfeabb41337714c1a128824ab7e06d8c9d8a2640f4fb", size = 884367, upload-time = "2025-10-23T11:01:19.993Z" }, - { url = "https://files.pythonhosted.org/packages/14/30/d5c337fcf96e2b159b61053fd5b374b80629d28267f471483a3da5577ce3/dulwich-0.24.7-py3-none-any.whl", hash = "sha256:c1d6e35d7c41982d4ba375ce8ba9db783f4b4ca1a00c62f3121eb881f5c03c53", size = 545605, upload-time = "2025-10-23T11:01:33.566Z" }, +sdist = { url = "https://files.pythonhosted.org/packages/ee/df/4178b6465e118e6e74fd78774b451953dd53c09fdec18f2c4b3319dd0485/dulwich-1.0.0.tar.gz", hash = "sha256:3d07104735525f22bfec35514ac611cf328c89b7acb059316a4f6e583c8f09bc", size = 1135862, upload-time = "2026-01-17T23:44:16.357Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/fd/35/7b34b16a30e2eb268945d557525e776d5717d0b03631512c5cc3a938ad6a/dulwich-1.0.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:2881fe077792474cbd8cae140e7c2c2263fc07017ba37051946d869151f79624", size = 1337570, upload-time = "2026-01-17T23:43:27.948Z" }, + { url = "https://files.pythonhosted.org/packages/27/14/0fa6f5a2d01400be51cd149f87bfcd9b2c28ec820d1ac352d508fa2e43ab/dulwich-1.0.0-cp310-cp310-manylinux_2_28_aarch64.whl", hash = "sha256:3f090da8af238d7d9dba53a87b86a9e3e21529690b7536c253b1d5061bdb3a4d", size = 1400658, upload-time = "2026-01-17T23:43:30.529Z" }, + { url = "https://files.pythonhosted.org/packages/62/c2/2452c89565a54df8d6b8a58f357477350f4a18d97604132d3640dc4fc9c8/dulwich-1.0.0-cp310-cp310-manylinux_2_28_x86_64.whl", hash = "sha256:af39c560b75f64ec2d44519baf51ed1871be69e7ed4b0a4314215fa1ffe71195", size = 1429263, upload-time = "2026-01-17T23:43:32.61Z" }, + { url = "https://files.pythonhosted.org/packages/f8/76/988cbd71e5342127e8ced209ac7ea47275ff366635719fd09009d0e81a3e/dulwich-1.0.0-cp310-cp310-win32.whl", hash = "sha256:c2f2b2692524468bcd91bf79aa1f420bbbb59996506ec434ad6e72227f52365b", size = 986566, upload-time = "2026-01-17T23:43:34.782Z" }, + { url = "https://files.pythonhosted.org/packages/b2/01/48f2e95a9d872537dee93f05eaeac045eef01f5efafce5d036114892da0f/dulwich-1.0.0-cp310-cp310-win_amd64.whl", hash = "sha256:2ba6072e922b815006b036d0df59b25eb2523b89581fcf9f47feb43324629ba4", size = 1001970, upload-time = "2026-01-17T23:43:36.68Z" }, + { url = "https://files.pythonhosted.org/packages/66/fa/99a422ac3bca08eab07a537c86dce12b6ce20b72cf5a14bef5cdb122eddf/dulwich-1.0.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:1213da9832621b07dfaafdb651b74edb8966481475c52be0bff8dee352d75853", size = 1336935, upload-time = "2026-01-17T23:43:38.84Z" }, + { url = "https://files.pythonhosted.org/packages/86/54/1739af06492a4e98b5c96aa3e22d0b58fda282c10849db733ee8c52f423d/dulwich-1.0.0-cp311-cp311-manylinux_2_28_aarch64.whl", hash = "sha256:e370e3cdd0b00c059ebee8371cc1644aa61d6de3de0ca5c2f2a5f075bf4c53d9", size = 1400229, upload-time = "2026-01-17T23:43:41.03Z" }, + { url = "https://files.pythonhosted.org/packages/0c/76/efde5050ae9422cf418bee98d3d35dc99935fb076679100e558491e691c9/dulwich-1.0.0-cp311-cp311-manylinux_2_28_x86_64.whl", hash = "sha256:86271e17d76a667abb1d68dad83b6324422a1ab20d60be30395fd60a37b735b1", size = 1428812, upload-time = "2026-01-17T23:43:43.412Z" }, + { url = "https://files.pythonhosted.org/packages/02/82/f166b206db70db11fb222abeb661b2879ea10f32ad86c85949e5a4fba26a/dulwich-1.0.0-cp311-cp311-win32.whl", hash = "sha256:3051007bc2792b5a72fee938842cf45b66924d6d5147d824f3e609eb75fc0322", size = 985517, upload-time = "2026-01-17T23:43:45.409Z" }, + { url = "https://files.pythonhosted.org/packages/e7/b7/3f8c0059fc8a0eba22e8bb9cec7e2b4e514bc75ede83a320570c5de17599/dulwich-1.0.0-cp311-cp311-win_amd64.whl", hash = "sha256:5cf6e9b5620a3e842663b58ad534da29944db6a6016ba61fc9bbed24830cd85f", size = 1001981, upload-time = "2026-01-17T23:43:47.29Z" }, + { url = "https://files.pythonhosted.org/packages/cc/54/78054a9fd62aa7b1484e97673435cae494cad5d04f020d4571c47e9a2875/dulwich-1.0.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:6736abc2ce2994e38a00a3a4c80237b2b944e7c6f4e346119debdd2592312d83", size = 1316278, upload-time = "2026-01-17T23:43:49.542Z" }, + { url = "https://files.pythonhosted.org/packages/30/20/b2140acf9431c8c862c200cd880b9e5cce8dbe9914324bf238ed92574aea/dulwich-1.0.0-cp312-cp312-manylinux_2_28_aarch64.whl", hash = "sha256:06514b02da1e32a077062924d2c3b20a7bc76ab9b92eeac691f72b76b14111bc", size = 1393024, upload-time = "2026-01-17T23:43:51.453Z" }, + { url = "https://files.pythonhosted.org/packages/69/71/ad744b9802f222dc364a851bd6130c17809b3472a81a16aefd7d3196f22a/dulwich-1.0.0-cp312-cp312-manylinux_2_28_x86_64.whl", hash = "sha256:32b6fb1205b1d9c0e43986f9e4e5e50a3670014440e61498eca2b8ab6b00129f", size = 1421022, upload-time = "2026-01-17T23:43:53.053Z" }, + { url = "https://files.pythonhosted.org/packages/21/c0/dfcd795a6b516b9e24aa4339dcc9cdd5ceffe007ad397e5b4938f9793981/dulwich-1.0.0-cp312-cp312-win32.whl", hash = "sha256:1a6583499b915fe5a8ac5595325f1e6a6a5a456de1575e0293e8a6ebb6915f3f", size = 980617, upload-time = "2026-01-17T23:43:54.642Z" }, + { url = "https://files.pythonhosted.org/packages/7c/d4/11075795cc8ab48c771c997fdefef612775ef2582c4710a8fba6ca987500/dulwich-1.0.0-cp312-cp312-win_amd64.whl", hash = "sha256:f90b54faeb995607c876cdb2c082c0f0af702e1ccb524c6126ce99a36536fa3f", size = 998048, upload-time = "2026-01-17T23:43:56.176Z" }, + { url = "https://files.pythonhosted.org/packages/97/82/5ce63c7a2ac8d756bc7477298633e420632eed97ea645ecea13210e9b1a7/dulwich-1.0.0-cp313-cp313-android_21_arm64_v8a.whl", hash = "sha256:ff94f47f0b5787d4e6a0105daf51ff9cdb4e5b9d4e9f8dd01b58ba9a5b79bbd9", size = 1417766, upload-time = "2026-01-17T23:43:57.855Z" }, + { url = "https://files.pythonhosted.org/packages/b9/71/7d4ecdf9e0da21ceec3ac05b03c2cac8cf2271a52172fd55dd65a9faa9e7/dulwich-1.0.0-cp313-cp313-android_21_x86_64.whl", hash = "sha256:1d95663441c930631d9d1765dc4f427dcc0662af45f42a0831357e60055ddb84", size = 1417760, upload-time = "2026-01-17T23:43:59.42Z" }, + { url = "https://files.pythonhosted.org/packages/09/3d/0486cefda75c7e9ea8d8dbdeaa014d618e694bc75734f073927135b37a4b/dulwich-1.0.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:78542a62fabea894943a1d01c9c477a56eee5f7d58d3bdee42c7e0622ddf6893", size = 1316186, upload-time = "2026-01-17T23:44:01.334Z" }, + { url = "https://files.pythonhosted.org/packages/f7/a7/a24c6e1e9f7e5a2ee8f9e362e2c3e5d864cc2b69f04d02bedf82673f31c3/dulwich-1.0.0-cp313-cp313-manylinux_2_28_aarch64.whl", hash = "sha256:d1c33f6456e4335dfe6f4d3917fa7d77050d6470bbbaf8054b5c5084ee8e8cd1", size = 1392530, upload-time = "2026-01-17T23:44:03.655Z" }, + { url = "https://files.pythonhosted.org/packages/d4/03/1ff9dbda655fc714528786e3fdbbe16278bbefc02b9836e91a38620aa616/dulwich-1.0.0-cp313-cp313-manylinux_2_28_x86_64.whl", hash = "sha256:581330cf799577f194fda2b5384b7ba50e095de7ff088779c027a6de63642de2", size = 1420386, upload-time = "2026-01-17T23:44:05.844Z" }, + { url = "https://files.pythonhosted.org/packages/f0/ca/72e7cdde2ee0a4f858166ba8eb81a0d89f61762d9114bd7a358798892fc9/dulwich-1.0.0-cp313-cp313-win32.whl", hash = "sha256:276ff18ae734fe4a1be66d4267216a51d2deab0ac981d722db3d32fcc2ac4ff8", size = 981425, upload-time = "2026-01-17T23:44:07.373Z" }, + { url = "https://files.pythonhosted.org/packages/d7/27/8d4bed76ce983052e259da25255fed85b48ad30a34b4e4b7c8f518fdbc30/dulwich-1.0.0-cp313-cp313-win_amd64.whl", hash = "sha256:cc0ab4ba7fd8617bebe20294dedaa8f713d1767ce059bfbefd971b911b702726", size = 998055, upload-time = "2026-01-17T23:44:08.908Z" }, + { url = "https://files.pythonhosted.org/packages/f9/99/4543953d2f7c1a940c1373362a70d253b85860be64b4ef8885bf8bfb340b/dulwich-1.0.0-py3-none-any.whl", hash = "sha256:221be803b71b060c928e9faae4ab3e259ff5beac6e0c251ba3c176b51b5c2ffb", size = 647950, upload-time = "2026-01-17T23:44:14.449Z" }, ] [[package]] From 462b45a894c0c7ab9766cad143c98b082d5a4cfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Far=C3=ADas=20Santana?= Date: Mon, 16 Feb 2026 23:12:47 +0100 Subject: [PATCH 5/6] fix: Replace other instances of do_commit --- airflow_dbt_python/hooks/fs/git.py | 8 ++------ tests/hooks/test_git_hook.py | 4 +++- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/airflow_dbt_python/hooks/fs/git.py b/airflow_dbt_python/hooks/fs/git.py index 6bdc5af..1ba3c5e 100644 --- a/airflow_dbt_python/hooks/fs/git.py +++ b/airflow_dbt_python/hooks/fs/git.py @@ -93,14 +93,10 @@ def _upload( if self.upload_filter(f) is False: continue - # Starting from dulwich version 1.0.0, stage is an attribute of WorkTree class - try: - repo.stage(str(f.relative_to(source))) - except AttributeError: - repo.get_worktree().stage(str(f.relative_to(source))) + repo.get_worktree().stage(str(f.relative_to(source))) ts = dt.datetime.now(dt.timezone.utc) - repo.do_commit( + repo.get_worktree().commit( self.commit_msg.format(ts=ts).encode(), self.commit_author.encode() ) diff --git a/tests/hooks/test_git_hook.py b/tests/hooks/test_git_hook.py index b9801e2..3b00a01 100644 --- a/tests/hooks/test_git_hook.py +++ b/tests/hooks/test_git_hook.py @@ -331,7 +331,9 @@ def repo(repo_dir, dbt_project_file, test_files, profiles_file, repo_branch): repo.get_worktree().stage(f"{test_file.parent.name}/{test_file.name}") - repo.do_commit(b"Test first commit", committer=b"Test user ") + repo.get_worktree().commit( + b"Test first commit", committer=b"Test user " + ) yield repo From 9e9b5088fa5a8cb1f92ccc3fbe2ff1d234ab4b8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Far=C3=ADas=20Santana?= Date: Mon, 16 Feb 2026 23:40:33 +0100 Subject: [PATCH 6/6] fix: Stage in loop --- airflow_dbt_python/hooks/fs/git.py | 2 +- tests/hooks/test_git_hook.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/airflow_dbt_python/hooks/fs/git.py b/airflow_dbt_python/hooks/fs/git.py index 1ba3c5e..42899b1 100644 --- a/airflow_dbt_python/hooks/fs/git.py +++ b/airflow_dbt_python/hooks/fs/git.py @@ -93,7 +93,7 @@ def _upload( if self.upload_filter(f) is False: continue - repo.get_worktree().stage(str(f.relative_to(source))) + repo.get_worktree().stage([str(f.relative_to(source))]) ts = dt.datetime.now(dt.timezone.utc) repo.get_worktree().commit( diff --git a/tests/hooks/test_git_hook.py b/tests/hooks/test_git_hook.py index 3b00a01..0703595 100644 --- a/tests/hooks/test_git_hook.py +++ b/tests/hooks/test_git_hook.py @@ -344,7 +344,7 @@ def repo(repo_dir, dbt_project_file, test_files, profiles_file, repo_branch): def git_server(repo, repo_name): """A testing local TCP git server.""" backend = DictBackend({repo_name.encode(): repo}) - dul_server = TCPGitServer(backend, b"localhost", 0) + dul_server = TCPGitServer(backend, "localhost", 0) server_thread = threading.Thread(target=dul_server.serve) server_thread.start() @@ -354,6 +354,8 @@ def git_server(repo, repo_name): yield server_address, server_port dul_server.shutdown() + dul_server.server_close() + server_thread.join()