Skip to content

Commit

Permalink
libtbx_refresh runs with setuptools in "legacy_editable" mode (#802)
Browse files Browse the repository at this point in the history
Co-authored-by: Billy Poon <bkpoon@lbl.gov>
Co-authored-by: Aaron Brewster <asbrewster@lbl.gov>
  • Loading branch information
3 people authored and Trzs committed Oct 27, 2022
1 parent 6b87a22 commit 20c7041
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions libtbx/env_config.py
Expand Up @@ -2260,8 +2260,21 @@ def refresh(self):

for path in self.pythonpath:
sys.path.insert(0, abs(path))

# Some libtbx_refresh scripts do a `pip install --editable`. The default
# behavior was changed in setuptools 64 and currently we expect the old
# behavior. See: https://github.com/pypa/setuptools/pull/3265
sef_previous = os.environ.get('SETUPTOOLS_ENABLE_FEATURES')
os.environ['SETUPTOOLS_ENABLE_FEATURES'] = 'legacy_editable'

for module in self.module_list:
module.process_libtbx_refresh_py()

if sef_previous is not None:
os.environ['SETUPTOOLS_ENABLE_FEATURES'] = sef_previous
else:
os.environ.pop('SETUPTOOLS_ENABLE_FEATURES')

self.write_python_and_show_path_duplicates()
self.generate_entry_point_dispatchers()
self.process_exe()
Expand Down

0 comments on commit 20c7041

Please sign in to comment.