mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2025-08-22 22:34:01 -07:00
fix flake8 issues
This commit is contained in:
parent
a883abc2f0
commit
bc512fcc1d
1 changed files with 62 additions and 58 deletions
12
build.py
12
build.py
|
@ -1,9 +1,8 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from pybuilder.core import *
|
from pybuilder.core import task, dependents, depends, use_plugin, init
|
||||||
from enum import Enum
|
from enum import Enum
|
||||||
import glob
|
import glob
|
||||||
import shutil
|
import shutil
|
||||||
import warnings
|
|
||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
|
@ -49,6 +48,7 @@ def delete(logger, path):
|
||||||
elif (os.path.isdir(path)):
|
elif (os.path.isdir(path)):
|
||||||
shutil.rmtree(path)
|
shutil.rmtree(path)
|
||||||
|
|
||||||
|
|
||||||
@task
|
@task
|
||||||
def clean(logger, project):
|
def clean(logger, project):
|
||||||
delete_patterns = [
|
delete_patterns = [
|
||||||
|
@ -103,7 +103,7 @@ def clean(logger, project):
|
||||||
|
|
||||||
|
|
||||||
@task
|
@task
|
||||||
## build for the current operating system
|
# build for the current operating system
|
||||||
def build(logger, project):
|
def build(logger, project):
|
||||||
if (project.os == OS.Linux or project.os == OS.MacOS):
|
if (project.os == OS.Linux or project.os == OS.MacOS):
|
||||||
buildUnix(logger, project)
|
buildUnix(logger, project)
|
||||||
|
@ -120,6 +120,7 @@ def mkdir_p(path):
|
||||||
except FileExistsError:
|
except FileExistsError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
@task
|
@task
|
||||||
@dependents("installUnix")
|
@dependents("installUnix")
|
||||||
def buildUnix(logger, project):
|
def buildUnix(logger, project):
|
||||||
|
@ -137,6 +138,7 @@ def buildUnix(logger, project):
|
||||||
subprocess.run("rm -rf zip", shell=True)
|
subprocess.run("rm -rf zip", shell=True)
|
||||||
subprocess.run("echo '#!/usr/bin/env python' > youtube-dl ; cat youtube-dl.zip >> youtube-dl ; rm youtube-dl.zip; chmod a+x youtube-dl", shell=True)
|
subprocess.run("echo '#!/usr/bin/env python' > youtube-dl ; cat youtube-dl.zip >> youtube-dl ; rm youtube-dl.zip; chmod a+x youtube-dl", shell=True)
|
||||||
|
|
||||||
|
|
||||||
@task
|
@task
|
||||||
@depends("buildUnix")
|
@depends("buildUnix")
|
||||||
def installUnix(logger, project):
|
def installUnix(logger, project):
|
||||||
|
@ -161,10 +163,12 @@ def installUnix(logger, project):
|
||||||
install -m 644 youtube-dl.fish {DESTDIR}{SYSCONFDIR}/fish/completions/youtube-dl.fish",
|
install -m 644 youtube-dl.fish {DESTDIR}{SYSCONFDIR}/fish/completions/youtube-dl.fish",
|
||||||
shell=True)
|
shell=True)
|
||||||
|
|
||||||
|
|
||||||
@task
|
@task
|
||||||
def buildWin32(logger, project):
|
def buildWin32(logger, project):
|
||||||
subprocess.run("python -m setup.py py2exe")
|
subprocess.run("python -m setup.py py2exe")
|
||||||
|
|
||||||
|
|
||||||
@task
|
@task
|
||||||
def offlinetest(logger, project):
|
def offlinetest(logger, project):
|
||||||
res = subprocess.run("python -m nose --verbose test \
|
res = subprocess.run("python -m nose --verbose test \
|
||||||
|
@ -180,6 +184,7 @@ def offlinetest(logger,project):
|
||||||
if (res.returncode != 0):
|
if (res.returncode != 0):
|
||||||
sys.exit(res.returncode)
|
sys.exit(res.returncode)
|
||||||
|
|
||||||
|
|
||||||
@task
|
@task
|
||||||
def test(logger, project):
|
def test(logger, project):
|
||||||
res = subprocess.run("nosetests --with-coverage \
|
res = subprocess.run("nosetests --with-coverage \
|
||||||
|
@ -190,4 +195,3 @@ def test(logger, project):
|
||||||
shell=True)
|
shell=True)
|
||||||
if (res.returncode != 0):
|
if (res.returncode != 0):
|
||||||
sys.exit(res.returncode)
|
sys.exit(res.returncode)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue