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

The --build-dir options doesn't work for local archive installs #804

Closed
hetmankp opened this issue Feb 11, 2013 · 12 comments
Closed

The --build-dir options doesn't work for local archive installs #804

hetmankp opened this issue Feb 11, 2013 · 12 comments
Labels
auto-locked Outdated issues that have been locked by automation C: unnamed reqs Handling and processing unnamed requirements type: docs Documentation related

Comments

@hetmankp
Copy link

When installing from a local archive, the --build-dir option is ignored and instead a temporary directory is always used.

As far as I can tell this is decided in req.py, in InstallRequirement.build_location(), where the value supplied by --build-dir is only taken into consideration if self.req is not None. I'm not really sure what self.req is meant to represent so I can't submit a patch at this time (or decide if this is expected behaviour in some way).

Thanks for your feedback.

UPDATE: #1831 fixed this for wheel archives. the problem remains for local sdist installs.

@qwcode
Copy link
Contributor

qwcode commented Feb 11, 2013

the parsing currently doesn't try to determine a "project name" just from a archive file alone, so therefore doesn't create a build dir using the name it didn't parse, but rather uses a tmp dir.

in most cases it should/could parse something I think. btw, the new project distlib has a good function for this: https://bitbucket.org/vinay.sajip/distlib/src/a586fab287abc1f34d1d5e251ef20ae19d1ad51e/distlib/util.py?at=default#cl-521 (@vsajip, what's the origins of this function and supported scope?)

for now though, a workaround is to install from the local archive using ---find-links like so:
(assuming it's using standard naming)

pip install --no-index --find-links=file://path/to/archive/dir/ name==version

@vsajip
Copy link
Contributor

vsajip commented Feb 11, 2013 via email

@qwcode
Copy link
Contributor

qwcode commented Feb 11, 2013

there's an equivalent that assumes you have a project name to use in parsing, but nothing that just parses in the abstract. btw, I'm using your function in a project at work. could pip just grab this w/o trying to use distlib for now?

@vsajip
Copy link
Contributor

vsajip commented Feb 11, 2013

could pip just grab this w/o trying to use distlib for now?

Sure, as long as you pass back any improvements you make ;-) Just kidding, but it would be nice if you did.

@qwcode
Copy link
Contributor

qwcode commented Feb 11, 2013

my concern is to be clear what version schemes it's supposed to work for or not work for.... corner cases that fail, or work, but shouldn't etc.... I certainly pass back clarity/fixes related to that.

@vsajip
Copy link
Contributor

vsajip commented Feb 11, 2013

It's meant to be version-scheme agnostic. The version part will match any sequence of alphanumerics, underscores, period, plus and minus, which should cover most sane version numbers. I have been thinking about changing the regex so that project name components can't have '-' - at the moment it allows 'my.project.name' or 'my-project-name', but that won't work in the case where version is e.g. 'latest-0.9' and the composite is 'my-project-name-latest-0.9', unless a project name is passed in.

Although setuptools/distribute convert '-' in project names to '_' in file names of corresponding distributions, I don't think distutils does, so there are ambiguous filenames out there AFAIK.

@qwcode
Copy link
Contributor

qwcode commented Feb 26, 2013

leaving open; we should update the --build help text to explain this.

@qwcode
Copy link
Contributor

qwcode commented Sep 25, 2014

adding an important comment from #2060 (#2060 (comment) )

"even if it uses the temp build directory, there's no rationale for --no-clean to be ignored"

@qwcode qwcode changed the title The --build-dir options doesn't work for local archive installs The --build-dir options doesn't work for local sdist archive installs Sep 25, 2014
@qwcode qwcode changed the title The --build-dir options doesn't work for local sdist archive installs The --build-dir options doesn't work for local archive installs Sep 25, 2014
@rgommers
Copy link

rgommers commented Nov 5, 2015

The cause of this issue as well as related ones like gh-3171 seems to be that the options dict is simply ignored when calling WheelBuilder here: https://github.com/pypa/pip/blob/develop/pip/commands/install.py#L288

@dstufft
Copy link
Member

dstufft commented Mar 24, 2017

Closing this, with #4371 we're going to be deprecating/removing the --build option.

@dstufft dstufft closed this as completed Mar 24, 2017
@jdemeyer
Copy link

Please reopen, this issue still remains.

@jdemeyer
Copy link

I'm not sure what "local archive installs" in the title means here, but at least --build is not supported when installing from a local directory:

$ pip install --verbose --upgrade --build=/tmp/pip .
Processing /home/jdemeyer/math/cylinder/src
  Running setup.py (path:/tmp/pip-hyhaPT-build/setup.py) [...]

@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Jun 3, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jun 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation C: unnamed reqs Handling and processing unnamed requirements type: docs Documentation related
Projects
None yet
Development

No branches or pull requests

6 participants