diff options
| author | Yen Chi Hsuan <yan12125@gmail.com> | 2016-04-09 14:08:13 +0800 | 
|---|---|---|
| committer | Yen Chi Hsuan <yan12125@gmail.com> | 2016-04-09 14:08:13 +0800 | 
| commit | 680efb67238b7c1cb4ea0af07c3749d909b1dcc6 (patch) | |
| tree | 85c34ce77807a6abcd5aed0a3707be52b7a2aba5 /setup.py | |
| parent | 568d2f78d635c3993e95334b9f8f6d2b47ecee51 (diff) | |
| parent | 5a9858bfa9aba01c9dec549b83f5a0b17a520f13 (diff) | |
Merge pull request #8497 from jaimeMF/lazy-load
Add experimenta lazy loading of info extractors
Diffstat (limited to 'setup.py')
| -rw-r--r-- | setup.py | 22 | 
1 files changed, 20 insertions, 2 deletions
| @@ -8,11 +8,12 @@ import warnings  import sys  try: -    from setuptools import setup +    from setuptools import setup, Command      setuptools_available = True  except ImportError: -    from distutils.core import setup +    from distutils.core import setup, Command      setuptools_available = False +from distutils.spawn import spawn  try:      # This will create an exe that needs Microsoft Visual C++ 2008 @@ -70,6 +71,22 @@ else:      else:          params['scripts'] = ['bin/youtube-dl'] +class build_lazy_extractors(Command): +    description = "Build the extractor lazy loading module" +    user_options = [] + +    def initialize_options(self): +        pass + +    def finalize_options(self): +        pass + +    def run(self): +        spawn( +            [sys.executable, 'devscripts/make_lazy_extractors.py', 'youtube_dl/extractor/lazy_extractors.py'], +            dry_run=self.dry_run, +        ) +  # Get the version from youtube_dl/version.py without importing the package  exec(compile(open('youtube_dl/version.py').read(),               'youtube_dl/version.py', 'exec')) @@ -107,5 +124,6 @@ setup(          "Programming Language :: Python :: 3.4",      ], +    cmdclass={'build_lazy_extractors': build_lazy_extractors},      **params  ) | 
