Giter Club home page Giter Club logo

wheel's People

Contributors

abravalheri avatar agronholm avatar ales-erjavec avatar benoit-pierre avatar bkabrda avatar czaki avatar dholth avatar di avatar dimitripapadopoulos avatar ewouth avatar henryiii avatar hexdecimal avatar hugovk avatar jaraco avatar jdufresne avatar khorn avatar mattip avatar mayeut avatar minrk avatar msabramo avatar mwtoews avatar natefoo avatar pfmoore avatar pre-commit-ci[bot] avatar qwcode avatar rdil avatar rubik avatar techtonik avatar warsaw avatar wimglenn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wheel's Issues

A couple of small changes for wheeldemo.sh

Originally reported by: Marc Abramowitz (Bitbucket: msabramo, GitHub: msabramo)


  1. Remove the hard-coded path to file:///home/dholth/prog/wheel

  2. Add --build to pip install line so that it creates and populates build directory.

    --- a/wheeldemo.sh Wed Jul 04 21:52:49 2012 -0400
    +++ b/wheeldemo.sh Wed Jul 04 21:30:57 2012 -0700
    @@ -2,13 +2,14 @@

    bdist_wheel demo

    Create environment

    virtualenv /tmp/wheeldemo
    +SRCDIR=$(pwd)
    cd /tmp/wheeldemo

    Install wheel and patched pip, distribute

    -bin/pip install -e hg+file:///home/dholth/prog/wheel#egg=wheel -e hg+https://bitbucket.org/dholth/distribute#egg=distribute -e git+https://github.com/dholth/pip.git#egg=pip
    +bin/pip install -e $SRCDIR -e hg+https://bitbucket.org/dholth/distribute#egg=distribute -e git+https://github.com/dholth/pip.git#egg=pip

    Download an unpack a package and its dependencies into build/

    -bin/pip install --no-install pyramid
    +bin/pip install --no-install --ignore-installed --build build pyramid
    cd build

    Make wheels for each package


bdist_wheel does not use the correct newline mode for CSV files

Originally reported by: Paul Moore (Bitbucket: pmoore, GitHub: pmoore)


The CSV module specifies that open files passed to the module constructors must be opened with newline='' (Python 3) or 'b' in the mode (Python 2). The bdist_wheel command does not do this, and as a result can create corrupt CSV files with invalid line endings (most often \r\r\n). The attached patch uses the correct mode (it provides a helper function to open the file correctly whether Python 2 or 3 is being used).


Error creating a wheel on Windows

Originally reported by: Paul Moore (Bitbucket: pmoore, GitHub: pmoore)


I have a Python 3.2 virtualenv with the patched pip and distribute installed, and the wheel installation. I tried to test bdist_wheel by creating a wheel of Pygments, and I got the error

#!python

>D:\Data\Wheel\WH\Scripts\python.exe .\setup.py bdist_wheel
running bdist_wheel
running build
running build_py
installing to build\bdist.win32\wheel
running install
build\bdist.win32\wheel

Traceback (most recent call last):
  File ".\setup.py", line 87, in <module>
    **add_keywords
  File "D:\Apps\Python32\Lib\distutils\core.py", line 148, in setup
    dist.run_commands()
  File "D:\Apps\Python32\Lib\distutils\dist.py", line 917, in run_commands
    self.run_command(cmd)
  File "D:\Apps\Python32\Lib\distutils\dist.py", line 936, in run_command
    cmd_obj.run()
  File "D:\Data\Wheel\WH\lib\site-packages\wheel\bdist_wheel.py", line 147, in run
    self.run_command('install')
  File "D:\Apps\Python32\Lib\distutils\cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "D:\Apps\Python32\Lib\distutils\dist.py", line 935, in run_command
    cmd_obj.ensure_finalized()
  File "D:\Apps\Python32\Lib\distutils\cmd.py", line 107, in ensure_finalized
    self.finalize_options()
  File "D:\Data\Wheel\WH\lib\site-packages\distribute-0.6.24-py3.2.egg\setuptools\command\install.py", line 29, in final
ize_options
    _install.finalize_options(self)
  File "D:\Apps\Python32\Lib\distutils\command\install.py", line 389, in finalize_options
    'scripts', 'data', 'headers')
  File "D:\Apps\Python32\Lib\distutils\command\install.py", line 551, in change_roots
    setattr(self, attr, change_root(self.root, getattr(self, attr)))
  File "D:\Apps\Python32\Lib\distutils\util.py", line 226, in change_root
    if path[0] == '\\':
IndexError: string index out of range

I haven't been able to analyze this fully, but it looks like a case of code using POSIX-style paths on Windows. In particular, the change_root code has just done os.splitdrive on a path which, as far as I can tell, is not an absolute Windows path (i.e., it has no drive letter).

As I said, I haven't been able to fully analyze the code paths, but I would suggest looking for cases where non-absolute (or artificial) paths are passed to code expecting absolute paths.


implement digital signatures

Originally reported by: Daniel Holth (Bitbucket: dholth, GitHub: dholth)


Will be JSON JWS-JS format Ed25519 signatures against a sha-256 hash of RECORD (or another suitable manifest).

Must include sophisticated trust management e.g. normally you might trust your own key for every distribution, and trust other keys per distribution.


read from [wheel] section in setup.cfg

Originally reported by: Daniel Holth (Bitbucket: dholth, GitHub: dholth)


setup.cfg should contain a section

[wheel]
tags = ...
universal = true
?

Need to be able to generate the non-default tags:

cp32-abi3-win32

and

py2.py3-none-any

The "universal Python" tag is easier because it doesn't depend on the build platform at all, while the "uses the stable ABI" tag does.


Web server

Originally reported by: Michele Lacchia (Bitbucket: rubik, GitHub: rubik)


Where to upload wheels? I tried to upload one to PyPI and got a failure, because PyPI checks the type of the distribution and fails saying the distribution is unknown.


The setup.py file can open README and CHANGES in the wrong encoding

Originally reported by: Paul Moore (Bitbucket: pmoore, GitHub: pmoore)


The setup.py file opens README.txt and CHANGES.txt in the default encoding. On Windows under Python 3, this can fail with encoding errors, as the files are in UTF-8 but that is not the default encoding.

The attached patch explicitly uses the UTF-8 encoding. It uses the codecs module for backward compatibility.


Unhelpful error message when archive name does not match egg-info

Originally reported by: Paul Moore (Bitbucket: pmoore, GitHub: pmoore)


The distribution name used to locate the egg-info file is taken from the archive (bdist_wininst or egg) name, using the standard egg/wininst naming conventions. However, it is possible for the archive to be named differently (presumably as a result of renaming, although the file naming conventions for wininst files are not formalised, so there may be other reasons for this to happen - evidence suggests that underscores in distribution names may be an issue).

In this case, the error message produced by bdist_wheel is an uninformative IO error, because the expected PKG-INFO file does not exist.

The attached patch offers a better error message, reporting both the expected filename and what was found. The user can then rename the archive as needed.

(A better solution may be to treat the egg-info file within the archive as definitive, rather than the archive name, but that would need a more extensive refactoring of the code, and may not even be practical).


bdist_wheel stopped working

Originally reported by: Michele Lacchia (Bitbucket: rubik, GitHub: rubik)


bdist_wheel}}} stopped working. I tried building with both my fork and yours and the result is the same:
{{{bdist_wheel

#!bash

error: dist/pyg-0.7.1-py27-noabi-noarch.whl: No such file or directory

On the other hand, the PyPI copy was fully working. I then tracked down the cause and discovered that the error is due to this line:

#!python

wheel_name = archive_wheelfile(pseudoinstall_root,
                                       archive_root)

By replacing it with these two lines (as in PyPI copy):

#!python

filename = self.make_archive(pseudoinstall_root, self.format,
                                                root_dir=archive_root)
wheel_name = filename[:-3] + 'whl'

everything works again. So now we can either restore the original code or try to detect the error in archive_wheelfile.
May I ask why that line has been changed?


wininst2wheel should get metadata from installer filename and egg-info

Originally reported by: Paul Moore (Bitbucket: pmoore, GitHub: pmoore)


The wininst2wheel command currently gets metadata from the installer filename. However, that filename could be wrong (as it is OK to rename the installer without affecting its operation). In this case, the wininst2wheel command fails because it cannot locate the egg-info file embedded in the installer archive.

To avoid this issue, the attached patch inspects both the installer filename and the egg-info filename. It chooses the name, version, pyversion and architecture metadata values based on the "best" of the 2 sources (see the parse_info function and its docstring for details).


Add pluggable wheel_finder mechanism to the wheel installer

Originally reported by: Daniel Holth (Bitbucket: dholth, GitHub: dholth)


The wheel installer knows how to find wheels from a directory on the file system. That is perfect for a simplest-thing-that-could-work solution like wheel, but it would also be nice to be able to get wheels from a package index.

Define an entry point

[wheel_finder]
unimportant_name = module.name:callable

The wheel_finder's job is to convert a list of requirements (with environment markers? or without??) into a list of wheels, or the URL of a wheel, or dump those into a directory full of wheels (pick one; which is easiest?)

The example wheel finder will invoke pip with the list of requirements, pip will either download wheels from pypi or convert sdists to wheels, and wheel can install them. The example might need to go into a different pypi package.

It is a little bit tricky to define the correct plugin point for getting the wheels we would like to install. wheel-from-packagename is the simplest, but builders like pip have a ton of options regarding which indexes to search etc. (thank goodness for environment variables; perhaps the finder could expose its options on our command line too). It is possible that this kind of abstraction would be limiting, but it is simple and would certainly work most of the time.

It would also be possible to behave like make and define an entire pipeline of installer plugins:

detect whether a URL is a supported package type

find package URL

build package (adapt sdists to wheel, adapt wininst to wheel, adapt egg to wheel)

... and even install package, in case someone prefers to install wheels differently.

This kind of abstraction, with configurable plugins and a fixed pipeline structure, runs the risk of confusing everyone, or creating a "knobs with knobs" interface where you have to write a plugin for the plugin to make it work.

You could implement the second pipelined-package-discovery design on top of the wheel-from-packagename design, so we'd best try the simple idea first.


Install wheel with its own wheel

Originally reported by: Daniel Holth (Bitbucket: dholth, GitHub: dholth)


python wheel-0.9.4-py27-none-any.whl/wheel install wheel-0.9.4-py27-none-any.whl should work.

It works on Linux with the latest unreleased code, but has trouble on Windows.

May need to include pkg_resources.py (packaging database implemementation) for bootstrapping.


delete namespace __init__.py based on declared namespaces

Originally reported by: Daniel Holth (Bitbucket: dholth, GitHub: dholth)


If a namespace has been declared with setuptools and we are using Python 3.3+, we should be able to delete init.py. This would be an installer feature.

Pretty much all the init.py get imported when pkg_resources builds the index of all the installed packages, which it does while it is being imported.

Deleting namespace init.py in Python 3.3+ removes a common use of pkg_resources that causes an unnecessary dependency on pkg_resources.


vendorize pkg_resources

Originally reported by: Daniel Holth (Bitbucket: dholth, GitHub: dholth)


It's a little bit annoying that the wheel still requires pkg_resources to run, in case you don't have it installed yet.

Instead, wheel should include wheel/pkg_resources/... and only use it if the system pkg_resources is not available (or is too old -- does not contain DistInfoDistribution). Then you can use wheel to install distribute.

We will need a script only included in the sdist to update pkg_resources from the latest release of distribute. We will need to include two copies, one with 2to3 already run.

pkg_resources may need a couple of small patches to import _markerlib (used for .dist-info conditional dependencies only) from .. instead of from the top level.


e-mail read/write needs improvement in Python 3

Originally reported by: Daniel Holth (Bitbucket: dholth, GitHub: dholth)


Wheel's own README.txt, which winds up in METADATA via PKG-INFO, contains Unicode. When running bdist_wheel on wheel, this fails with a 'cannot encode to ascii' error:

pkg_info = Parser().parse(open(pkginfo_path, 'r'))
Generator(metadata, maxheaderlen=0).flatten(pkg_info)

Seems to be pretty much why policy= was introduced for e-mail in Python 3.3, but we would like to support older versions too.


implement wheel ranking algorithm

Originally reported by: Daniel Holth (Bitbucket: dholth, GitHub: dholth)


An important part of wheel is to prefer

somepackage-1.0-cp27-noabi-linux_x86_64.whl

to somepackage-1.0-py27-noabi-noarch.whl

when you are running CPython 2.7 on linux_x86_64. This will work by looking up the compatibility tuple (impl, abi, arch) -> ranking and sorting by ranking. An installer will rank each of the (python impl, abi, architecture) triples it supports, rank all the wheels of the desired package version, and install the most highly ranked one.


{{{bdist_wheel}}} stopped working

Originally reported by: Michele Lacchia (Bitbucket: rubik, GitHub: rubik)


bdist_wheel}}} stopped working. I tried building with both my fork and yours and the result is the same:
{{{bdist_wheel

#!bash

error: dist/pyg-0.7.1-py27-noabi-noarch.whl: No such file or directory

On the other hand, the PyPI copy was fully working. I then tracked down the cause and discovered that the error is due to this line:

 #! python

wheel_name = archive_wheelfile(pseudoinstall_root,
                                       archive_root)

By replacing it with these two lines (as in PyPI copy):

#!python

filename = self.make_archive(pseudoinstall_root, self.format,
                                                root_dir=archive_root)
wheel_name = filename[:-3] + 'whl'

everything works again. So now we can either restore the original code or try to detect the error in archive_wheelfile.
May I ask why that line has been changed?


bdist_wininst2wheel does not handle wininst files with "PLATLIB/" entry correctly

Originally reported by: Paul Moore (Bitbucket: pmoore, GitHub: pmoore)


It is valid in a zip file for directory entries to occur. So, for example, a bdist_wininxt file can contain either of the following two layouts:

PLATLIB/xxx
PLATLIB/yyy

or

PLATLIB/
PLATLIB/xxx
PLATLIB/yyy

The latter only differs in having an (unnecessary) entry for the PLATLIB directory itself.

The code in bdist_wininst2wheel around line 37 manipulates the ZipFile internals to rename the files in the zipfile to remove the PLATLIB (or whatever) prefix. Unfortunately, in doing this, it converts the "PLATLIB/" entry to have a 0-length name. This is not valid, and the extractall method fails (with an "index out of range" error as a result.

This problem actually occurs, in the scipy installer distributed by Christoph Gohlke.

The attached patch fixes this by creating an explicit list of members to extract and ignoring empty items.

(Note that hacking the internals of a ZipFile object like the original code does is not documented, and so is probably very fragile, but I cannot see an easy way of achieving the same result using documented methods...)


{{{bdist_wheel}}} stopped working

Originally reported by: Michele Lacchia (Bitbucket: rubik, GitHub: rubik)


bdist_wheel}}} stopped working. I tried building with both my fork and yours and the result is the same:
{{{bdist_wheel

#!bash

error: dist/pyg-0.7.1-py27-noabi-noarch.whl: No such file or directory

On the other hand, the PyPI copy was fully working. I then tracked down the cause and discovered that the error is due to this line:

 #! python

wheel_name = archive_wheelfile(pseudoinstall_root,
                                       archive_root)

By replacing it with these two lines (as in PyPI copy):

#!python

filename = self.make_archive(pseudoinstall_root, self.format,
                                                root_dir=archive_root)
wheel_name = filename[:-3] + 'whl'

everything works again. So now we can either restore the original code or try to detect the error in archive_wheelfile.
May I ask why that line has been changed?


Running wheel tool fails with ImportError

Originally reported by: Andrii Mishkovskyi (Bitbucket: mishok13, GitHub: mishok13)


I've been playing with wheel recently and decided to try out the wheel command, but it gives the following error:

$ wheel install
Traceback (most recent call last):
  File "/usr/local/bin/wheel", line 9, in <module>
    load_entry_point('wheel==0.9.3', 'console_scripts', 'wheel')()
  File "/Library/Python/2.7/site-packages/wheel/__main__.py", line 6, in main
    import wheel.tool
  File "/Library/Python/2.7/site-packages/wheel/tool/__init__.py", line 9, in <module>
    import wheel.install
  File "/Library/Python/2.7/site-packages/wheel/install.py", line 22, in <module>
    from wheel import signatures
ImportError: cannot import name signatures

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.