Skip to content

Can't run tests if git tags are not fetched #1084

@aleivag

Description

@aleivag

fixit (ufmt and pyre-check) depends on libcst (as they should) example: https://github.com/Instagram/Fixit/blob/main/pyproject.toml#L29 but this means that if libcst depends on fixit (or the others), it should do it in a "non dev" way https://github.com/Instagram/LibCST/blob/main/pyproject.toml#L30C1-L30C26

we get a warning when we try to run hatch the first time:

aleivag@aleivag-fedora-PC1C0JVZ:~/code/LibCST$ hatch run test
ERROR: Cannot install libcst and libcst[dev]==0.1.dev1023+g4b31d3d.d20240103 because these package versions have conflicting dependencies.
ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts

next time we run the command its ok, so this is not really breaking anything, its just annoying when you come for the first time to the project... or who want to use pip install . directly

the reason why this happen is because we use "features" and we install both libcst and libcst[dev], but libcst[dev] depends on libcst, so does dependencies specified in the dev feature. since the "version resolution" its dynamic and we are not on a release branch, libcst version is resolved to something like 0.1.git+ and fixit depends on libcst > 0.3.x ... this does not happen if you just specify the dependencies in the default hatch env (that way there is no dev libcst dependency), or set the version to something like 1.0...

finally this all happen because of implementation details of setuptools and IMO we cant depend on any behavior here.

solutions:

  1. remove dev feature dependencies and add just them to the default env dependency.
  2. create version file , and keep track of versions in the version file
  3. remove conflicting dependencies, as they are for linting and testing, and it seems like pipx of something like that (each of this tools can have their own environment) its more fitting.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions