This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ronaldoussoren
Recipients eric.snow, ned.deily, pablogsal, ronaldoussoren, steve.dower, vinay.sajip
Date 2022-03-07.13:17:13
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1646659033.13.0.974701414557.issue46890@roundup.psfhosted.org>
In-reply-to
Content
I'm now in the fun position where the code works, but the test test_getpath.py fails.

The test case below tries to test a venv in a framework build, but somehow fails to calculate prefix and exec_prefix correctly.  The calculation does work when using a framework build with my patch...


    def test_venv_framework_macos(self):
        """Test a venv layout on macOS using a framework build
        """
        venv_path = "/tmp/workdir/venv"
        ns = MockPosixNamespace(
            os_name="darwin",
            argv0="/Library/Frameworks/Python.framework/Versions/9.8/Resources/Python.app/Contents/MacOS/Python",
            WITH_NEXT_FRAMEWORK=1,
            PREFIX="/Library/Frameworks/Python.framework/Versions/9.8",
            EXEC_PREFIX="/Library/Frameworks/Python.framework/Versions/9.8",
            ENV___PYVENV_LAUNCHER__=f"{venv_path}/bin/python",
            real_executable="/Library/Frameworks/Python.framework/Versions/9.8/Resources/Python.app/Contents/MacOS/Python",
            library="/Library/Frameworks/Python.framework/Versions/9.8/Python",
        )
        ns.add_known_dir(venv_path)
        ns.add_known_xfile(f"{venv_path}/bin/python")
        ns.add_known_dir(f"{venv_path}/lib/python9.8")
        ns.add_known_xfile("/Library/Frameworks/Python.framework/Versions/9.8/Resources/Python.app/Contents/MacOS/Python")
        ns.add_known_xfile("/Library/Frameworks/Python.framework/Versions/9.8/bin/python9.8")
        ns.add_known_dir("/Library/Frameworks/Python.framework/Versions/9.8/lib/python9.8/lib-dynload")
        ns.add_known_xfile("/Library/Frameworks/Python.framework/Versions/9.8/lib/python9.8/os.py")
        ns.add_known_file(f"{venv_path}/pyvenv.cfg", [
            "home = /Library/Frameworks/Python.framework/Versions/9.8/bin"
        ])
        expected = dict(
            executable=f"{venv_path}/bin/python",
            prefix=venv_path,
            exec_prefix=venv_path,
            base_executable="/Library/Frameworks/Python.framework/Versions/9.8/bin/python9.8",
            base_prefix="/Library/Frameworks/Python.framework/Versions/9.8",
            base_exec_prefix="/Library/Frameworks/Python.framework/Versions/9.8",
            module_search_paths_set=1,
            module_search_paths=[
                "/Library/Frameworks/Python.framework/Versions/9.8/lib/python98.zip",
                "/Library/Frameworks/Python.framework/Versions/9.8/lib/python9.8",
                "/Library/Frameworks/Python.framework/Versions/9.8/lib/python9.8/lib-dynload",
            ],
        )
        actual = getpath(ns, expected)
        self.assertEqual(expected, actual)
History
Date User Action Args
2022-03-07 13:17:13ronaldoussorensetrecipients: + ronaldoussoren, vinay.sajip, ned.deily, eric.snow, steve.dower, pablogsal
2022-03-07 13:17:13ronaldoussorensetmessageid: <1646659033.13.0.974701414557.issue46890@roundup.psfhosted.org>
2022-03-07 13:17:13ronaldoussorenlinkissue46890 messages
2022-03-07 13:17:13ronaldoussorencreate