def _activate_test_virtualenvs(self, python): """Make sure the test suite virtualenvs are set up and activated. Args: python: Optional python version string we want to run the suite with. See the `--python` argument to the `mach python-test` command. """ from mozbuild.pythonutil import find_python3_executable default_manager = self.virtualenv_manager # Grab the default virtualenv properties before we activate other virtualenvs. python = python or default_manager.python_path py3_root = default_manager.virtualenv_root + '_py3' self.activate_pipenv(pipfile=None, populate=True, python=python) # The current process might be running under Python 2 and the Python 3 # virtualenv will not be set up by mach bootstrap. To avoid problems in tests # that implicitly depend on the Python 3 virtualenv we ensure the Python 3 # virtualenv is up to date before the tests start. python3, version = find_python3_executable(min_version='3.5.0') py3_manager = VirtualenvManager( default_manager.topsrcdir, default_manager.topobjdir, py3_root, default_manager.log_handle, default_manager.manifest_path, ) py3_manager.ensure(python3)
def setup(app): from mozbuild.virtualenv import VirtualenvManager from moztreedocs import manager app.add_directive("mozbuildsymbols", MozbuildSymbols) # Unlike typical Sphinx installs, our documentation is assembled from # many sources and staged in a common location. This arguably isn't a best # practice, but it was the easiest to implement at the time. # # Here, we invoke our custom code for staging/generating all our # documentation. manager.generate_docs(app) app.srcdir = manager.staging_dir # We need to adjust sys.path in order for Python API docs to get generated # properly. We leverage the in-tree virtualenv for this. topsrcdir = manager.topsrcdir ve = VirtualenvManager( topsrcdir, os.path.join(app.outdir, "_venv"), sys.stderr, os.path.join(topsrcdir, "build", "build_virtualenv_packages.txt"), ) ve.ensure() ve.activate()
def setup(app): app.add_directive('mozbuildsymbols', MozbuildSymbols) # Unlike typical Sphinx installs, our documentation is assembled from # many sources and staged in a common location. This arguably isn't a best # practice, but it was the easiest to implement at the time. # # Here, we invoke our custom code for staging/generating all our # documentation. from moztreedocs import SphinxManager topsrcdir = app.config._raw_config['topsrcdir'] manager = SphinxManager(topsrcdir, os.path.join(topsrcdir, 'tools', 'docs'), app.outdir) manager.generate_docs(app) app.srcdir = os.path.join(app.outdir, '_staging') # We need to adjust sys.path in order for Python API docs to get generated # properly. We leverage the in-tree virtualenv for this. from mozbuild.virtualenv import VirtualenvManager ve = VirtualenvManager( topsrcdir, os.path.join(topsrcdir, 'dummy-objdir'), os.path.join(app.outdir, '_venv'), sys.stderr, os.path.join(topsrcdir, 'build', 'virtualenv_packages.txt')) ve.ensure() ve.activate()
def setup(app): app.add_directive('mozbuildsymbols', MozbuildSymbols) # Unlike typical Sphinx installs, our documentation is assembled from # many sources and staged in a common location. This arguably isn't a best # practice, but it was the easiest to implement at the time. # # Here, we invoke our custom code for staging/generating all our # documentation. from moztreedocs import SphinxManager topsrcdir = app.config._raw_config['topsrcdir'] manager = SphinxManager(topsrcdir, os.path.join(topsrcdir, 'tools', 'docs'), app.outdir) manager.generate_docs(app) app.srcdir = os.path.join(app.outdir, '_staging') # We need to adjust sys.path in order for Python API docs to get generated # properly. We leverage the in-tree virtualenv for this. from mozbuild.virtualenv import VirtualenvManager ve = VirtualenvManager(topsrcdir, os.path.join(topsrcdir, 'dummy-objdir'), os.path.join(app.outdir, '_venv'), sys.stderr, os.path.join(topsrcdir, 'build', 'virtualenv_packages.txt')) ve.ensure() ve.activate()