Skip to content

Commit 2c5f822

Browse files
committed
Fix pip install -e for newer setuptools
- There's a new editable_wheel command that replaced develop, and it broke my workflow. It's still brittle, but hopefully we can get rid of setuptools soon
1 parent 7a16645 commit 2c5f822

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
from os.path import abspath
2+
from setuptools.command.editable_wheel import editable_wheel
3+
4+
5+
class EditableWheel(editable_wheel):
6+
def run(self):
7+
# you aren't supposed to do this, but... they broke my workflow
8+
self.distribution.rpybuild_develop_path = abspath(self.project_dir)
9+
editable_wheel.run(self)

robotpy_build/setup.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ def finalize_options(self):
2424
from .command.build_pyi import BuildPyi
2525
from .command.develop import Develop
2626

27+
try:
28+
from .command.editable_wheel import EditableWheel
29+
except ImportError:
30+
EditableWheel = None # type: ignore
31+
2732
from .config.pyproject_toml import RobotpyBuildConfig
2833

2934
from .maven import convert_maven_to_downloads
@@ -139,6 +144,8 @@ def prepare(self):
139144
"build_pyi": BuildPyi,
140145
"develop": Develop,
141146
}
147+
if EditableWheel:
148+
self.setup_kwargs["cmdclass"]["editable_wheel"] = EditableWheel
142149
if bdist_wheel:
143150
self.setup_kwargs["cmdclass"]["bdist_wheel"] = bdist_wheel
144151
for cls in self.setup_kwargs["cmdclass"].values():

0 commit comments

Comments
 (0)