-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
Adding a setup.py to allow to install youtube-dl as a python package #412
Conversation
I'm a little bit confused about the version part. Shouldn't that be the current version? It would be great if we could generate setup.py (with the correct version) from the Makefile. |
from setuptools import setup | ||
from setuptools import find_packages | ||
|
||
version = '1.3.6' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would replace with a
import youtube_dl
version = youtube_dl.__version__
This would work, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure, setup.py may need to be standalone. I'm looking into it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, importing the software you're trying to install is a bad idea
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a solution on stack overflow actually :
http://stackoverflow.com/questions/2058802/how-can-i-get-the-version-defined-in-setup-py-setuptools-in-my-package
Anyway, liking this SO much. How we get into |
pip and setuptools use the repository at pypi.python.org. I'll look into this this weekend. |
pip/setuptools are able to use a github repository: http://www.pip-installer.org/en/latest/usage.html#version-control-systems |
You can also build the youtube-dl executable for the windows system from the setup.py. it's the pythonic approach to the makefile, which is a more general approach. the setup.py will also take care of the depencies of the project. For example, https://github.com/gcmalloc/epfl-menu which need beautifulSoup as dependency, will simply get installed with python setup.py install. |
basically the actual build_exe.py should be renamed to setup.py, that would be standard. Then you can simply install by typing |
Yeah, I know but I preferred to name it differently as py2exe gets quite invasive and I didn't think it could do well as a clean |
I can build youtube-dl from the actual build_exe.py. I just added a try catch around the py2exe module, as it cannot be imported on linux. The rest is working fine. moving this file to a setup.py would be the proper python packaging. This would fix Issue #460. You could then simply build with |
Just wanted to add that this patch (still) works as advertised. |
""", | ||
packages=find_packages(exclude=['test']), | ||
include_package_data=True, | ||
zip_safe=False, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One more question: Why is zip_safe
set?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
zipe_safe is used by setuptools. If set to True it will generate a zipped egg archive at install time. Sometime it sucks so I'm used to set it to False to avoid some problems.
Please pause this, it will come with |
Closing, but not because it's not a good idea, but because as @FiloSottile said, these changes will be integrated into the new building system. Thanks for your contribution! |
[pull] master from ytdl-org:master
Eg with pip install -e giturl#egg=youtube-dl