release: satisfy lint
This commit is contained in:
parent
538a67dc3a
commit
780ff05f12
|
@ -3,7 +3,6 @@
|
||||||
import contextlib
|
import contextlib
|
||||||
import os
|
import os
|
||||||
import platform
|
import platform
|
||||||
import re
|
|
||||||
import sys
|
import sys
|
||||||
import shutil
|
import shutil
|
||||||
import subprocess
|
import subprocess
|
||||||
|
@ -82,18 +81,6 @@ else:
|
||||||
print("BUILD VERSION=%s" % VERSION)
|
print("BUILD VERSION=%s" % VERSION)
|
||||||
|
|
||||||
|
|
||||||
def set_version(dev: bool) -> None:
|
|
||||||
"""
|
|
||||||
Update version information in mitmproxy's version.py to either include hardcoded information or not.
|
|
||||||
"""
|
|
||||||
version = get_version(dev, dev)
|
|
||||||
with open(VERSION_FILE, "r") as f:
|
|
||||||
content = f.read()
|
|
||||||
content = re.sub(r'^VERSION = ".+?"', 'VERSION = "{}"'.format(version), content, flags=re.M)
|
|
||||||
with open(VERSION_FILE, "w") as f:
|
|
||||||
f.write(content)
|
|
||||||
|
|
||||||
|
|
||||||
def archive_name(bdist: str) -> str:
|
def archive_name(bdist: str) -> str:
|
||||||
if platform.system() == "Windows":
|
if platform.system() == "Windows":
|
||||||
ext = "zip"
|
ext = "zip"
|
||||||
|
@ -139,28 +126,12 @@ def cli():
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
@cli.command("info")
|
@cli.command("info")
|
||||||
def info():
|
def info():
|
||||||
print("Version: %s" % VERSION)
|
print("Version: %s" % VERSION)
|
||||||
|
|
||||||
|
|
||||||
@cli.command("wheel")
|
|
||||||
def make_wheel():
|
|
||||||
"""
|
|
||||||
Build a Python wheel
|
|
||||||
"""
|
|
||||||
set_version(True)
|
|
||||||
try:
|
|
||||||
subprocess.check_call([
|
|
||||||
"tox", "-e", "wheel",
|
|
||||||
], env={
|
|
||||||
**os.environ,
|
|
||||||
"VERSION": VERSION,
|
|
||||||
})
|
|
||||||
finally:
|
|
||||||
set_version(False)
|
|
||||||
|
|
||||||
|
|
||||||
@cli.command("build")
|
@cli.command("build")
|
||||||
def build():
|
def build():
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in New Issue