Skip to content

Commit deef76b

Browse files
Merge branch 'master' into pass-ENV-pythonpaths-to-pip
2 parents 6ae163c + 73b43e4 commit deef76b

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

__init__.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
12
bl_info = {
2-
"name": "Python Module Manager",
3+
"name": "Python Module Manager (PIP)",
34
"author": "ambi",
45
"version": (1, 0, 6),
56
"blender": (2, 80, 0),
@@ -14,13 +15,13 @@
1415

1516
__version__ = ".".join(map(str, bl_info["version"]))
1617

18+
1719
import sys
1820
import subprocess
1921
import bpy
2022
from pathlib import Path
2123
import os
2224

23-
MODULES_FOLDER = Path(bpy.utils.user_resource("SCRIPTS")) / "modules"
2425

2526
if bpy.app.version < (2, 91, 0):
2627
python_bin = bpy.app.binary_path_python
@@ -100,12 +101,12 @@ class PMM_OT_PIPInstall(bpy.types.Operator):
100101
bl_description = "Install PIP packages"
101102

102103
def execute(self, context):
103-
chosen_path = "--user" if bpy.context.scene.pip_user_flag else None
104104
run_pip_command(
105105
self,
106106
"install",
107107
*bpy.context.scene.pip_module_name.split(" "),
108-
chosen_path,
108+
"--target",
109+
Path(bpy.utils.script_path_user()) / "addons/modules",
109110
)
110111
return {"FINISHED"}
111112

@@ -169,9 +170,6 @@ class PMM_AddonPreferences(bpy.types.AddonPreferences):
169170
def draw(self, context):
170171
layout = self.layout
171172
row = layout.row()
172-
row.prop(bpy.context.scene, "pip_user_flag", text="As local user")
173-
# TODO: implement storing Python modules into Blender module home
174-
# row.prop(bpy.context.scene, "pip_modules_home", text="Use Blender modules location")
175173

176174
row = layout.row()
177175
row.operator(PMM_OT_EnsurePIP.bl_idname, text="Ensure PIP")
@@ -227,7 +225,6 @@ def register():
227225
bpy.utils.register_class(c)
228226

229227
bpy.types.Scene.pip_modules_home = bpy.props.BoolProperty(default=False)
230-
bpy.types.Scene.pip_user_flag = bpy.props.BoolProperty(default=True)
231228
bpy.types.Scene.pip_advanced_toggle = bpy.props.BoolProperty(default=False)
232229
bpy.types.Scene.pip_module_name = bpy.props.StringProperty()
233230

@@ -237,6 +234,5 @@ def unregister():
237234
bpy.utils.unregister_class(c)
238235

239236
del bpy.types.Scene.pip_modules_home
240-
del bpy.types.Scene.pip_user_flag
241237
del bpy.types.Scene.pip_advanced_toggle
242238
del bpy.types.Scene.pip_module_name

init_utils.bat

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)