mirror of
https://github.com/pypa/pip
synced 2023-12-13 21:30:23 +01:00
The Python package installer
https://pip.pypa.io/
In our next commit we will use the scheme path to locate files to byte-compile. If the scheme path is a `Path`, then that causes `compileall.compile_file` (via `py_compile.compile`) to fail with: ``` .tox/py38/lib/python3.8/site-packages/pip/_internal/operations/install/wheel.py:615: in install_unpacked_wheel success = compileall.compile_file( ../../../.pyenv/versions/3.8.0/lib/python3.8/compileall.py:157: in compile_file ok = py_compile.compile(fullname, cfile, dfile, True, ../../../.pyenv/versions/3.8.0/lib/python3.8/py_compile.py:162: in compile bytecode = importlib._bootstrap_external._code_to_timestamp_pyc( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ code = <code object <module> at 0x7fa7e274f500, file "/tmp/user/1000/pytest-of-chris/pytest-37/test_std_install_with_direct_u0/dest/lib/sample/__init__.py", line 1>, mtime = 1593910285.2200587, source_size = 134 > ??? E ValueError: unmarshallable object ``` Debugging in gdb shows that the error is set due to the `Path` object being present in the code object, which `marshal.dumps` can't handle (frame 1): ``` 0 w_complex_object (v=<optimized out>, flag=<optimized out>, p=0x7fffffff7160) at Python/marshal.c:564 1 w_object (v=<Path at remote 0x7fffee51f120>, p=0x7fffffff7160) at Python/marshal.c:370 2 w_complex_object (v=<code at remote 0x7fffee591710>, flag=<optimized out>, p=0x7fffffff7160) at Python/marshal.c:544 3 w_object (v=<code at remote 0x7fffee591710>, p=0x7fffffff7160) at Python/marshal.c:370 4 w_complex_object (v=('1.2.0', <code at remote 0x7fffee591710>, 'main', None), flag=<optimized out>, p=0x7fffffff7160) at Python/marshal.c:475 5 w_object (v=('1.2.0', <code at remote 0x7fffee591710>, 'main', None), p=0x7fffffff7160) at Python/marshal.c:370 6 w_complex_object (v=<code at remote 0x7fffee591ea0>, flag=<optimized out>, p=0x7fffffff7160) at Python/marshal.c:539 7 w_object (p=0x7fffffff7160, v=<code at remote 0x7fffee591ea0>) at Python/marshal.c:370 8 PyMarshal_WriteObjectToString (version=<optimized out>, x=<code at remote 0x7fffee591ea0>) at Python/marshal.c:1598 9 marshal_dumps_impl (module=<optimized out>, version=<optimized out>, value=<code at remote 0x7fffee591ea0>) at Python/marshal.c:1739 10 marshal_dumps (module=<optimized out>, args=<optimized out>, nargs=<optimized out>) at Python/clinic/marshal.c.h:124 ``` In the interest of easy git bisects, we commit this fix before the code that would expose the bug. |
||
---|---|---|
.azure-pipelines | ||
.github | ||
docs | ||
news | ||
src/pip | ||
tests | ||
tools | ||
.coveragerc | ||
.gitattributes | ||
.gitignore | ||
.mailmap | ||
.pre-commit-config.yaml | ||
.readthedocs.yml | ||
.travis.yml | ||
AUTHORS.txt | ||
LICENSE.txt | ||
MANIFEST.in | ||
NEWS.rst | ||
noxfile.py | ||
pyproject.toml | ||
README.rst | ||
setup.cfg | ||
setup.py | ||
tox.ini |
pip - The Python Package Installer ================================== .. image:: https://img.shields.io/pypi/v/pip.svg :target: https://pypi.org/project/pip/ .. image:: https://readthedocs.org/projects/pip/badge/?version=latest :target: https://pip.pypa.io/en/latest pip is the `package installer`_ for Python. You can use pip to install packages from the `Python Package Index`_ and other indexes. Please take a look at our documentation for how to install and use pip: * `Installation`_ * `Usage`_ We release updates regularly, with a new version every 3 months. Find more details in our documentation: * `Release notes`_ * `Release process`_ In 2020, we're working on improvements to the heart of pip. Please `learn more and take our survey`_ to help us do it right. If you find bugs, need help, or want to talk to the developers, please use our mailing lists or chat rooms: * `Issue tracking`_ * `Discourse channel`_ * `User IRC`_ If you want to get involved head over to GitHub to get the source code, look at our development documentation and feel free to jump on the developer mailing lists and chat rooms: * `GitHub page`_ * `Development documentation`_ * `Development mailing list`_ * `Development IRC`_ Code of Conduct --------------- Everyone interacting in the pip project's codebases, issue trackers, chat rooms, and mailing lists is expected to follow the `PyPA Code of Conduct`_. .. _package installer: https://packaging.python.org/guides/tool-recommendations/ .. _Python Package Index: https://pypi.org .. _Installation: https://pip.pypa.io/en/stable/installing.html .. _Usage: https://pip.pypa.io/en/stable/ .. _Release notes: https://pip.pypa.io/en/stable/news.html .. _Release process: https://pip.pypa.io/en/latest/development/release-process/ .. _GitHub page: https://github.com/pypa/pip .. _Development documentation: https://pip.pypa.io/en/latest/development .. _learn more and take our survey: https://pyfound.blogspot.com/2020/03/new-pip-resolver-to-roll-out-this-year.html .. _Issue tracking: https://github.com/pypa/pip/issues .. _Discourse channel: https://discuss.python.org/c/packaging .. _Development mailing list: https://mail.python.org/mailman3/lists/distutils-sig.python.org/ .. _User IRC: https://webchat.freenode.net/?channels=%23pypa .. _Development IRC: https://webchat.freenode.net/?channels=%23pypa-dev .. _PyPA Code of Conduct: https://www.pypa.io/en/latest/code-of-conduct/