Skip to content

Commit

Permalink
不在下载依赖
Browse files Browse the repository at this point in the history
  • Loading branch information
lilingfengdev committed May 5, 2024
1 parent 2603a69 commit f8f1a11
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 40 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
python-version: "3.8"
architecture: 'x86'
- name: Install Dependencies
run: pip install pyinstaller pyarmor
run: pip install pyyaml install-jdk psutil pyinstaller pyarmor
- name: Generate Bundle
run: |
python generate-bundle.py
Expand Down
6 changes: 1 addition & 5 deletions generate-script.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
from textwrap import dedent as _
from utils import *
from psutil import virtual_memory

try:
from psutil import virtual_memory
except ModuleNotFoundError:
install_package("psutil")
from psutil import virtual_memory

script_license()
print("此向导将会自动为你生成启动脚本!")
Expand Down
7 changes: 1 addition & 6 deletions install-java.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
from utils import *

try:
import jdk
except ModuleNotFoundError:
install_package("jdk")
import jdk
import jdk
import os, ctypes

script_license()
Expand Down
34 changes: 6 additions & 28 deletions utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
import sys, os
import yaml

try:
from yaml import CLoader as Loader, CDumper as Dumper
except ImportError:
from yaml import Loader, Dumper


def script_license():
Expand All @@ -8,34 +14,6 @@ def script_license():
print("未经许可,禁止用于商业用途")


def install_package(name):
print(f"{name}尚未安装,开始自动安装")
from pip._internal.cli.main import main as _main

try:
_main(["install", name, "-i", "https://pypi.tuna.tsinghua.edu.cn/simple"])
except:
print("安装失败!")
exit_()


try:
import yaml

try:
from yaml import CLoader as Loader, CDumper as Dumper
except ImportError:
from yaml import Loader, Dumper
except ModuleNotFoundError:
install_package("pyyaml")
import yaml

try:
from yaml import CLoader as Loader, CDumper as Dumper
except ImportError:
from yaml import Loader, Dumper


def handler(filename):
def a(func):
def b():
Expand Down

0 comments on commit f8f1a11

Please sign in to comment.