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

Upload a wheel to PyPI #6

Closed
wants to merge 1 commit into from
Closed

Conversation

ghickman
Copy link

You can achieve this by installing the wheel package and running python setup.py register bdist_wheel upload in your natsort directory. It can also be combined with your existing source distribution uploads like so python setup.py register sdist bdist_wheel upload.

This change makes the generated wheel compatible with both python 2 and 3.

@SethMMorton
Copy link
Owner

Done (commit f3efab7)

@ghickman
Copy link
Author

ghickman commented May 6, 2014

@SethMMorton – Thank you!

@SethMMorton
Copy link
Owner

@ghickman Can you explain the benefit of having a wheel distribution over just zip and tar.gz for a pure python module?

@ghickman
Copy link
Author

@SethMMorton – they remove the need to run a setup.py on installation (which runs two subprocesses) and this has the knock on effect of improving install time.

You can find more information here and here.

@SethMMorton
Copy link
Owner

@ghickman That's all well and good, but installing via a wheel does not install entry points, as I mention in issue #9. This is a problem, and I don't want to recommend an install method to my users that won't install all natsort components.

Is the install time of natsort so significant from source that a wheel is necessary?

@ghickman
Copy link
Author

@SethMMorton – That's odd, AFAIK entry_points shouldn't be affected by wheeling a package. I've been using wheels with one of my own apps for a while now and not seen any issues with it's entry_points (its main usage). Also pip does the same thing and rolls a wheel which correctly installs it's entry points.

re: install speed - for a single package it doesn't make a huge difference but with a reasonable sized requirements.txt it can, especially when you look at install times for projects on CI services such as Travis-CI.

@SethMMorton
Copy link
Owner

@ghickman If you install natsort from a wheel, does the entry point get installed?

About install speed, I'm sure for a large project a wheel is much better, but for natsort, where there is only 5 files and one dependency I can't imagine it makes a difference. I'm not saying the wheel format isn't good, I'm just saying that in this specific case I'm not sure it makes a difference.

@ghickman
Copy link
Author

@SethMMorton – Yes, tested with python 2.7 and 3.4.1 and running natsort foo3 foo1 produces the output foo1 foo3. What error are you seeing with the entry point/wheel combination?


Yes it won't make a noticeable difference when you're installing only natsort, however when natsort is part of said large projects dependencies then having as many of those dependencies wheeled as possible makes a huge difference. This becomes especially noticeable when installing somewhere like Travis-CI which installs a projects dependencies on every run and you end up with install times of multiple minutes for a few seconds of tests.

@SethMMorton
Copy link
Owner

Are you using virtualenv? I am not, and according to what I have seen entry points are only installed when you are in a virtualenv. Can you try in your global python environment? If a user wants to install natsort for only its shell script, I don't want to force them to use virtualenv.


I see now. You get better performance when installing dependencies when all of them are wheels.

@ghickman
Copy link
Author

Yes I am but my main python is homebrewed so not easy to check my system one. That's annoying to find out though! Have you raised an issue with pip? I guess for now you'll have to drop the wheels.

@SethMMorton
Copy link
Owner

I also use a homebrewed python, just not virtualenvs. When I install natsort via a wheel to my homebrewed python location, the entry point is not installed.

Either way, I'll still upload a wheel, but in the docs I advise against it if you want the shell script. I was hoping you knew of some secret sauce to get the entry points to work properly. :(

@ghickman
Copy link
Author

@SethMMorton – I've installed with pip 1.5.6 to a homebrewed Python 2.7.8 environment without the use of a virtualenv and the entry points script is working for me by the look of it: gist

Is there anything else I could test? Happy to help find the cause of this!

@SethMMorton
Copy link
Owner

There it is! I was still using pip 1.4.1, and you were using pip 1.5.6. When I upgraded my pip version, it worked! It seems that somewhere between these two versions, they fixed this bug.

Thanks for your help!

@ghickman
Copy link
Author

@SethMMorton Awesome! Always happy to help and thank you for putting the time into natsort.

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

Successfully merging this pull request may close these issues.

None yet

2 participants