|
| 1 | +Setting up dev environment |
| 2 | +========================== |
| 3 | + |
| 4 | +We highly recommend to use `Julius Haertl docker setup <https://github.com/juliushaertl/nextcloud-docker-dev>`_ for Nextcloud dev setup. |
| 5 | + |
| 6 | +Development of `nc-py-api` can be done on any OS as it is a **pure** Python package. |
| 7 | + |
| 8 | +Suggested IDE: **PyCharm**, but of course you can use any IDE you like for this like **VS Code** or **Vim**. |
| 9 | + |
| 10 | +Steps to setup up the development environment: |
| 11 | + |
| 12 | +#. Setup Nextcloud locally or remotely. |
| 13 | +#. Install `AppEcosystem <https://github.com/cloud-py-api/app_ecosystem_v2>`_, follow it's steps to register ``deploy daemon`` if needed. |
| 14 | +#. Clone the `nc_py_api <https://github.com/cloud-py-api/nc_py_api>`_ with :command:`shell`:: |
| 15 | + |
| 16 | + git clone https://github.com/cloud-py-api/nc_py_api.git |
| 17 | + |
| 18 | +#. Set current working dir to the root folder of cloned **nc_py_api** with :command:`shell`:: |
| 19 | + |
| 20 | + cd nc_py_api |
| 21 | + |
| 22 | +#. Create and activate Virtual Environment with :command:`shell`:: |
| 23 | + |
| 24 | + python3 -m venv env |
| 25 | + |
| 26 | +#. Activate Python Virtual Environment with :command:`shell`:: |
| 27 | + |
| 28 | + source ./env/bin/activate |
| 29 | + |
| 30 | +#. Update ``pip`` to the last version with :command:`pip`:: |
| 31 | + |
| 32 | + python3 -m pip install --upgrade pip |
| 33 | + |
| 34 | +#. Install dev-dependencies with :command:`pip`:: |
| 35 | + |
| 36 | + pip install ".[dev]" |
| 37 | + |
| 38 | +#. Install `pre-commit` hooks with :command:`shell`:: |
| 39 | + |
| 40 | + pre-commit install |
| 41 | + |
| 42 | +#. If ``deploy daemon`` is registered for AppEcosystem, register **nc_py_api** as an application with :command:`shell`:: |
| 43 | + |
| 44 | + make register28 |
| 45 | + |
| 46 | +#. In ``tests/gfixture.py`` edit ``NC_AUTH_USER`` and ``NC_AUTH_PASS``, if they are different in your setup. |
| 47 | +#. Run tests to check that everything works with :command:`shell`:: |
| 48 | + |
| 49 | + python3 -m pytest |
| 50 | + |
| 51 | +#. Install documentation dependencies if needed with :command:`pip`:: |
| 52 | + |
| 53 | + pip install ".[docs]" |
| 54 | + |
| 55 | +#. You can easy build documentation with :command:`shell`:: |
| 56 | + |
| 57 | + make docs |
| 58 | + |
| 59 | +#. **Your setup is ready for the developing nc_py_api and Applications based on it. Best of Luck!** |
0 commit comments