git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] doc: mention Python 3.x supports

From
Yang Zhao <yang.zhao@skyboxlabs.com>
Date
Dec 15, 2020, 17:54 UTC
Message-ID
<CABvFv3JjipUqchLAhyvMax=s4z3VhPyKvSAPqtbj3W4pNOmzvg@mail.gmail.com>
In-Reply-To
<X9j0pf1lQQHZifvw@danh.dev>

On Tue, Dec 15, 2020 at 9:38 AM Đoàn Trần Công Danh <congdanhqx@gmail.com> wrote:

Show 23 quoted lines
>
> > Đoàn Trần Công Danh  <congdanhqx@gmail.com> writes:
> >
> > > Commit 0b4396f068, (git-p4: make python2.7 the oldest supported version,
> > > 2019-12-13) pointed out that git-p4 uses Python 2.7-or-later features
> > > in the code.
> > >
> > > In addition, git-p4 gained enough support for Python 3 from
> > > 6cec21a82f, (git-p4: encode/decode communication with p4 for
> > > python3, 2019-12-13).
> >
> > I am not a Perforce user, so with that in mind, please help me make
> > sure I understand the situation well.  The statement "not 3.x, which
> > is not supported by Perforce" is from early 2013, and 6cec21a82f
> > talks about the format of marshalled dict object that comes out of
> > p4 (Perforce) tool that needs to be read in a certain way to be
> > compatible with Python3.  Does that mean sometime in these 6 years,
> > Perforce started supporting 3.x?
>
> AFAIK, p4 is an executable binary (in the sense of ELF binaries) from
> forever. And its {in,out}put is in arbitrary encoding, while Python 3
> expects UCS-2 or UCS-4 encoding. 6cec21a82f adds code to decode to
> Python 3 string to overcome this limitation.
Caveat: I am relying on memory here. I haven't looked at this code
since my last round of PRs...

Yes, git-p4 use the p4 executable, and not an integration library. p4 has a "serialize for Python" mode which outputs in a python2.7 pickled format, which is still supported by python3, and this is what is used to receive data from the app.

> Not related, but Perforce's official Python bindings supports Python 3
> from at least 2013 [p4r13]. And they still maintain in [PyPI].
> That binding requires compiling with Python Development files, though.

Compilation from source is only required on the latest version of python3. p4python has wheels on PyPI, but it's consistently a minor version behind. At the moment wheels for 3.8 exist for all major platforms, but not 3.9.

> > The change to INSTALL just drops the mention of 3.x; do we want to
> > specifically say that any version of 3.x is OK, or is it generally
> > accepted that Python 3.x is "later" than "Python 2.7"?

Any 3.x is OK, as long as we are staying with interfacing with the p4 executable directly.

-- 
Yang
Previous: Đoàn Trần Công DanhNext: Junio C Hamano
Message 4 of 5 in “doc: mention Python 3.x supports”
  1. doc: mention Python 3.x supportsĐoàn Trần Công Danh, Dec 10, 2020
  2. Junio C HamanoDec 14, 2020
  3. Đoàn Trần Công DanhDec 15, 2020
  4. Yang ZhaoDec 15, 2020
  5. Junio C HamanoDec 15, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.