@@ -402,6 +402,8 @@ jobs:
402402
403403 - name : Update dependency to the current branch
404404 working-directory : synapse-invite-checker
405+ # the synapse dependency of the invite-checker is already pointing to synapse's master branch
406+ # we skip the branch update when the CI runs on master
405407 run : |
406408 if [ "${{ steps.synapse-ref.outputs.ref }}" != "master" ]; then
407409 sed -i 's|"matrix-synapse[^"]*"|"matrix-synapse @ git+https://github.com/${{ steps.synapse-ref.outputs.repo }}.git@${{ steps.synapse-ref.outputs.ref }}"|' pyproject.toml
@@ -446,8 +448,14 @@ jobs:
446448 with :
447449 python-version : " 3.13"
448450
449- - name : Install hatch
450- run : pip install hatch
451+ - name : Install hatch and poetry
452+ run : pip install hatch poetry poetry-plugin-export
453+
454+ - name : Generate constraints from Synapse lockfile
455+ # hatch can't read synapse's lock file, we export it in a format hatch can use
456+ # this avoids errors due to new dependency versions with breaking changes
457+ run : |
458+ poetry export --without-hashes --format requirements.txt --output "${{ github.workspace }}/synapse-token-authenticator/synapse-constraints.txt"
451459
452460 - name : Determine synapse git ref
453461 id : synapse-ref
@@ -462,8 +470,6 @@ jobs:
462470
463471 - name : Update dependency to the current branch
464472 working-directory : synapse-token-authenticator
465- # the synapse dependency of the token-authenticator is already pointing to synapse's master branch
466- # we skip the branch update when the CI runs on master
467473 run : |
468474 sed -i 's|"matrix-synapse[^"]*"|"matrix-synapse @ git+https://github.com/${{ steps.synapse-ref.outputs.repo }}.git@${{ steps.synapse-ref.outputs.ref }}"|' pyproject.toml
469475 # Check if the file was actually modified
@@ -472,8 +478,16 @@ jobs:
472478 exit 1
473479 fi
474480
481+ # - name: Inject synapse's poetry.lock constraints
482+ # working-directory: synapse-token-authenticator
483+ # run: |
484+ # # this works because Hatch passes the dependency list directly to pip
485+ # sed -i '/dependencies = \[/a \ "-r synapse-constraints.txt",' pyproject.toml
486+
475487 - name : Run token-authenticator tests
476488 working-directory : synapse-token-authenticator
489+ env :
490+ PIP_CONSTRAINT : " ${{ github.workspace }}/synapse-token-authenticator/synapse-constraints.txt"
477491 run : hatch run cov
478492
479493 - name : Display Hatch Environment Info
0 commit comments