项目作者: carloshatch

项目描述 :
Installer for Python Wheels
高级语言: Python
项目地址: git://github.com/carloshatch/wi.git
创建时间: 2017-12-18T12:07:39Z
项目社区:https://github.com/carloshatch/wi

开源协议:MIT License

下载


wi, the wheel installer

This is a package installer for Python wheel packages. For more information
about wheels, please refer to https://pythonwheels.com/

Besides making the package installation process much faster, wheels allow
you to get rid of a building env on your servers, tools such as compilers
and dev libraries will not be required anymore if all of your dependencies
has wheel packages available.

Speaking of packages available, this tool is an attempt to motivate authors
of libs, frameworks and tools to release their packages in the wheel format.

Please note that this tool isn’t a replacement for pip. If you have deps
that don’t have wheels package available, you will still have to use pip.

However, this tool makes it easy to fallback to pip when the wheel packages
are not found.

No idle time

This tool is based on asyncio, in such a way that while packages are being
downloaded, the tool will perform the installation of packages already
downloaded.

Installation

  1. $ pip install wi

Usage

If your packages are listed in a requirements.txt file, you can just run:

  1. $ wi

If the packages are on a file other than requirements.txt, then you should
specify the file path as the sole argument to the command. For example:

  1. $ wi requirements-staging.txt

The command above will search for wheel packages for every entry in the file.
In case no package is found, the command will output to stdout the package
name and version, in the format package==version, meaning you can redirect
the stdout to pip as a fallback for installing the missing packages:

  1. $ wi | xargs pip install --no-deps

Demonstration

  1. (wi) root@personal:~# pip uninstall -y -r requirements.txt &>/dev/null
  2. (wi) root@personal:~# time pip install --no-cache-dir --no-deps \
  3. -r requirements.txt &>/dev/null
  4. real 0m46.714s
  5. user 0m40.575s
  6. sys 0m3.077s
  7. (wi) root@personal:~# pip uninstall -y -r requirements.txt &>/dev/null
  8. (wi) root@personal:~# time wi &>/dev/null
  9. real 0m2.315s
  10. user 0m1.680s
  11. sys 0m0.404s

Contributions

Contributions are welcome. Given this is just the start, the tool is missing
lots of cool stuff. If you have time and are willing to contribute, just
open a ticket and let’s discuss it there!

It is also important to share this tool so we can advance with the current
status os python wheels and pip itself.

Running tests

Minimal tests are present runing tox

  1. $ pip install tox
  2. $ tox