{"thread":{"id":"54809","subject":"[PATCH] doc: mention Python 3.x supports","startedAt":"2020-12-10T19:05:00Z","lastAt":"2020-12-15T21:08:28Z","messageCount":5,"participants":["Đoàn Trần Công Danh","Junio C Hamano","Yang Zhao"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"412010","messageId":"20201210143017.24615-1-congdanhqx@gmail.com","threadId":"54809","inReplyTo":null,"subject":"[PATCH] doc: mention Python 3.x supports","fromName":"Đoàn Trần Công Danh","fromEmail":"congdanhqx@gmail.com","sentAt":"2020-12-10T14:30:17Z","receivedAt":"2020-12-10T19:05:00Z","isPatch":true,"sender":{"key":"congdanhqx@gmail.com","avatar":"https://avatars.githubusercontent.com/u/42673067?v=4"},"body":"Commit 0b4396f068, (git-p4: make python2.7 the oldest supported version,\n2019-12-13) pointed out that git-p4 uses Python 2.7-or-later features\nin the code.\n\nIn addition, git-p4 gained enough support for Python 3 from\n6cec21a82f, (git-p4: encode/decode communication with p4 for\npython3, 2019-12-13).\n\nLet's update our documentation to reflect that fact.\n\nSigned-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>\n---\n INSTALL  | 3 +--\n Makefile | 2 +-\n 2 files changed, 2 insertions(+), 3 deletions(-)\n\ndiff --git a/INSTALL b/INSTALL\nindex 9ba33e6a14..8474ad01bf 100644\n--- a/INSTALL\n+++ b/INSTALL\n@@ -165,8 +165,7 @@ Issues of note:\n \t  use English. Under autoconf the configure script will do this\n \t  automatically if it can't find libintl on the system.\n \n-\t- Python version 2.4 or later (but not 3.x, which is not\n-\t  supported by Perforce) is needed to use the git-p4 interface\n+\t- Python version 2.7 or later is needed to use the git-p4 interface\n \t  to Perforce.\n \n  - Some platform specific issues are dealt with Makefile rules,\ndiff --git a/Makefile b/Makefile\nindex 6fb86c5862..a751065b24 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -303,7 +303,7 @@ all::\n # modules, instead of the fallbacks shipped with Git.\n #\n # Define PYTHON_PATH to the path of your Python binary (often /usr/bin/python\n-# but /usr/bin/python2.7 on some platforms).\n+# but /usr/bin/python2.7 or /usr/bin/python3 on some platforms).\n #\n # Define NO_PYTHON if you do not want Python scripts or libraries at all.\n #\n-- \n2.29.2.299.gdc1121823c\n\n"},{"id":"412214","messageId":"xmqq4kkoat8v.fsf@gitster.c.googlers.com","threadId":"54809","inReplyTo":"20201210143017.24615-1-congdanhqx@gmail.com","subject":"Re: [PATCH] doc: mention Python 3.x supports","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-12-14T23:00:00Z","receivedAt":"2020-12-14T23:01:16Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Đoàn Trần Công Danh  <congdanhqx@gmail.com> writes:\n\n> Commit 0b4396f068, (git-p4: make python2.7 the oldest supported version,\n> 2019-12-13) pointed out that git-p4 uses Python 2.7-or-later features\n> in the code.\n>\n> In addition, git-p4 gained enough support for Python 3 from\n> 6cec21a82f, (git-p4: encode/decode communication with p4 for\n> python3, 2019-12-13).\n\nI am not a Perforce user, so with that in mind, please help me make\nsure I understand the situation well.  The statement \"not 3.x, which\nis not supported by Perforce\" is from early 2013, and 6cec21a82f\ntalks about the format of marshalled dict object that comes out of\np4 (Perforce) tool that needs to be read in a certain way to be\ncompatible with Python3.  Does that mean sometime in these 6 years,\nPerforce started supporting 3.x?\n\nThe change to INSTALL just drops the mention of 3.x; do we want to\nspecifically say that any version of 3.x is OK, or is it generally\naccepted that Python 3.x is \"later\" than \"Python 2.7\"?\n\n> Let's update our documentation to reflect that fact.\n\nThanks.\n\n> diff --git a/INSTALL b/INSTALL\n> index 9ba33e6a14..8474ad01bf 100644\n> --- a/INSTALL\n> +++ b/INSTALL\n> @@ -165,8 +165,7 @@ Issues of note:\n>  \t  use English. Under autoconf the configure script will do this\n>  \t  automatically if it can't find libintl on the system.\n>  \n> -\t- Python version 2.4 or later (but not 3.x, which is not\n> -\t  supported by Perforce) is needed to use the git-p4 interface\n> +\t- Python version 2.7 or later is needed to use the git-p4 interface\n>  \t  to Perforce.\n"},{"id":"412270","messageId":"X9j0pf1lQQHZifvw@danh.dev","threadId":"54809","inReplyTo":"xmqq4kkoat8v.fsf@gitster.c.googlers.com","subject":"Re: [PATCH] doc: mention Python 3.x supports","fromName":"Đoàn Trần Công Danh","fromEmail":"congdanhqx@gmail.com","sentAt":"2020-12-15T17:38:45Z","receivedAt":"2020-12-15T17:39:51Z","isPatch":true,"sender":{"key":"congdanhqx@gmail.com","avatar":"https://avatars.githubusercontent.com/u/42673067?v=4"},"body":"On 2020-12-14 15:00:00-0800, Junio C Hamano <gitster@pobox.com> wrote:\n\nSorry, I didn't receive this email, I found your reply when looking\ninto public-inbox's archive. (I guess it's because of Google global\noutage).\n\n> Đoàn Trần Công Danh  <congdanhqx@gmail.com> writes:\n> \n> > Commit 0b4396f068, (git-p4: make python2.7 the oldest supported version,\n> > 2019-12-13) pointed out that git-p4 uses Python 2.7-or-later features\n> > in the code.\n> >\n> > In addition, git-p4 gained enough support for Python 3 from\n> > 6cec21a82f, (git-p4: encode/decode communication with p4 for\n> > python3, 2019-12-13).\n> \n> I am not a Perforce user, so with that in mind, please help me make\n> sure I understand the situation well.  The statement \"not 3.x, which\n> is not supported by Perforce\" is from early 2013, and 6cec21a82f\n> talks about the format of marshalled dict object that comes out of\n> p4 (Perforce) tool that needs to be read in a certain way to be\n> compatible with Python3.  Does that mean sometime in these 6 years,\n> Perforce started supporting 3.x?\n\nAFAIK, p4 is an executable binary (in the sense of ELF binaries) from\nforever. And its {in,out}put is in arbitrary encoding, while Python 3\nexpects UCS-2 or UCS-4 encoding. 6cec21a82f adds code to decode to\nPython 3 string to overcome this limitation.\n\nNot related, but Perforce's official Python bindings supports Python 3\nfrom at least 2013 [p4r13]. And they still maintain in [PyPI].\nThat binding requires compiling with Python Development files, though.\n\nAnyway, I added Yang Zhao to Cc to clarify.\n\n@Yang: Would you please verify what I've said?\n\n> The change to INSTALL just drops the mention of 3.x; do we want to\n> specifically say that any version of 3.x is OK, or is it generally\n> accepted that Python 3.x is \"later\" than \"Python 2.7\"?\n\nI think it's generally accepted since there're no Python 2.x version\nthat is \"later\" than Python 2.7.\nI haven't check the whole git-p4 but in general, a lot of Python script\nsaid support 2.7 AND 3.y with y is a specific number,\nsince some scripts can work with 2.7 and e.g. 3.4+ but not 3.3.\nI can add them into \"INSTALL\" if it looks better.\n\np4r13: https://www.perforce.com/perforce/r13.1/manuals/p4script/03_python.html\nPyPI: https://pypi.org/project/p4python/\n\n-- \nDanh\n"},{"id":"412276","messageId":"CABvFv3JjipUqchLAhyvMax=s4z3VhPyKvSAPqtbj3W4pNOmzvg@mail.gmail.com","threadId":"54809","inReplyTo":"X9j0pf1lQQHZifvw@danh.dev","subject":"Re: [PATCH] doc: mention Python 3.x supports","fromName":"Yang Zhao","fromEmail":"yang.zhao@skyboxlabs.com","sentAt":"2020-12-15T17:54:36Z","receivedAt":"2020-12-15T17:56:00Z","isPatch":true,"sender":{"key":"yang.zhao@skyboxlabs.com","avatar":"https://avatars.githubusercontent.com/u/45857825?v=4"},"body":"On Tue, Dec 15, 2020 at 9:38 AM Đoàn Trần Công Danh\n<congdanhqx@gmail.com> wrote:\n>\n> > Đoàn Trần Công Danh  <congdanhqx@gmail.com> writes:\n> >\n> > > Commit 0b4396f068, (git-p4: make python2.7 the oldest supported version,\n> > > 2019-12-13) pointed out that git-p4 uses Python 2.7-or-later features\n> > > in the code.\n> > >\n> > > In addition, git-p4 gained enough support for Python 3 from\n> > > 6cec21a82f, (git-p4: encode/decode communication with p4 for\n> > > python3, 2019-12-13).\n> >\n> > I am not a Perforce user, so with that in mind, please help me make\n> > sure I understand the situation well.  The statement \"not 3.x, which\n> > is not supported by Perforce\" is from early 2013, and 6cec21a82f\n> > talks about the format of marshalled dict object that comes out of\n> > p4 (Perforce) tool that needs to be read in a certain way to be\n> > compatible with Python3.  Does that mean sometime in these 6 years,\n> > Perforce started supporting 3.x?\n>\n> AFAIK, p4 is an executable binary (in the sense of ELF binaries) from\n> forever. And its {in,out}put is in arbitrary encoding, while Python 3\n> expects UCS-2 or UCS-4 encoding. 6cec21a82f adds code to decode to\n> Python 3 string to overcome this limitation.\n\nCaveat: I am relying on memory here. I haven't looked at this code\nsince my last round of PRs...\n\nYes, git-p4 use the p4 executable, and not an integration library. p4\nhas a \"serialize for Python\" mode which outputs in a python2.7 pickled\nformat, which is still supported by python3, and this is what is used\nto receive data from the app.\n\n\n> Not related, but Perforce's official Python bindings supports Python 3\n> from at least 2013 [p4r13]. And they still maintain in [PyPI].\n> That binding requires compiling with Python Development files, though.\n\nCompilation from source is only required on the latest version of\npython3. p4python has wheels on PyPI, but it's consistently a minor\nversion behind. At the moment wheels for 3.8 exist for all major\nplatforms, but not 3.9.\n\n> > The change to INSTALL just drops the mention of 3.x; do we want to\n> > specifically say that any version of 3.x is OK, or is it generally\n> > accepted that Python 3.x is \"later\" than \"Python 2.7\"?\n\nAny 3.x is OK, as long as we are staying with interfacing with the p4\nexecutable directly.\n\n-- \nYang\n"},{"id":"412294","messageId":"xmqq8s9y93tj.fsf@gitster.c.googlers.com","threadId":"54809","inReplyTo":"CABvFv3JjipUqchLAhyvMax=s4z3VhPyKvSAPqtbj3W4pNOmzvg@mail.gmail.com","subject":"Re: [PATCH] doc: mention Python 3.x supports","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-12-15T21:06:48Z","receivedAt":"2020-12-15T21:08:28Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Yang Zhao <yang.zhao@skyboxlabs.com> writes:\n\n> Caveat: I am relying on memory here. I haven't looked at this code\n> since my last round of PRs...\n>\n> Yes, git-p4 use the p4 executable, and not an integration library. p4\n> has a \"serialize for Python\" mode which outputs in a python2.7 pickled\n> format, which is still supported by python3, and this is what is used\n> to receive data from the app.\n\nAh, OK, the mention of \"not 3.x\" referred to the fact that its\npickle output format is native to 2.7, but 3.x can be made to read\nit (and that is how we can run with 3.x).  That makes sense.\n\n>> Not related, but Perforce's official Python bindings supports Python 3\n>> from at least 2013 [p4r13]. And they still maintain in [PyPI].\n>> That binding requires compiling with Python Development files, though.\n>\n> Compilation from source is only required on the latest version of\n> python3. p4python has wheels on PyPI, but it's consistently a minor\n> version behind. At the moment wheels for 3.8 exist for all major\n> platforms, but not 3.9.\n>\n>> > The change to INSTALL just drops the mention of 3.x; do we want to\n>> > specifically say that any version of 3.x is OK, or is it generally\n>> > accepted that Python 3.x is \"later\" than \"Python 2.7\"?\n>\n> Any 3.x is OK, as long as we are staying with interfacing with the p4\n> executable directly.\n\nIt makes it a lot simpler that we do not have to say anything.  So\nthe patch under discussion is good as-is without any tweaks, then.\n\nThanks.  \n"}]}