From f032cfe534c46776bf05eaaa44d50529c5a5e221 Mon Sep 17 00:00:00 2001 From: Lukas Holecek Date: Apr 10 2019 08:35:02 +0000 Subject: docs: Simplify development set up Signed-off-by: Lukas Holecek --- diff --git a/.gitignore b/.gitignore index b9ed5dd..8d60068 100644 --- a/.gitignore +++ b/.gitignore @@ -27,6 +27,9 @@ htmlcov greenwave-test-cache.dbm* .pytest_cache +# virtualenv +.venv/ + # Other .vagrant/ .vscode/ diff --git a/docs/dev-guide.rst b/docs/dev-guide.rst index 768c809..c845a88 100644 --- a/docs/dev-guide.rst +++ b/docs/dev-guide.rst @@ -9,17 +9,21 @@ get started. Quick development setup ======================= -Install dependencies: +As an alternative to using virtualenv, described below, you can install system +packages listed in Dockerfile. + +Set up Python 3 vitualenv: + +.. code-block:: console + + $ python3 -m venv --system-site-packages .venv + $ source .venv/bin/activate + +Install development dependencies: .. code-block:: console - $ sudo dnf -y install \ - python3-dogpile-cache \ - python3-fedmsg \ - python3-flask \ - python3-prometheus_client \ - python3-PyYAML \ - python3-requests + $ pip install -r dev-requirements.txt -r requirements.txt Create a local configuration file: @@ -45,22 +49,33 @@ the following command: .. code-block:: console - $ py.test-3 greenwave/tests/ + $ python3 -m pytest greenwave There are also functional tests in the :file:`functional-tests` directory. The functional tests will start their own copy of the `ResultsDB`_, `WaiverDB`_, -and Greenwave servers and then send HTTP requests to them. You can run the -functional tests like this: +and Greenwave servers and then send HTTP requests to them. + +You can run the functional tests like this: .. code-block:: console - $ py.test-3 functional-tests/ + $ python3 -m pytest functional-tests The functional tests assume you have ResultsDB and WaiverDB git checkouts in :file:`../resultsdb` and :file:`../waiverdb` respectively. You can tell it to find them in a different location by passing ``RESULTSDB`` or ``WAIVERDB`` environment variables. +You can quickly clone the repositories (to parent directory) and update +development virtualenv with: + +.. code-block:: console + + $ git clone https://pagure.io/waiverdb.git ../waiverdb/ + $ git clone https://pagure.io/taskotron/resultsdb.git ../resultsdb/ + $ pip install -r ../waiverdb/requirements.txt + $ pip install -r ../resultsdb/requirements.txt + If you'd rather not install all the dependencies necessary to run the functional tests, you may use Vagrant to provision a throw-away virtual machine to run the tests: