question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Log the resolved commit SHA when installing package via Git URI to make it easier to debug

See original GitHub issue

What’s the problem this feature will solve?

Currently, when we install a package via Git URI, pip doesn’t tell us what the current commit SHA is:

$ pip install git+https://github.com/scikit-learn/scikit-learn.git
Collecting git+https://github.com/scikit-learn/scikit-learn.git
  Cloning https://github.com/scikit-learn/scikit-learn.git to /tmp/pip-req-build-lna_339q
  Running command git clone -q https://github.com/scikit-learn/scikit-learn.git /tmp/pip-req-build-lna_339q

Let’s say we run the command above in CI to run tests against the dev version of scikit-learn. If the current commit hash was shown, it would help us indetify commits/changes that break the tests.

Describe the solution you’d like

Just show the current commit SHA after cloning the repo.

Alternative Solutions

$ pip freeze | grep scikit-learn
scikit-learn @ git+https://github.com/scikit-learn/scikit-learn.git@f2fb07581339f063b501b3e820917d66ee4c1fa3

# However, this doesn't work for the following use case:
$ pip wheel git+https://github.com/scikit-learn/scikit-learn.git
$ pip install path/to/built/wheel
$ pip freeze | grep scikit-learn
scikit-learn @ file:/path/to/built/wheel

Additional context

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
uranusjrcommented, Jul 8, 2021

IIRC (didn’t check) it’s already available in debug mode, and moving it to INFO does make sense to me. We also recently introduced a new verbose log level, so changing it to show in -v also makes sense. And if it wasn’t already present, we should add it.

A PR would be very welcomed!

0reactions
harupycommented, Jul 9, 2021

Got it, I’ll file a PR!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Git - Submodules - Git SCM
This lets you clone another repository into your project and keep your commits separate. Starting with Submodules. We'll walk through developing a simple...
Read more >
Commits API - GitLab Docs
This API operates on repository commits. Read more about GitLab-specific information for commits. Responses. In commit responses, created_at and ...
Read more >
GitHub Action for running Cypress end-to-end tests
If you re-run the GitHub workflow, if you use the same custom build id during recording, Cypress Cloud will cancel the run with...
Read more >
Adding package dependencies to your app - Apple Developer
When you enter the package dependency's URL or pick a Swift package from the ... It lists the specific Git commits to which...
Read more >
simple-git - npm
Simple GIT interface for node.js. Latest version: 3.15.1, last published: 21 days ago. Start using simple-git in your project by running ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found