> On May 10, 2018, 12:36 p.m., Benjamin Bannier wrote:
> > Thanks for the work of porting these over to python3 Armand!
> > 
> > Two more high-level comments:
> > 
> > * Why are we not using code compatible with both python2 and 3 instead of 
> > effectively forking the code? Maintaining two supposedly identical 
> > implementations requires more work and we risk of the implementations 
> > diverging as features are added to only one of them, see e.g., the 
> > autotools and cmake build setups. I don't think it is a good idea to 
> > introduce that additional amount of work for these scripts. 
> > * looking at the _Testing Done_ section, it sounds like only a part of the 
> > files have been verified, even though you want to "ported" versions for all 
> > scripts. We should not expect users to do rough verification; otherwise we 
> > risk of nobody adopting these scripts. Please do not add untested code to 
> > the repo.
> > 
> > I would feel much more comfortable if we'd write some temporary less pretty 
> > code which can support both python2 and 3, see e.g., 
> > http://python-future.org/overview.html and the tools for automatic 
> > migration listed there (which are IMO more advanced than `2to3`). We can 
> > always tidy it up the code should we decide to drop python2 support.
> > 
> > I am a -1 on this patch.

> Why are we not using code compatible with both python2 and 3 instead of 
> effectively forking the code?

Two parts to the answer to this question:

(1) We do not want to maintain single-source Python 2 and Python3  
compatibility because it's costly and unncessary. It can be done, but it's 
liable to break. So we want to move to Python 3 support _only_.

(2) We _do not_ want to have a fork of the code. The intention is to delete the 
Python 2 scripts about a week or two after these are merged, then `git mv 
support/python3/*.py support/`. So it's just a staged rewrite so that we don't 
immediately break developers' workflow.

Armand, I think as part of this staged rewrite, in the Python 2 scripts we 
should add really BIG AND LOUD DEPRECATION warnings that are emitted as they're 
used. To the point that I'm going to opena review issue ;)

> Please do not add untested code to the repo.

We don't intend to. That's why this WIP is up, so we all can try testing them 
before merging :) I have our CI team testing out `apply-reviews.py` right now; 
please help test anyway you can and report back here!


- Andrew


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/67059/#review202861
-----------------------------------------------------------


On May 10, 2018, 9:24 a.m., Armand Grillet wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/67059/
> -----------------------------------------------------------
> 
> (Updated May 10, 2018, 9:24 a.m.)
> 
> 
> Review request for mesos, Andrew Schwartzmeyer, Benjamin Bannier, Eric Chung, 
> and Kevin Klues.
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> The scripts are in a temporary directory, `support/python3`.
> 
> The scripts have been ported using `2to3`, the official tool to do so.
> Many of these scripts require testing from the community before being
> used by default.
> 
> The script building the virtual environment and the git hooks have
> been updated to use the new scripts.
> 
> 
> Diffs
> -----
> 
>   support/build-virtualenv 850af89326721f34de20eb45a7e78fa391d031be 
>   support/hooks/commit-msg a0c218deee3fb4b7594fe39b76c1025045ba0725 
>   support/hooks/post-rewrite 1ab14abf711d1923a7ae69beb33581317009a94a 
>   support/hooks/pre-commit 6faba98ab6db68aef1a54091a08b8db1eaac8701 
>   support/python3/apply-reviews.py PRE-CREATION 
>   support/python3/generate-endpoint-help.py PRE-CREATION 
>   support/python3/jsonurl.py PRE-CREATION 
>   support/python3/mesos-gtest-runner.py PRE-CREATION 
>   support/python3/mesos-split.py PRE-CREATION 
>   support/python3/mesos-style.py PRE-CREATION 
>   support/python3/post-reviews.py PRE-CREATION 
>   support/python3/push-commits.py PRE-CREATION 
>   support/python3/test-upgrade.py PRE-CREATION 
>   support/python3/verify-reviews.py PRE-CREATION 
> 
> 
> Diff: https://reviews.apache.org/r/67059/diff/1/
> 
> 
> Testing
> -------
> 
> All the files are OK for our linter, I have tested `mesos-style.py` and 
> `post-reviews.py` (used for this review request).
> 
> We will likely see error messages `TypeError: cannot use a string pattern on 
> a bytes-like object`, they are very easy to fix (we just need to add 
> `.decode("utf-8")` but detecting all of them requires to use the scripts. 
> Please do so and create issues.
> 
> 
> Thanks,
> 
> Armand Grillet
> 
>

Reply via email to