|
| 1 | +Developer Installation |
| 2 | +====================== |
| 3 | + |
| 4 | +In order to work with IDOM's source code you'll need to install: |
| 5 | + |
| 6 | +- git_ |
| 7 | + |
| 8 | +- npm_ |
| 9 | + |
| 10 | +You'll begin by copying the source from GitHub onto your computer using Git: |
| 11 | + |
| 12 | +.. code-block:: bash |
| 13 | +
|
| 14 | + git clone https://github.com/rmorshea/idom.git |
| 15 | + cd idom |
| 16 | +
|
| 17 | +At this point you should be able to run the command below to: |
| 18 | + |
| 19 | +- Install an editable version of the Python code |
| 20 | + |
| 21 | +- Download, build, and install Javascript dependencies |
| 22 | + |
| 23 | +- Install some pre-commit hooks for Git |
| 24 | + |
| 25 | +.. code-block:: bash |
| 26 | +
|
| 27 | + pip install -e . -r requirements.txt && pre-commit install |
| 28 | +
|
| 29 | +Since we're using native ES modules for our Javascript, you should usually be able to |
| 30 | +refresh your browser page to see your latest changes to the client. However if you |
| 31 | +modify any dependencies you can run standard ``npm`` commands to install them or |
| 32 | +simply run the following to re-evaluate the ``package.json``: |
| 33 | + |
| 34 | +.. code-block:: bash |
| 35 | +
|
| 36 | + pip install -e . |
| 37 | +
|
| 38 | +
|
| 39 | +Running The Tests |
| 40 | +----------------- |
| 41 | + |
| 42 | +The test suite for IDOM is executed using Nox_ and covers: |
| 43 | + |
| 44 | +1. Server-side Python code with PyTest_ |
| 45 | + |
| 46 | +2. The end-to-end application using Selenium_ |
| 47 | + |
| 48 | +3. (`Coming soon <https://github.com/idom-team/idom/issues/195>`_) Client side Javascript code |
| 49 | + |
| 50 | +To run the full suite of tests you'll need to install: |
| 51 | + |
| 52 | +- `Google Chrome`_ |
| 53 | + |
| 54 | +- ChromeDriver_. |
| 55 | + |
| 56 | +.. warning:: |
| 57 | + |
| 58 | + Be sure the version of `Google Chrome`_ and ChromeDriver_ you install are compatible. |
| 59 | + |
| 60 | +Once you've installed the aforementined browser and web driver you should be able to |
| 61 | +run: |
| 62 | + |
| 63 | +.. code-block:: bash |
| 64 | +
|
| 65 | + nox |
| 66 | +
|
| 67 | +If you prefer to run the tests using a headless browser: |
| 68 | + |
| 69 | +.. code-block:: bash |
| 70 | +
|
| 71 | + HEADLESS=1 nox |
| 72 | +
|
| 73 | +
|
| 74 | +Building The Documentation |
| 75 | +-------------------------- |
| 76 | + |
| 77 | +Building the documentation as it's deployed in production requires Docker_. Once you've |
| 78 | +installed ``docker`` you'll need to build and then run a container with the service: |
| 79 | + |
| 80 | +.. code-block:: bash |
| 81 | +
|
| 82 | + docker build . --file docs/Dockerfile --tag idom-docs:latest |
| 83 | + docker run -it -p 5000:5000 -e DEBUG=true --rm idom-docs:latest |
| 84 | +
|
| 85 | +You should then navigate to http://127.0.0.1:5000 to see the documentation. |
| 86 | + |
| 87 | + |
| 88 | +.. Links |
| 89 | +.. ===== |
| 90 | +
|
| 91 | +.. _Google Chrome: https://www.google.com/chrome/ |
| 92 | +.. _ChromeDriver: https://chromedriver.chromium.org/downloads |
| 93 | +.. _Docker: https://docs.docker.com/get-docker/ |
| 94 | +.. _git: https://git-scm.com/book/en/v2/Getting-Started-Installing-Git |
| 95 | +.. _Git Bash: https://gitforwindows.org/ |
| 96 | +.. _npm: https://www.npmjs.com/get-npm |
| 97 | +.. _PyPI: https://pypi.org/project/idom |
| 98 | +.. _pip: https://pypi.org/project/pip/ |
| 99 | +.. _PyTest: pytest <https://docs.pytest.org |
| 100 | +.. _Selenium: https://www.seleniumhq.org/ |
| 101 | +.. _Nox: https://nox.thea.codes/en/stable/# |
0 commit comments