Setting up dev environment

We highly recommend to use Julius Haertl docker setup for Nextcloud dev setup.

Development of nc-py-api can be done on any OS as it is a pure Python package.

Suggested IDE: PyCharm, but of course you can use any IDE you like for this like VS Code or Vim.

Steps to setup up the development environment:

  1. Setup Nextcloud locally or remotely.

  2. Install AppAPI, follow it’s steps to register deploy daemon if needed.

  3. Clone the nc_py_api with shell:

    git clone https://github.com/cloud-py-api/nc_py_api.git
    
  4. Set current working dir to the root folder of cloned nc_py_api with shell:

    cd nc_py_api
    
  5. Create and activate Virtual Environment with shell:

    python3 -m venv env
    
  6. Activate Python Virtual Environment with shell:

    source ./env/bin/activate
    
  7. Update pip to the last version with pip:

    python3 -m pip install --upgrade pip
    
  8. Install dev-dependencies with pip:

    pip install ".[dev]"
    
  9. Install pre-commit hooks with shell:

    pre-commit install
    
  10. If deploy daemon is registered for AppAPI, register nc_py_api as an application with shell:

    make register28
    
  11. In tests/gfixture.py edit NC_AUTH_USER and NC_AUTH_PASS, if they are different in your setup.

  12. Run tests to check that everything works with shell:

    python3 -m pytest
    
  13. Install documentation dependencies if needed with pip:

    pip install ".[docs]"
    
  14. You can easy build documentation with shell:

    make docs
    
  15. Your setup is ready for the developing nc_py_api and Applications based on it. Best of Luck!