Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 24 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,24 @@
from setuptools.command.develop import develop
import logging

# Setupstools >=64
try:
from setuptools.command.editable_wheel import editable_wheel
except ImportError:
editable_wheel_command = None
else:
from wheel.wheelfile import WheelFile

class editable_wheel_command(editable_wheel):
"""Custom editable_wheel command which installs the .pth file to the
wheel file for editable installs."""
def _create_wheel_file(self, bdist_wheel):
wheel_path = super()._create_wheel_file(bdist_wheel)
with WheelFile(wheel_path, 'a') as wheel:
wheel.write("labscript-suite.pth")


# Setuptools <= 63:
class develop_command(develop):
"""Custom develop command which installs the .pth file to site-packages for editable
installs."""
Expand All @@ -21,4 +38,10 @@ def run(self):
"local_scheme": os.getenv("SCM_LOCAL_SCHEME", "node-and-date"),
}

setup(use_scm_version=VERSION_SCHEME, cmdclass={'develop': develop_command})
setup(
use_scm_version=VERSION_SCHEME,
cmdclass={
'develop': develop_command,
'editable_wheel': editable_wheel_command,
},
)