|
| 1 | +Developer Workflow |
| 2 | +================== |
| 3 | + |
| 4 | +This project uses the `GitHub Flow`_ for collaboration and consists of Python code and |
| 5 | +Javascript code. A variety of tools are used to aid in its development. Below is a short |
| 6 | +list of the tools which will be most commonly referenced in the sections to follow: |
| 7 | + |
| 8 | +.. list-table:: |
| 9 | + :header-rows: 1 |
| 10 | + |
| 11 | + * - Tool |
| 12 | + - Used For |
| 13 | + |
| 14 | + * - Git_ |
| 15 | + - version control |
| 16 | + |
| 17 | + * - Nox_ |
| 18 | + - automating development tasks. |
| 19 | + |
| 20 | + * - PyTest_ |
| 21 | + - executing the Python-based test suite |
| 22 | + |
| 23 | + * - pre-commit_ |
| 24 | + - helping impose basic syle guidelines |
| 25 | + |
| 26 | + * - NPM_ |
| 27 | + - managing and installing Javascript packages |
| 28 | + |
| 29 | + * - Selenium_ and ChromeDriver_ |
| 30 | + - to control the browser while testing |
| 31 | + |
| 32 | + * - `GitHub Actions`_ |
| 33 | + - hosting and running our CI/CD suite |
| 34 | + |
| 35 | + * - Docker_ and Heroku_ |
| 36 | + - containerizing and hosting this documentation |
| 37 | + |
| 38 | + |
| 39 | +Development Environment |
| 40 | +----------------------- |
| 41 | + |
| 42 | +In order to work with IDOM's source code you'll need to install Git_ (or `Git Bash`_ on |
| 43 | +Windows). Once done you can clone a local copy of this repository: |
| 44 | + |
| 45 | +.. code-block:: bash |
| 46 | +
|
| 47 | + git clone https://github.com/rmorshea/idom.git |
| 48 | + cd idom |
| 49 | +
|
| 50 | +At this point you should be able to run the command below to: |
| 51 | + |
| 52 | +- Install an editable version of the Python code |
| 53 | + |
| 54 | +- Download, build, and install Javascript dependencies |
| 55 | + |
| 56 | +- Install some pre-commit hooks for Git |
| 57 | + |
| 58 | +.. code-block:: bash |
| 59 | +
|
| 60 | + pip install -e . -r requirements.txt && pre-commit install |
| 61 | +
|
| 62 | +If you modify any Javascript, you'll need to re-install IDOM: |
| 63 | + |
| 64 | +.. code-block:: bash |
| 65 | +
|
| 66 | + pip install -e . |
| 67 | +
|
| 68 | +However you may also ``cd`` to the ``idom/client/app`` directory which contains a |
| 69 | +``package.json`` that you can use to run standard ``npm`` commands from. |
| 70 | + |
| 71 | + |
| 72 | +Running The Tests |
| 73 | +----------------- |
| 74 | + |
| 75 | +The test suite for IDOM is executed using Nox_ and covers: |
| 76 | + |
| 77 | +1. Server-side Python code with PyTest_ |
| 78 | + |
| 79 | +2. The end-to-end application using Selenium_ |
| 80 | + |
| 81 | +To run the full suite of tests you'll need to install: |
| 82 | + |
| 83 | +- `Google Chrome`_ |
| 84 | + |
| 85 | +- ChromeDriver_. |
| 86 | + |
| 87 | +.. warning:: |
| 88 | + |
| 89 | + Be sure the version of `Google Chrome`_ and ChromeDriver_ you install are compatible. |
| 90 | + |
| 91 | +Once you've installed the aforementined browser and web driver you should be able to |
| 92 | +run: |
| 93 | + |
| 94 | +.. code-block:: bash |
| 95 | +
|
| 96 | + nox -s test |
| 97 | +
|
| 98 | +If you prefer to run the tests using a headless browser: |
| 99 | + |
| 100 | +.. code-block:: bash |
| 101 | +
|
| 102 | + nox -s test -- pytest[--headless] |
| 103 | +
|
| 104 | +
|
| 105 | +Building The Documentation |
| 106 | +-------------------------- |
| 107 | + |
| 108 | +To build and display the documentation simply run: |
| 109 | + |
| 110 | +.. code-block:: bash |
| 111 | +
|
| 112 | + nox -s docs |
| 113 | +
|
| 114 | +This will compile the documentation from its source files into HTML, start a web server, |
| 115 | +and open a browser to display the now generated documentation. Whenever you change any |
| 116 | +source files the web server will automatically rebuild the documentation and refresh the |
| 117 | +page. Under the hood this is using |
| 118 | +`sphinx-autobuild <https://github.com/executablebooks/sphinx-autobuild>`__. |
| 119 | + |
| 120 | +To run some of the examples in the documentation as if they were tests run: |
| 121 | + |
| 122 | +.. code-block:: |
| 123 | +
|
| 124 | + nox -s test_docs |
| 125 | +
|
| 126 | +Building the documentation as it's deployed in production requires Docker_. Once you've |
| 127 | +installed, you can run: |
| 128 | + |
| 129 | +.. code-block:: bash |
| 130 | +
|
| 131 | + nox -s docs_in_docker |
| 132 | +
|
| 133 | +You should then navigate to to see the documentation. |
| 134 | + |
| 135 | + |
| 136 | +Making a Pull Request |
| 137 | +--------------------- |
| 138 | + |
| 139 | +Under construction... |
| 140 | + |
| 141 | + |
| 142 | +Release Process |
| 143 | +--------------- |
| 144 | + |
| 145 | +Under construction... |
| 146 | + |
| 147 | + |
| 148 | +How It's Published to PyPI |
| 149 | +.......................... |
| 150 | + |
| 151 | +Under construction... |
| 152 | + |
| 153 | + |
| 154 | +How Docs are Deployed to Heroku |
| 155 | +............................... |
| 156 | + |
| 157 | +Under construction... |
| 158 | + |
| 159 | + |
| 160 | +Other Core Repositories |
| 161 | +----------------------- |
| 162 | + |
| 163 | +IDOM involves several other core projects. For documentation on them you should refer to |
| 164 | +their respective documentation in the links below |
| 165 | + |
| 166 | +- https://github.com/idom-team/idom-client-react - Javascript client for IDOM |
| 167 | +- https://github.com/idom-team/flake8-idom-hooks - Enforces the :ref:`Rules of Hooks` |
| 168 | + |
| 169 | + |
| 170 | +.. Links |
| 171 | +.. ===== |
| 172 | +
|
| 173 | +.. _Google Chrome: https://www.google.com/chrome/ |
| 174 | +.. _ChromeDriver: https://chromedriver.chromium.org/downloads |
| 175 | +.. _Docker: https://docs.docker.com/get-docker/ |
| 176 | +.. _Git: https://git-scm.com/book/en/v2/Getting-Started-Installing-Git |
| 177 | +.. _Git Bash: https://gitforwindows.org/ |
| 178 | +.. _NPM: https://www.npmjs.com/get-npm |
| 179 | +.. _PyPI: https://pypi.org/project/idom |
| 180 | +.. _pip: https://pypi.org/project/pip/ |
| 181 | +.. _PyTest: pytest <https://docs.pytest.org |
| 182 | +.. _Selenium: https://www.seleniumhq.org/ |
| 183 | +.. _Nox: https://nox.thea.codes/en/stable/# |
| 184 | +.. _React: https://reactjs.org/ |
| 185 | +.. _Heroku: https://www.heroku.com/what |
| 186 | +.. _GitHub Actions: https://github.com/features/actions |
| 187 | +.. _pre-commit: https://pre-commit.com/ |
| 188 | +.. _GitHub Flow: https://guides.github.com/introduction/flow/ |
0 commit comments