From 7ced705dcc84cd0bd8968ea2008f96303a87f93d Mon Sep 17 00:00:00 2001 From: hauntsaninja Date: Tue, 24 Jan 2023 21:24:59 -0800 Subject: Make __file__ an absolute path in setuptools.build_meta This is a difference between pip's legacy wheel build (or direct invocations of setup.py) and the PEP 517 build. While setup.py scripts that rely on this are fragile, it was quite painful to debug! Since Python 3.4, `__file__` is usually an absolute path, so this change might result in fewer surprises. --- setuptools/build_meta.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setuptools/build_meta.py b/setuptools/build_meta.py index 1fb4c3b1..618a5e8f 100644 --- a/setuptools/build_meta.py +++ b/setuptools/build_meta.py @@ -326,7 +326,7 @@ class _BuildMetaBackend(_ConfigSettingsTranslator): def run_setup(self, setup_script='setup.py'): # Note that we can reuse our build directory between calls # Correctness comes first, then optimization later - __file__ = setup_script + __file__ = os.path.abspath(setup_script) __name__ = '__main__' with _open_setup_script(__file__) as f: -- cgit v1.2.1