Skip to content

Instantly share code, notes, and snippets.

@qwcode
Created October 3, 2012 18:07
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save qwcode/3828683 to your computer and use it in GitHub Desktop.
Save qwcode/3828683 to your computer and use it in GitHub Desktop.
"pip wheel"
Usage: pip wheel [OPTIONS] PACKAGE_NAMES...
Creates wheel archives from your requirements and place into ./wheels
(requires distribute>0.6.28 and wheel)
-w --wheel-dir <DIR> //alternative dir to place wheels into
--force-rebuild //rewrite existing wheels
--unpack-only <DIR> //unpack to dir, for manual building with "setup.py bdist_wheel"
-r, --requirement <FILENAME>
-f, --find-links <URL>
-i, --index-url <URL>
--extra-index-url <URL>
--no-index
-M, --use-mirrors
--mirrors <URL>
--download-cache <DIR>
--no-deps
why not other names?
- "pip bdist --format=[wheel...]": if wheel succeeds, would we seriously want to support any of the older forms?
- "pip build ..."
- if the intention here is to just label wheel building as "build", IMHO that will create confusion.
- if the intention is to do something much more elaborate, e.g also trying to break up the "setup.py install" step, that's too much IMHO
design:
- you can't just inherit from commands.install, or you take on all install options. that's too confusing
- either inherit directly from pip.basecommand.command (and construct a RequirmentSet),
or possibly do some refactor and create a new ReqSet command base class, if it makes sense
- feel free to modify and *add* methods to InstallRequirement/RequirementSet.
(better to not make these enormously long methods any longer and complicated)
P.S. if the general "--package-cache" idea succeeds( https://gist.github.com/3828762),
then I could see coming back and offering a "--build-wheel" option to install that builds/writes
wheels to your package-cache if you're using one.
@dholth
Copy link

dholth commented Oct 10, 2012

You can use pip install --ignore-installed to build a more complete cache. There needs to be a shortcut for "ignore everything except distribute" given the trouble pip has upgrading its own dependency, or pip could just ignore distribute all the time since upgrading distribute with pip is generally a bad idea.

If you have a tricky build, wouldn't you just run python setup.py bdist_wheel for the tricky dist? pip could include the "run any setup.py under setuptools" as a script.

@qwcode
Copy link
Author

qwcode commented Oct 10, 2012

assume that the new pip wheel command will ignore whether or not the packages are already installed?

that's my intention

When a package needs custom build_ext options (usually -L or -I for external libraries) the current incantation is

I guess at least support an --unpack-only option (so you can manually do certain ones)?

Assuming you don't want to invent a more complex automatic method of passing arguments to setup.py

wasn't planning on it, but related to this, there is a pull to add --install-option support line by line in requirements, but it's stagnating. pypa/pip#515

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment