From reviews-return-72155-apmail-mesos-reviews-archive=mesos.apache.org@mesos.apache.org Thu Jan 18 23:46:49 2018 Return-Path: X-Original-To: apmail-mesos-reviews-archive@minotaur.apache.org Delivered-To: apmail-mesos-reviews-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D9E3517C97 for ; Thu, 18 Jan 2018 23:46:49 +0000 (UTC) Received: (qmail 97320 invoked by uid 500); 18 Jan 2018 23:46:49 -0000 Delivered-To: apmail-mesos-reviews-archive@mesos.apache.org Received: (qmail 97285 invoked by uid 500); 18 Jan 2018 23:46:49 -0000 Mailing-List: contact reviews-help@mesos.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: reviews@mesos.apache.org Delivered-To: mailing list reviews@mesos.apache.org Received: (qmail 97274 invoked by uid 99); 18 Jan 2018 23:46:49 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Jan 2018 23:46:49 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 05427180893; Thu, 18 Jan 2018 23:46:49 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 3.991 X-Spam-Level: *** X-Spam-Status: No, score=3.991 tagged_above=-999 required=6.31 tests=[DKIM_ADSP_CUSTOM_MED=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, HTML_MESSAGE=2, KAM_LAZY_DOMAIN_SECURITY=1, KAM_LOTSOFHASH=0.25, NML_ADSP_CUSTOM_MED=1.2, RCVD_IN_DNSWL_LOW=-0.7, T_RP_MATCHES_RCVD=-0.01, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id SmC8Hdxpiwrz; Thu, 18 Jan 2018 23:46:47 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 64C435F243; Thu, 18 Jan 2018 23:46:47 +0000 (UTC) Received: from reviews.apache.org (unknown [10.41.0.12]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 08C6BE0383; Thu, 18 Jan 2018 23:46:47 +0000 (UTC) Received: from reviews-vm2.apache.org (localhost [IPv6:::1]) by reviews.apache.org (ASF Mail Server at reviews-vm2.apache.org) with ESMTP id E8745C415D8; Thu, 18 Jan 2018 23:46:45 +0000 (UTC) Content-Type: multipart/alternative; boundary="===============2160249162959429431==" MIME-Version: 1.0 Subject: Re: Review Request 64970: Replace ad hoc venv under support/ with tox. From: Eric Chung To: Armand Grillet , Kevin Klues Cc: Eric Chung , mesos Date: Thu, 18 Jan 2018 23:46:44 -0000 Message-ID: <20180118234644.60650.26665@reviews-vm2.apache.org> X-ReviewBoard-URL: https://reviews.apache.org/ Auto-Submitted: auto-generated Sender: Eric Chung X-ReviewGroup: mesos X-Auto-Response-Suppress: DR, RN, OOF, AutoReply X-ReviewRequest-URL: https://reviews.apache.org/r/64970/ X-Sender: Eric Chung References: <20180118232045.60650.10190@reviews-vm2.apache.org> In-Reply-To: <20180118232045.60650.10190@reviews-vm2.apache.org> X-ReviewBoard-Diff-For: src/python/cli_new/tox.ini X-ReviewBoard-Diff-For: src/python/lib/requirements-test.in Reply-To: Eric Chung X-ReviewRequest-Repository: mesos --===============2160249162959429431== MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/64970/ ----------------------------------------------------------- (Updated Jan. 18, 2018, 11:46 p.m.) Review request for mesos, Armand Grillet and Kevin Klues. Repository: mesos Description (updated) ------- Use tox for linting and testing code living uder src/python. At the moment, all linting is done through the same `pylint` installation under support/.virtualenv, which requires ALL dependencies (i.e. pip-requirements.txt, requirements.in scattered in various directories) to be installed in the same virtualenv, making things really messy -- e.g. when I've changed some code under `src/python/lib`, but don't have the dev virtualenv activated, linting will fail since none of the dependencies under `src/python/lib` have been installed. Using tox, we can solve this problem by distributing a "test spec" (tox.ini) in each of the python source directories which are aware of its local dependencies only. To test or lint the code there would be as simple as running `tox -e py27-lint `, and the corresponding virtualenv and test dependencies would automatically be setup. This patch modifies `support/mesos-style.py` to install `tox` in `support/.virtualenv` and delegates linting to a `tox` call when it sees python directories that have tox setup for it. Linting for all other languages will not be effected. Testing Done: 1. intentionally create a lint error, such as extra spaces before a parens in a python file 2. run the pre-commit hook and see tox in action Reviewed at https://reviews.apache.org/r/64970/ Diffs (updated) ----- src/python/cli_new/tox.ini PRE-CREATION src/python/lib/requirements-test.in b2b73aab65377d9310797203ea84c5150ae60805 src/python/lib/tox.ini 8ad030d2dbf1fb7a04f1eaadb587462b4ef3f054 support/mesos-style.py 1b34ea2d9afa8f17b545841cea7a6853a6e18144 Diff: https://reviews.apache.org/r/64970/diff/3/ Changes: https://reviews.apache.org/r/64970/diff/2-3/ Testing ------- 1. intentionally create a lint error, such as extra spaces before a parens in a python file 2. run the pre-commit hook and see tox in action Thanks, Eric Chung --===============2160249162959429431==--