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

Adding a setup.py to allow to install youtube-dl as a python package #412

Closed
wants to merge 2 commits into from
Closed

Conversation

gawel
Copy link

@gawel gawel commented Aug 30, 2012

Eg with pip install -e giturl#egg=youtube-dl

@phihag
Copy link
Contributor

phihag commented Sep 27, 2012

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'
Copy link
Collaborator

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?

Copy link
Contributor

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.

Copy link
Author

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

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@FiloSottile
Copy link
Collaborator

Anyway, liking this SO much. How we get into pip (noob question, I know)?

@phihag
Copy link
Contributor

phihag commented Sep 27, 2012

pip and setuptools use the repository at pypi.python.org. I'll look into this this weekend.

@ghost ghost assigned phihag Sep 27, 2012
@gawel
Copy link
Author

gawel commented Sep 28, 2012

pip/setuptools are able to use a github repository: http://www.pip-installer.org/en/latest/usage.html#version-control-systems

@gcmalloc
Copy link
Contributor

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.

@gcmalloc
Copy link
Contributor

gcmalloc commented Oct 3, 2012

basically the actual build_exe.py should be renamed to setup.py, that would be standard. Then you can simply install by typing
sudo python2.7 setup.py install

@FiloSottile
Copy link
Collaborator

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 setup.py. I am for keeping two separate files.

@gcmalloc
Copy link
Contributor

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
pip install .
in the working directory. Another point is that the files would list the same content, all the dependencies needed by the module.

@egerlach
Copy link

Just wanted to add that this patch (still) works as advertised.

@gcmalloc gcmalloc mentioned this pull request Nov 27, 2012
""",
packages=find_packages(exclude=['test']),
include_package_data=True,
zip_safe=False,
Copy link
Contributor

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?

Copy link
Author

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.

@FiloSottile
Copy link
Collaborator

Please pause this, it will come with
https://github.com/FiloSottile/youtube-dl/wiki/New-building-system-blueprint

@phihag
Copy link
Contributor

phihag commented Nov 28, 2012

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!

@phihag phihag closed this Nov 28, 2012
joedborg referenced this pull request in joedborg/youtube-dl Nov 17, 2020
[pull] master from ytdl-org:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants