Mercurial > public > mercurial-scm > hg-stable
changeset 52706:9ff926737dbc
setup: __modulepolicy__.py created in the source dir for editable mode
author | paugier <pierre.augier@univ-grenoble-alpes.fr> |
---|---|
date | Tue, 14 Jan 2025 15:55:16 +0100 |
parents | 38b5bf824794 |
children | 339aa82c4383 |
files | setup.py |
diffstat | 1 files changed, 8 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/setup.py Thu Jan 23 08:50:22 2025 +0100 +++ b/setup.py Tue Jan 14 15:55:16 2025 +0100 @@ -495,9 +495,6 @@ ) def run(self): - basepath = os.path.join(self.build_lib, 'mercurial') - self.mkpath(basepath) - rust = self.distribution.rust if self.distribution.pure: modulepolicy = 'py' @@ -513,6 +510,14 @@ b'modulepolicy = b"%s"\n' % modulepolicy.encode('ascii'), ] ) + + if self.editable_mode: + here = os.path.dirname(__file__) + basepath = os.path.join(here, 'mercurial') + else: + basepath = os.path.join(self.build_lib, 'mercurial') + self.mkpath(basepath) + write_if_changed(os.path.join(basepath, '__modulepolicy__.py'), content) build_py.run(self)