File tree Expand file tree Collapse file tree 1 file changed +25
-1
lines changed Expand file tree Collapse file tree 1 file changed +25
-1
lines changed Original file line number Diff line number Diff line change 3
3
from setuptools .command .develop import develop
4
4
import logging
5
5
6
+ # Setupstools >=64
7
+ try :
8
+ from setuptools .command .editable_wheel import editable_wheel
9
+ except ImportError :
10
+ editable_wheel_command = None
11
+ else :
12
+ from wheel .wheelfile import WheelFile
6
13
14
+ class editable_wheel_command (editable_wheel ):
15
+ """Custom editable_wheel command which installs the .pth file to the
16
+ wheel file for editable installs."""
17
+ def _create_wheel_file (self , bdist_wheel ):
18
+ wheel_path = super ()._create_wheel_file (bdist_wheel )
19
+ with WheelFile (wheel_path , 'a' ) as wheel :
20
+ wheel .write ("labscript-suite.pth" )
21
+ return wheel_path
22
+
23
+
24
+ # Setuptools <= 63:
7
25
class develop_command (develop ):
8
26
"""Custom develop command which installs the .pth file to site-packages for editable
9
27
installs."""
@@ -21,4 +39,10 @@ def run(self):
21
39
"local_scheme" : os .getenv ("SCM_LOCAL_SCHEME" , "node-and-date" ),
22
40
}
23
41
24
- setup (use_scm_version = VERSION_SCHEME , cmdclass = {'develop' : develop_command })
42
+ setup (
43
+ use_scm_version = VERSION_SCHEME ,
44
+ cmdclass = {
45
+ 'develop' : develop_command ,
46
+ 'editable_wheel' : editable_wheel_command ,
47
+ },
48
+ )
You can’t perform that action at this time.
0 commit comments