DiamondLightSource / python3-pip-skeleton

Archived in favour of https://github.com/DiamondLightSource/python-copier-template
Apache License 2.0
4 stars 4 forks source link

Direct Github dependencies cause issues with locking #127

Open callumforrester opened 1 year ago

callumforrester commented 1 year ago

When I add a dependency such as

"dodal @ git+https://github.com/DiamondLightSource/dodal.git",

to pyproject.toml, it gets locked into requirements.txt as

dodal @ git+https://github.com/DiamondLightSource/dodal.git@6b387f690f7978d2e3f0a4f180dd46b10e2623ba

i.e. the most recent commit hash. The container CI job then fails because it thinks these two are different things i.e.

#12 12.87 ERROR: Cannot install dodal 0.0.2.dev3+g6b387f6 (from git+https://github.com/DiamondLightSource/dodal.git@6b387f690f7978d2e3f0a4f180dd46b10e2623ba) and htss-rig-bluesky==0.1.dev58+g1ace857 because these package versions have conflicting dependencies.

I cannot determine exactly why, the workaround is to exclude the affected package from the lockfile altogether in .github/install_requirements/action.yml, in this case:

    - name: Create lockfile
      run: |
        mkdir -p lockfiles
        pip freeze --exclude-editable --exclude dodal > lockfiles/${{ inputs.requirements_file }}
        # delete the self referencing line and make sure it isn't blank
        sed -i '/file:/d' lockfiles/${{ inputs.requirements_file }}
      shell: bash