git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] doc: mention Python 3.x supports
@ 2020-12-10 14:30 Đoàn Trần Công Danh
  2020-12-14 23:00 ` Junio C Hamano
  0 siblings, 1 reply; 5+ messages in thread
From: Đoàn Trần Công Danh @ 2020-12-10 14:30 UTC (permalink / raw)
  To: git; +Cc: Đoàn Trần Công Danh

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).

Let's update our documentation to reflect that fact.

Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
---
 INSTALL  | 3 +--
 Makefile | 2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/INSTALL b/INSTALL
index 9ba33e6a14..8474ad01bf 100644
--- a/INSTALL
+++ b/INSTALL
@@ -165,8 +165,7 @@ Issues of note:
 	  use English. Under autoconf the configure script will do this
 	  automatically if it can't find libintl on the system.
 
-	- Python version 2.4 or later (but not 3.x, which is not
-	  supported by Perforce) is needed to use the git-p4 interface
+	- Python version 2.7 or later is needed to use the git-p4 interface
 	  to Perforce.
 
  - Some platform specific issues are dealt with Makefile rules,
diff --git a/Makefile b/Makefile
index 6fb86c5862..a751065b24 100644
--- a/Makefile
+++ b/Makefile
@@ -303,7 +303,7 @@ all::
 # modules, instead of the fallbacks shipped with Git.
 #
 # Define PYTHON_PATH to the path of your Python binary (often /usr/bin/python
-# but /usr/bin/python2.7 on some platforms).
+# but /usr/bin/python2.7 or /usr/bin/python3 on some platforms).
 #
 # Define NO_PYTHON if you do not want Python scripts or libraries at all.
 #
-- 
2.29.2.299.gdc1121823c


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] doc: mention Python 3.x supports
  2020-12-10 14:30 [PATCH] doc: mention Python 3.x supports Đoàn Trần Công Danh
@ 2020-12-14 23:00 ` Junio C Hamano
  2020-12-15 17:38   ` Đoàn Trần Công Danh
  0 siblings, 1 reply; 5+ messages in thread
From: Junio C Hamano @ 2020-12-14 23:00 UTC (permalink / raw)
  To: Đoàn Trần Công Danh; +Cc: git

Đ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?

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"?

> Let's update our documentation to reflect that fact.

Thanks.

> diff --git a/INSTALL b/INSTALL
> index 9ba33e6a14..8474ad01bf 100644
> --- a/INSTALL
> +++ b/INSTALL
> @@ -165,8 +165,7 @@ Issues of note:
>  	  use English. Under autoconf the configure script will do this
>  	  automatically if it can't find libintl on the system.
>  
> -	- Python version 2.4 or later (but not 3.x, which is not
> -	  supported by Perforce) is needed to use the git-p4 interface
> +	- Python version 2.7 or later is needed to use the git-p4 interface
>  	  to Perforce.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] doc: mention Python 3.x supports
  2020-12-14 23:00 ` Junio C Hamano
@ 2020-12-15 17:38   ` Đoàn Trần Công Danh
  2020-12-15 17:54     ` Yang Zhao
  0 siblings, 1 reply; 5+ messages in thread
From: Đoàn Trần Công Danh @ 2020-12-15 17:38 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, Yang Zhao

On 2020-12-14 15:00:00-0800, Junio C Hamano <gitster@pobox.com> wrote:

Sorry, I didn't receive this email, I found your reply when looking
into public-inbox's archive. (I guess it's because of Google global
outage).

> Đ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.

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.

Anyway, I added Yang Zhao to Cc to clarify.

@Yang: Would you please verify what I've said?

> 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"?

I think it's generally accepted since there're no Python 2.x version
that is "later" than Python 2.7.
I haven't check the whole git-p4 but in general, a lot of Python script
said support 2.7 AND 3.y with y is a specific number,
since some scripts can work with 2.7 and e.g. 3.4+ but not 3.3.
I can add them into "INSTALL" if it looks better.

p4r13: https://www.perforce.com/perforce/r13.1/manuals/p4script/03_python.html
PyPI: https://pypi.org/project/p4python/

-- 
Danh

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] doc: mention Python 3.x supports
  2020-12-15 17:38   ` Đoàn Trần Công Danh
@ 2020-12-15 17:54     ` Yang Zhao
  2020-12-15 21:06       ` Junio C Hamano
  0 siblings, 1 reply; 5+ messages in thread
From: Yang Zhao @ 2020-12-15 17:54 UTC (permalink / raw)
  To: Đoàn Trần Công Danh; +Cc: Junio C Hamano, Git Users

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] doc: mention Python 3.x supports
  2020-12-15 17:54     ` Yang Zhao
@ 2020-12-15 21:06       ` Junio C Hamano
  0 siblings, 0 replies; 5+ messages in thread
From: Junio C Hamano @ 2020-12-15 21:06 UTC (permalink / raw)
  To: Yang Zhao; +Cc: Đoàn Trần Công Danh, Git Users

Yang Zhao <yang.zhao@skyboxlabs.com> writes:

> 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.

Ah, OK, the mention of "not 3.x" referred to the fact that its
pickle output format is native to 2.7, but 3.x can be made to read
it (and that is how we can run with 3.x).  That makes sense.

>> 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.

It makes it a lot simpler that we do not have to say anything.  So
the patch under discussion is good as-is without any tweaks, then.

Thanks.  

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-12-15 21:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-10 14:30 [PATCH] doc: mention Python 3.x supports Đoàn Trần Công Danh
2020-12-14 23:00 ` Junio C Hamano
2020-12-15 17:38   ` Đoàn Trần Công Danh
2020-12-15 17:54     ` Yang Zhao
2020-12-15 21:06       ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).