Drop the pip command from pkgutils.py
This commit is contained in:
+1
-41
@@ -29,7 +29,6 @@ from __future__ import annotations
|
|||||||
import argparse
|
import argparse
|
||||||
import datetime
|
import datetime
|
||||||
import shutil
|
import shutil
|
||||||
import subprocess
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
import utils.assets
|
import utils.assets
|
||||||
@@ -55,33 +54,6 @@ def printVersion(args: argparse.Namespace) -> None:
|
|||||||
print(extractVersion(beQuiet=True)[0], end=None)
|
print(extractVersion(beQuiet=True)[0], end=None)
|
||||||
|
|
||||||
|
|
||||||
def installPackages(args: argparse.Namespace) -> None:
|
|
||||||
"""Install package dependencies both for this script and for running
|
|
||||||
novelWriter itself.
|
|
||||||
"""
|
|
||||||
print("")
|
|
||||||
print("Installing Dependencies")
|
|
||||||
print("=======================")
|
|
||||||
print("")
|
|
||||||
|
|
||||||
installQueue = ["pip", *extractReqs(["app"])]
|
|
||||||
if args.mac:
|
|
||||||
installQueue.append("pyobjc")
|
|
||||||
elif args.win:
|
|
||||||
installQueue.append("pywin32")
|
|
||||||
|
|
||||||
pyCmd = [sys.executable, "-m"]
|
|
||||||
pipCmd = ["pip", "install", "--user", "--upgrade"]
|
|
||||||
for stepCmd in installQueue:
|
|
||||||
pkgCmd = stepCmd.split(" ")
|
|
||||||
try:
|
|
||||||
subprocess.call(pyCmd + pipCmd + pkgCmd)
|
|
||||||
except Exception as exc:
|
|
||||||
print("Failed with error:")
|
|
||||||
print(str(exc))
|
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
|
|
||||||
def cleanBuildDirs(args: argparse.Namespace) -> None:
|
def cleanBuildDirs(args: argparse.Namespace) -> None:
|
||||||
"""Recursively delete the 'build' and 'dist' folders."""
|
"""Recursively delete the 'build' and 'dist' folders."""
|
||||||
print("")
|
print("")
|
||||||
@@ -160,18 +132,6 @@ if __name__ == "__main__":
|
|||||||
)
|
)
|
||||||
cmdVersion.set_defaults(func=printVersion)
|
cmdVersion.set_defaults(func=printVersion)
|
||||||
|
|
||||||
# General
|
|
||||||
# =======
|
|
||||||
|
|
||||||
# Pip Install
|
|
||||||
cmdPipInstall = parsers.add_parser(
|
|
||||||
"pip", help="Install all package dependencies for novelWriter using pip."
|
|
||||||
)
|
|
||||||
cmdPipInstall.add_argument("--linux", action="store_true", help="For Linux.", default=OS_LINUX)
|
|
||||||
cmdPipInstall.add_argument("--mac", action="store_true", help="For MacOS.", default=OS_DARWIN)
|
|
||||||
cmdPipInstall.add_argument("--win", action="store_true", help="For Windows.", default=OS_WIN)
|
|
||||||
cmdPipInstall.set_defaults(func=installPackages)
|
|
||||||
|
|
||||||
# Additional Builds
|
# Additional Builds
|
||||||
# =================
|
# =================
|
||||||
|
|
||||||
@@ -320,7 +280,7 @@ if __name__ == "__main__":
|
|||||||
"groups", nargs="*", help=(
|
"groups", nargs="*", help=(
|
||||||
"Groups to generate for, or 'all' to generate for all groups. "
|
"Groups to generate for, or 'all' to generate for all groups. "
|
||||||
"Use 'app' to generate for just the core application. "
|
"Use 'app' to generate for just the core application. "
|
||||||
"Defaults to app dependencies."
|
"Defaults to 'app' if none are specified."
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
cmdGenReq.set_defaults(func=genReqFiles)
|
cmdGenReq.set_defaults(func=genReqFiles)
|
||||||
|
|||||||
Reference in New Issue
Block a user