Permalink
Browse files

Lint the python code in packaging

  • Loading branch information...
ark3 committed Aug 30, 2018
1 parent c569861 commit d61fec355e3995f6d35e4b4a6774101b9e1aa06b
Showing with 20 additions and 22 deletions.
  1. +5 −4 build
  2. +8 −8 packaging/build-sshuttle.py
  3. +5 −7 packaging/build-telepresence.py
  4. +2 −3 packaging/deploy.py
View
9 build
@@ -335,18 +335,19 @@ def _license_check():
def _lint():
_license_check()
_virtualenv("yapf", "-dr", "telepresence", "build")
_virtualenv("yapf", "-dr", "telepresence", "build", "packaging")
_virtualenv(
"flake8", "--isolated", "local-docker", "k8s-proxy", "telepresence",
"build", "setup.py"
"build", "setup.py", "packaging"
)
packaging = [str(path) for path in Path("packaging").glob("*.py")]
_virtualenv(
"pylint", "-f", "parseable", "-E", "local-docker", "k8s-proxy",
"telepresence", "build", "setup.py"
"telepresence", "build", "setup.py", *packaging
)
_virtualenv(
"mypy", "--strict-optional", "telepresence",
"local-docker/entrypoint.py", "build"
"local-docker/entrypoint.py", "build", *packaging
)
# Couldn't figure out how to make this work well, so it's not very useful
# cause of the skip:
@@ -2,7 +2,9 @@
"""
Create a standalone sshuttle.
We use a particular commit off of upstream master since at the moment there is no release with the feature we want (as of July 18, 2017). Once a new release is made we can pin that.
We use a particular commit off of upstream master since at the moment there is
no release with the feature we want (as of July 18, 2017). Once a new release
is made we can pin that.
For now we have a fork with a branch; hope is to upstream our changes
eventually.
@@ -54,11 +56,13 @@ def build_sshuttle(output: Path):
print("Built {}".format(output))
def main(output):
def main():
"""
Set things up then call the code that builds the executable.
"""
if output is None:
if len(sys.argv) > 1:
output = Path(sys.argv[1])
else:
project = Path(__file__).absolute().resolve().parent.parent
output = project / "dist" / "sshuttle-telepresence"
@@ -70,8 +74,4 @@ def main(output):
if __name__ == "__main__":
if len(sys.argv) > 1:
_output = Path(sys.argv[1])
else:
_output = None
main(_output)
main()
@@ -51,13 +51,15 @@ def build_telepresence(project: Path, output: Path):
print("Built {}".format(output))
def main(output):
def main():
"""
Set things up then call the code that builds the executable.
"""
project = Path(__file__).absolute().resolve().parent.parent
if output is None:
if len(sys.argv) > 1:
output = Path(sys.argv[1])
else:
version_bytes = check_output(
["python3", "-Wignore", "setup.py", "--version"],
cwd=str(project),
@@ -74,8 +76,4 @@ def main(output):
if __name__ == "__main__":
if len(sys.argv) > 1:
_output = Path(sys.argv[1])
else:
_output = None
main(_output)
main()
View
@@ -33,9 +33,8 @@
def get_version():
"""Retrieve the current version number in the standard Python way"""
version_bytes = subprocess.check_output(
["python3", "-Wignore", "setup.py", "--version"], cwd=str(PROJECT)
)
cmd = ["python3", "-Wignore", "setup.py", "--version"]
version_bytes = subprocess.check_output(cmd, cwd=str(PROJECT))
version = str(version_bytes, "utf-8").strip()
return version

0 comments on commit d61fec3

Please sign in to comment.