pre-commit-ci / issues

public issues for https://pre-commit.ci
16 stars 3 forks source link

Show version info for additional_dependencies in build step #113

Closed janosh closed 2 years ago

janosh commented 2 years ago

E.g. for

  - repo: https://github.com/pre-commit/mirrors-mypy
    rev: v0.930
    hooks:
      - id: mypy
        additional_dependencies: [types-requests, types-pyyaml]

list what versions of types-requests, types-pyyaml were installed.

asottile commented 2 years ago

pre-commit does not have that information, if you want specific versions use ==

janosh commented 2 years ago

I always want the latest but want to know afterwards which one was used. How about printing the commit SHA?

asottile commented 2 years ago

it's already there

janosh commented 2 years ago

For additional_dependencies? Where? This is what I see.

https://github.com/pre-commit/mirrors-mypy:types-pyyaml,types-requests@v0.930 (52.5KiB) (cached)
  sha: 886e1c39f0dcddeee1cd260418372cf5f3932391
  envs:
  - python@python3.9 (55MiB) (cached)
asottile commented 2 years ago

that sha bit?

janosh commented 2 years ago

That SHA references this commit https://github.com/pre-commit/mirrors-mypy/commit/886e1c39f0dcddeee1cd260418372cf5f3932391. What does that tell me about types-pyyaml and types-requests?

asottile commented 2 years ago

https://github.com/pre-commit-ci/issues/issues/113#issuecomment-1053580716

I already answered that

janosh commented 2 years ago

I already answered that

You did not. You said pre-commit had no access to the version number, nothing about commit SHAs. How does it install additional deps that it doesn't even have access to anything? Do you feel there's something wrong with my question?

asottile commented 2 years ago

how would it possibly get the shas if it couldn't get the version number? the sha is a property of the original version control system that the dependency used which isn't even available normally? (how do you go from pre-commit==2.17.0 to d3bdf1403d92f). yes your question makes no sense

janosh commented 2 years ago

As pre-commit.ci grows, I bet I won't be the only person who has a pre-commit run succeed locally but fail in CI at which point of course people want to know the versions of all deps used to pinpoint the issue. So how does my question not make sense? You're not helping your own product improve by blocking a reasonable feature suggestion.

how would it possibly get the shas if it couldn't get the version number?

How should I know how pre-commit.ci installs deps? You didn't answer that part of my question and it's closed source (I think?).

asottile commented 2 years ago

As pre-commit.ci grows, I bet I won't be the only person who has a pre-commit run succeed locally but fail in CI at which point of course people want to know the versions of all deps used to pinpoint the issue

there's nothing special, it's the same as pre-commit -- and the docker image is public specifically so you can reproduce it

How should I know how pre-commit.ci installs deps? You didn't answer that part of my question

it's no different from pre-commit install-hooks, why would it be different?

good day