> On July 9, 2017, 9:10 a.m., Armand Grillet wrote: > > I have not been able to reproduce the steps to test the patch, the last one > > returns this error: > > ``` > > (env) lib (60719) $ python setup.py test > > zip_safe flag not set; analyzing archive contents... > > > > Installed > > /Users/Armand/Code/apache-mesos/src/python/lib/.eggs/pytest_runner-2.11.1-py2.7.egg > > /Users/Armand/Code/apache-mesos/src/python/lib/env/lib/python2.7/site-packages/setuptools/dist.py:336: > > UserWarning: Normalizing '0.0.0.dev' to '0.0.0.dev0' > > normalized_version, > > running pytest > > Searching for pytest-cov > > Reading https://pypi.python.org/simple/pytest-cov/ > > Downloading > > https://pypi.python.org/packages/24/b4/7290d65b2f3633db51393bdf8ae66309b37620bc3ec116c5e357e3e37238/pytest-cov-2.5.1.tar.gz#md5=5acf38d4909e19819eb5c1754fbfc0ac > > Best match: pytest-cov 2.5.1 > > Processing pytest-cov-2.5.1.tar.gz > > Writing > > /var/folders/mt/n_tlp88537s9kt9n9173_mdh0000gn/T/easy_install-zEq9cm/pytest-cov-2.5.1/setup.cfg > > Running pytest-cov-2.5.1/setup.py -q bdist_egg --dist-dir > > /var/folders/mt/n_tlp88537s9kt9n9173_mdh0000gn/T/easy_install-zEq9cm/pytest-cov-2.5.1/egg-dist-tmp-CB8boX > > warning: no files found matching '.isort.cfg' > > warning: no files found matching '.pylintrc' > > warning: no previously-included files matching '*.py[cod]' found anywhere > > in distribution > > warning: no previously-included files matching '__pycache__' found anywhere > > in distribution > > warning: no previously-included files matching '*.so' found anywhere in > > distribution > > creating > > /Users/Armand/Code/apache-mesos/src/python/lib/.eggs/pytest_cov-2.5.1-py2.7.egg > > Extracting pytest_cov-2.5.1-py2.7.egg to > > /Users/Armand/Code/apache-mesos/src/python/lib/.eggs > > > > Installed > > /Users/Armand/Code/apache-mesos/src/python/lib/.eggs/pytest_cov-2.5.1-py2.7.egg > > Searching for pytest > > Downloading > > https://pypi.python.org/packages/24/b4/7290d65b2f3633db51393bdf8ae66309b37620bc3ec116c5e357e3e37238/pytest-cov-2.5.1.tar.gz#md5=5acf38d4909e19819eb5c1754fbfc0ac > > Best match: pytest cov-2.5.1 > > Processing pytest-cov-2.5.1.tar.gz > > Writing > > /var/folders/mt/n_tlp88537s9kt9n9173_mdh0000gn/T/easy_install-bfwvC6/pytest-cov-2.5.1/setup.cfg > > Running pytest-cov-2.5.1/setup.py -q bdist_egg --dist-dir > > /var/folders/mt/n_tlp88537s9kt9n9173_mdh0000gn/T/easy_install-bfwvC6/pytest-cov-2.5.1/egg-dist-tmp-ss6Ebd > > warning: no files found matching '.isort.cfg' > > warning: no files found matching '.pylintrc' > > warning: no previously-included files matching '*.py[cod]' found anywhere > > in distribution > > warning: no previously-included files matching '__pycache__' found anywhere > > in distribution > > warning: no previously-included files matching '*.so' found anywhere in > > distribution > > removing > > '/Users/Armand/Code/apache-mesos/src/python/lib/.eggs/pytest_cov-2.5.1-py2.7.egg' > > (and everything under it) > > creating > > /Users/Armand/Code/apache-mesos/src/python/lib/.eggs/pytest_cov-2.5.1-py2.7.egg > > Extracting pytest_cov-2.5.1-py2.7.egg to > > /Users/Armand/Code/apache-mesos/src/python/lib/.eggs > > > > Installed > > /Users/Armand/Code/apache-mesos/src/python/lib/.eggs/pytest_cov-2.5.1-py2.7.egg > > Traceback (most recent call last): > > File "setup.py", line 63, in <module> > > zip_safe=False, > > File > > "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", > > line 151, in setup > > dist.run_commands() > > File > > "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", > > line 953, in run_commands > > self.run_command(cmd) > > File > > "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", > > line 972, in run_command > > cmd_obj.run() > > File "build/bdist.macosx-10.12-intel/egg/ptr.py", line 150, in run > > File "build/bdist.macosx-10.12-intel/egg/ptr.py", line 133, in _super_run > > File > > "/Users/Armand/Code/apache-mesos/src/python/lib/env/lib/python2.7/site-packages/setuptools/command/test.py", > > line 199, in run > > installed_dists = self.install_dists(self.distribution) > > File "build/bdist.macosx-10.12-intel/egg/ptr.py", line 91, in > > install_dists > > File > > "/Users/Armand/Code/apache-mesos/src/python/lib/env/lib/python2.7/site-packages/setuptools/command/test.py", > > line 195, in install_dists > > tr_d = dist.fetch_build_eggs(dist.tests_require or []) > > File > > "/Users/Armand/Code/apache-mesos/src/python/lib/env/lib/python2.7/site-packages/setuptools/dist.py", > > line 377, in fetch_build_eggs > > replace_conflicting=True, > > File > > "/Users/Armand/Code/apache-mesos/src/python/lib/env/lib/python2.7/site-packages/pkg_resources/__init__.py", > > line 855, in resolve > > raise DistributionNotFound(req, requirers) > > pkg_resources.DistributionNotFound: The 'pytest' distribution was not found > > and is required by the application > > ``` > > I woud suggest following an installation process similar to the one for > > `cli_new` using a bootstrap script to avoid this. > > A new `.gitignore` or an update of the existing ones also seems necessary > > as installing the virtual environment currently creates unstaged files. > > Concerning the naming, the directory to place the new virtual environment > > should be called `mesos` instead of `env` to be less generic (`mesos` is > > still generic but makes sense as this is the `mesos` Python package).
the plan was actually to run `setup.py install` as part of bootstrap -- the mesos package needs to be installed in the same environment as cli_new in order for cli_new to use it. how about setting up it's own test script instead? cli_new currently uses `tests/main.py` to run tests, and the mesos package could probably do something similar, except it would be a shell script that bootstraps the environment and runs the tests. - Eric ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/60719/#review179995 ----------------------------------------------------------- On July 7, 2017, 9:44 p.m., Eric Chung wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/60719/ > ----------------------------------------------------------- > > (Updated July 7, 2017, 9:44 p.m.) > > > Review request for mesos, Armand Grillet, Jason Lai, and Kevin Klues. > > > Repository: mesos > > > Description > ------- > > Part of MESOS-7310, this patch adds the test infrastructure necessary > for reliably running unit tests for the mesos package located under > src/python/lib. > > setup.py is added under src/python/lib to both define the Python package > and to allow tests to be run via `python setup.py test`, which delegates > tests to pytest. > > > Diffs > ----- > > src/python/lib/mesos/__init__.py e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 > src/python/lib/requirements-test.in PRE-CREATION > src/python/lib/requirements.in PRE-CREATION > src/python/lib/setup.cfg PRE-CREATION > src/python/lib/setup.py PRE-CREATION > support/mesos-style.py 48d816f72df65d77364769f812fc06afcd6b5aec > > > Diff: https://reviews.apache.org/r/60719/diff/4/ > > > Testing > ------- > > 1. under src/python/lib, run `virtualenv env` > 2. `. env/bin/activate` > 3. `pip install setuptools --upgrade` > 4. `python setup.py test` > > > Thanks, > > Eric Chung > >
