|
| 1 | +Installation |
| 2 | +============ |
| 3 | + |
| 4 | +.. list-table:: |
| 5 | + :header-rows: 1 |
| 6 | + |
| 7 | + * - What |
| 8 | + - How To Install |
| 9 | + |
| 10 | + * - The Core Library |
| 11 | + - IDOM is on PyPI_ - use pip_ to install a **stable** version: |
| 12 | + |
| 13 | + .. code-block:: bash |
| 14 | +
|
| 15 | + pip install idom[stable] |
| 16 | +
|
| 17 | + * - Javascript Packages |
| 18 | + - To allow IDOM to install Javascript libraries you'll need npm_. |
| 19 | + |
| 20 | + * - Extra Features |
| 21 | + |
| 22 | + - To install *specific* features see :ref:`Extra Features`, but to install all of them: |
| 23 | + |
| 24 | + .. code-block:: bash |
| 25 | +
|
| 26 | + # all extra features |
| 27 | + pip install idom[all] |
| 28 | +
|
| 29 | + * - Pre Release |
| 30 | + - This may be unstable or subject to breaking changes |
| 31 | + |
| 32 | + .. code-block:: bash |
| 33 | +
|
| 34 | + pip install idom --pre |
| 35 | +
|
| 36 | +
|
| 37 | +Development Version |
| 38 | +------------------- |
| 39 | + |
| 40 | +In order to work with IDOM's source code you'll need to install: |
| 41 | + |
| 42 | +- git_ |
| 43 | + |
| 44 | +- npm_ |
| 45 | + |
| 46 | +You'll begin by copy the source from GitHub onto your computer using Git: |
| 47 | + |
| 48 | +.. code-block:: bash |
| 49 | +
|
| 50 | + git clone https://github.com/rmorshea/idom.git |
| 51 | + cd idom |
| 52 | +
|
| 53 | +At this point you should be able to run this install command to: |
| 54 | + |
| 55 | +- Install an editable version of the Python code |
| 56 | + |
| 57 | +- Download, build, and install Javascript dependencies |
| 58 | + |
| 59 | +- Install some pre-commit hooks for Git |
| 60 | + |
| 61 | +.. code-block:: bash |
| 62 | +
|
| 63 | + pip install -e . -r requirements.txt && pre-commit install |
| 64 | +
|
| 65 | +Since we're using native ES modules for our Javascript, you should usually be able to |
| 66 | +refresh your browser page to see your latest changes to the client. However if you |
| 67 | +modify any dependencies you can run standard ``npm`` commands to install them or |
| 68 | +simply run the following to re-evaluate the ``package.json``: |
| 69 | + |
| 70 | +.. code-block:: bash |
| 71 | +
|
| 72 | + pip install -e . |
| 73 | +
|
| 74 | +
|
| 75 | +Running The Test |
| 76 | +---------------- |
| 77 | + |
| 78 | +The test suite for IDOM covers: |
| 79 | + |
| 80 | +1. Server-side Python code using PyTest_ |
| 81 | + |
| 82 | +2. The end-to-end application using Selenium_ |
| 83 | + |
| 84 | +3. (Coming soon...) Client side Javascript code |
| 85 | + |
| 86 | +To run the full suite of tests you'll need to install: |
| 87 | + |
| 88 | +- `Google Chrome`_ |
| 89 | + |
| 90 | +- ChromeDriver_. |
| 91 | + |
| 92 | +.. warning:: |
| 93 | + |
| 94 | + Be sure the version of `Google Chrome`_ and ChromeDriver_ you install are compatible. |
| 95 | + |
| 96 | +Once you've installed the aforementined browser and web driver you should be able to |
| 97 | +run: |
| 98 | + |
| 99 | +.. code-block:: bash |
| 100 | +
|
| 101 | + pytest src/tests |
| 102 | +
|
| 103 | +If you prefer to run the tests using a headless browser: |
| 104 | + |
| 105 | +.. code-block:: bash |
| 106 | +
|
| 107 | + pytest src/tests --headless |
| 108 | +
|
| 109 | +.. Links |
| 110 | +.. ===== |
| 111 | +
|
| 112 | +.. _Google Chrome: https://www.google.com/chrome/ |
| 113 | +.. _ChromeDriver: https://chromedriver.chromium.org/downloads |
| 114 | +.. _git: https://git-scm.com/book/en/v2/Getting-Started-Installing-Git |
| 115 | +.. _Git Bash: https://gitforwindows.org/ |
| 116 | +.. _npm: https://www.npmjs.com/get-npm |
| 117 | +.. _PyPI: https://pypi.org/project/idom |
| 118 | +.. _pip: https://pypi.org/project/pip/ |
| 119 | +.. _PyTest: pytest <https://docs.pytest.org |
| 120 | +.. _Selenium: https://www.seleniumhq.org/ |
0 commit comments