Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify pip build behavior to better support tools like setuptools_scm #7549

Closed
toumorokoshi opened this issue Jan 3, 2020 · 6 comments
Closed

Comments

@toumorokoshi
Copy link

What's the problem this feature will solve?

Currently, setuptools_scm does not support the ability to detect the version of the package if the package root is nested in the vcs root: pypa/setuptools-scm#357

It would be great if there could be some reconciliation on the pip or setuptools_scm side to better support version-control based version strings.

Describe the solution you'd like

As I understand it currently, pip install copies the contents of the package directory into a temp directory, then uses that to build the package.

setuptools_scm is then unable to retrieve the metadata of the vcs system, as the parent directory contains the configuration for the version control system. e.g. for git, the .git directory does not exist in a child directory.

I don't have a clear approach on a solution, but I'm happy to contribute the needed code. I guess as a starter, if there was a way to hook retrieval of information before the directory copy (e.g. letting setuptools_scm write a file somewhere).

conversely if there was a marker to the original source directory, allowing someone to read that information, then setuptools_scm could resolve the version control directory.

Alternative Solutions

Additional context

If there's a better forum to have this discussion, i'm happy to move the conversation there.

@triage-new-issues triage-new-issues bot added the S: needs triage Issues/PRs that need to be triaged label Jan 3, 2020
@sbidoul
Copy link
Member

sbidoul commented Jan 3, 2020

This relates to #3500. You can start reading at #3500 (comment)

@sbidoul
Copy link
Member

sbidoul commented Apr 13, 2020

This should be resolved by #7882 (build local directories in place).

@sbidoul sbidoul closed this as completed Apr 13, 2020
@pradyunsg
Copy link
Member

We have now (per #7951) published a beta release of pip, pip 20.1b1. This release includes #7882, which implemented a solution for this issue.

I hope participants in this issue will help us by testing the beta and checking for new bugs. We'd like to identify and iron out any potential issues before the main 20.1 release on Tuesday.

I also welcome positive feedback along the lines of "yay, it works better now!" as well, since the issue tracker is usually full of "issues". :)

@pradyunsg
Copy link
Member

Unfortunately, there have been a number of issues with the implementation of in-place builds (which are being tracked under #7555) which means that for now, we need to revert #7882. As a result, this issue will become a problem again, and we'll therefore be reopening it. Longer-term, we hope to have a solution that addresses the issues that in-place builds solved, but without the impact on other workflows that the current solution had.

Sorry for the disruption that this will cause.

@pradyunsg pradyunsg reopened this May 14, 2020
@toumorokoshi
Copy link
Author

@pradyunsg thanks for the heads up! FWIW I did test the pip beta you posted and it worked for my usecase. So thanks for the trying to make this happen. I may followup later if I'm able to scrounge up some time to contribute a fix.

@pradyunsg
Copy link
Member

#7555 is resolved again! :)

@pradyunsg pradyunsg removed the S: needs triage Issues/PRs that need to be triaged label Mar 17, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants