diff --git a/docs/developer_guide.rst b/docs/developer_guide.rst index fe4352e9..dd6aea14 100644 --- a/docs/developer_guide.rst +++ b/docs/developer_guide.rst @@ -10,8 +10,8 @@ started. Installation ------------ -See :ref:`quickstart` for setting up an installation. Use the "develop" option -when running ~/lnt/setup.py. +See :ref:`quickstart` for setting up an installation. Pass ``-e`` to ``pip`` when +installing the package to install it in "editable" mode. Running LNT's Regression Tests ------------------------------ diff --git a/docs/quickstart.rst b/docs/quickstart.rst index aae80707..d458a9ef 100644 --- a/docs/quickstart.rst +++ b/docs/quickstart.rst @@ -12,35 +12,24 @@ Installation The first thing to do is to checkout install the LNT software itself. The following steps should suffice on any modern Unix variant: -#. Install ``virtualenv``, if necessary:: - - sudo easy_install virtualenv - - ``virtualenv`` is a standard Python tool for allowing the installation of - Python applications into their own sandboxes, or virtual environments. - -#. Create a new virtual environment for the LNT application:: - - virtualenv ~/mysandbox - - This will create a new virtual environment at ``~/mysandbox``. - #. Checkout the LNT sources:: git clone https://github.com/llvm/llvm-lnt.git ~/lnt +#. Create a new virtual environment for the LNT application and activate it:: + + python3 -m venv .venv + source .venv/bin/activate + #. Install LNT into the virtual environment:: - ~/mysandbox/bin/python ~/lnt/setup.py develop + pip install -r requirements.txt - We recommend using ``develop`` instead of install for local use, so that any - changes to the LNT sources are immediately propagated to your - installation. If you are running a production install or care a lot about - stability, you can use ``install`` which will copy in the sources and you - will need to explicitly re-install when you wish to update the LNT - application. +Note that if you only want to use the client-side features of ``lnt``, you can +install the requirements specified in ``requirements.client.txt`` instead, which +are a bit more lightweight. -That's it! +That's it! ``lnt`` should now be accessible from the virtual environment. Running Tests diff --git a/lnt/lnttool/main.py b/lnt/lnttool/main.py index ee13be54..86db3c04 100644 --- a/lnt/lnttool/main.py +++ b/lnt/lnttool/main.py @@ -475,8 +475,7 @@ def _version_check(): installed = "{} {}".format(meta['Name'], meta['Version']) current = "{} {}".format(lnt.__name__, lnt.__version__) raise SystemExit(f"""\ -error: installed distribution {installed} is not current ({current}), you may need to reinstall -LNT or rerun 'setup.py develop' if using development mode.""") +error: installed distribution {installed} is not current ({current}), you may need to reinstall LNT""") def show_version(ctx, param, value): diff --git a/requirements.client.txt b/requirements.client.txt index 945c9b46..e05534e7 100644 --- a/requirements.client.txt +++ b/requirements.client.txt @@ -1 +1,17 @@ -. \ No newline at end of file +# These requirements are what you would install to run the client. +# The client has fewer requirements than the server code. +. +aniso8601==1.2.0 +click==6.7 +Flask-RESTful==0.3.4 +Flask-WTF==0.12 +Flask==0.12.2 +itsdangerous==0.24 +Jinja2==2.11.3 +MarkupSafe==1.1.1 +python-gnupg==0.3.7 +pytz==2016.10 +SQLAlchemy==1.3.24 +Werkzeug==0.15.6 +WTForms==2.0.2 +pyyaml==5.1.2 diff --git a/requirements.server.txt b/requirements.server.txt index a5fa0271..b5c42a43 100644 --- a/requirements.server.txt +++ b/requirements.server.txt @@ -1,19 +1,6 @@ # These requirements are what you would install on a production server. +# The server has more requirements than the client. . -aniso8601==1.2.0 -click==6.7 -Flask-RESTful==0.3.4 -Flask-WTF==0.12 -Flask==0.12.2 +-r requirements.client.txt gunicorn==19.9.0 -itsdangerous==0.24 -Jinja2==2.11.3 -MarkupSafe==1.1.1 -progressbar2 psycopg2==2.9.10 -python-gnupg==0.3.7 -pytz==2016.10 -pyyaml==5.1.2 -SQLAlchemy==1.3.24 -Werkzeug==0.15.6 -WTForms==2.0.2 diff --git a/requirements.txt b/requirements.txt index 62e10ffa..f5545ffa 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1 @@ --r requirements.server.txt \ No newline at end of file +-r requirements.server.txt diff --git a/setup.py b/setup.py index b508ee40..a5825385 100644 --- a/setup.py +++ b/setup.py @@ -14,6 +14,7 @@ os.environ["CXX"] = "xcrun --sdk macosx clang" cflags += ['-stdlib=libc++', '-mmacosx-version-min=10.7'] +# TODO: Remove this once we assume that setup.py isn't called directly to install lnt # setuptools expects to be invoked from within the directory of setup.py, but # it is nice to allow: # python path/to/setup.py install diff --git a/tests/utils/Installation.py b/tests/utils/Installation.py deleted file mode 100644 index 6a535027..00000000 --- a/tests/utils/Installation.py +++ /dev/null @@ -1,12 +0,0 @@ -# Check that installation functions properly (mainly try and catch cases where -# we didn't install package data properly). -# -# RUN: rm -rf %t.venv -# RUN: virtualenv %t.venv -# RUN: %t.venv/bin/python %{src_root}/setup.py install -# RUN: rm -rf %t.installation -# RUN: %t.venv/bin/lnt create %t.installation -# -# Disable this test by default, it is very slow because it does a full install. -# -# REQUIRES: long diff --git a/tests/utils/installation-client.shtest b/tests/utils/installation-client.shtest new file mode 100644 index 00000000..35415e14 --- /dev/null +++ b/tests/utils/installation-client.shtest @@ -0,0 +1,8 @@ +# Check that installation using the client requirements works properly. +# +# RUN: rm -rf %t.venv +# RUN: python -m venv %t.venv +# RUN: cd %{src_root} +# RUN: %t.venv/bin/python -m pip install -r requirements.client.txt +# RUN: rm -rf %t.installation +# RUN: %t.venv/bin/lnt create %t.installation diff --git a/tests/utils/installation-server.shtest b/tests/utils/installation-server.shtest new file mode 100644 index 00000000..dbac3ed3 --- /dev/null +++ b/tests/utils/installation-server.shtest @@ -0,0 +1,8 @@ +# Check that installation using the server requirements works properly. +# +# RUN: rm -rf %t.venv +# RUN: python -m venv %t.venv +# RUN: cd %{src_root} +# RUN: %t.venv/bin/python -m pip install -r requirements.server.txt +# RUN: rm -rf %t.installation +# RUN: %t.venv/bin/lnt create %t.installation