1+ <!DOCTYPE html>
2+ < html class ="writer-html5 " lang ="en " data-content_root ="./ ">
3+ < head >
4+ < meta charset ="utf-8 " /> < meta name ="viewport " content ="width=device-width, initial-scale=1 " />
5+
6+ < meta name ="viewport " content ="width=device-width, initial-scale=1.0 " />
7+ < title > Setting up dev environment — NcPyApi 0.20.2 documentation</ title >
8+ < link rel ="stylesheet " type ="text/css " href ="_static/pygments.css?v=03e43079 " />
9+ < link rel ="stylesheet " type ="text/css " href ="_static/css/theme.css?v=19f00094 " />
10+ < link rel ="stylesheet " type ="text/css " href ="_static/copybutton.css?v=76b2166b " />
11+ < link rel ="stylesheet " type ="text/css " href ="_static/tabs.css?v=4c969af8 " />
12+ < link rel ="stylesheet " type ="text/css " href ="_static/autodoc_pydantic.css " />
13+ < link rel ="stylesheet " type ="text/css " href ="_static/css/styles.css?v=0f758665 " />
14+ < link rel ="stylesheet " type ="text/css " href ="_static/css/dark.css?v=41caee7b " />
15+ < link rel ="stylesheet " type ="text/css " href ="_static/css/light.css?v=c3d70dd7 " />
16+
17+
18+ <!--[if lt IE 9]>
19+ <script src="_static/js/html5shiv.min.js"></script>
20+ <![endif]-->
21+
22+ < script src ="_static/jquery.js?v=5d32c60e "> </ script >
23+ < script src ="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c "> </ script >
24+ < script src ="_static/documentation_options.js?v=26ac6f1e "> </ script >
25+ < script src ="_static/doctools.js?v=9a2dae69 "> </ script >
26+ < script src ="_static/sphinx_highlight.js?v=dc90522c "> </ script >
27+ < script src ="_static/clipboard.min.js?v=a7894cd8 "> </ script >
28+ < script src ="_static/copybutton.js?v=f281be69 "> </ script >
29+ < script src ="_static/tabs.js?v=3ee01567 "> </ script >
30+ < script src ="_static/js/script.js?v=783f4f19 "> </ script >
31+ < script src ="_static/js/theme.js "> </ script >
32+ < link rel ="index " title ="Index " href ="genindex.html " />
33+ < link rel ="search " title ="Search " href ="search.html " />
34+ < link rel ="next " title ="AppAPI Benchmarks " href ="benchmarks/AppAPI.html " />
35+ < link rel ="prev " title ="Webhooks API " href ="reference/Webhooks.html " />
36+ </ head >
37+
38+ < body class ="wy-body-for-nav ">
39+ < div class ="wy-grid-for-nav ">
40+ < nav data-toggle ="wy-nav-shift " class ="wy-nav-side ">
41+ < div class ="wy-side-scroll ">
42+ < div class ="wy-side-nav-search " >
43+
44+
45+
46+ < a href ="index.html ">
47+
48+ < img src ="_static/logo.svg " class ="logo " alt ="Logo "/>
49+ </ a >
50+ < div class ="version ">
51+ 0.20.2
52+ </ div >
53+ < div role ="search ">
54+ < form id ="rtd-search-form " class ="wy-form " action ="search.html " method ="get ">
55+ < input type ="text " name ="q " placeholder ="Search docs " aria-label ="Search docs " />
56+ < input type ="hidden " name ="check_keywords " value ="yes " />
57+ < input type ="hidden " name ="area " value ="default " />
58+ </ form >
59+ </ div >
60+ </ div > < div class ="wy-menu wy-menu-vertical " data-spy ="affix " role ="navigation " aria-label ="Navigation menu ">
61+ < ul class ="current ">
62+ < li class ="toctree-l1 "> < a class ="reference internal " href ="Installation.html "> Installation</ a > </ li >
63+ < li class ="toctree-l1 "> < a class ="reference internal " href ="FirstSteps.html "> First steps</ a > </ li >
64+ < li class ="toctree-l1 "> < a class ="reference internal " href ="MoreAPIs.html "> More APIs</ a > </ li >
65+ < li class ="toctree-l1 "> < a class ="reference internal " href ="NextcloudApp.html "> Writing a Nextcloud Application</ a > </ li >
66+ < li class ="toctree-l1 "> < a class ="reference internal " href ="NextcloudApp3rdParty.html "> Packaging 3rd party software as a Nextcloud Application</ a > </ li >
67+ < li class ="toctree-l1 "> < a class ="reference internal " href ="NextcloudTalkBot.html "> Nextcloud Talk Bot API in Applications</ a > </ li >
68+ < li class ="toctree-l1 "> < a class ="reference internal " href ="NextcloudTalkBotTransformers.html "> Talk Bot App with Transformers</ a > </ li >
69+ < li class ="toctree-l1 "> < a class ="reference internal " href ="NextcloudUiApp.html "> Writing Nextcloud App with UI</ a > </ li >
70+ < li class ="toctree-l1 "> < a class ="reference internal " href ="Options.html "> Options</ a > </ li >
71+ < li class ="toctree-l1 "> < a class ="reference internal " href ="reference/index.html "> Reference</ a > </ li >
72+ < li class ="toctree-l1 current "> < a class ="current reference internal " href ="# "> Setting up dev environment</ a > </ li >
73+ < li class ="toctree-l1 "> < a class ="reference internal " href ="benchmarks/AppAPI.html "> AppAPI Benchmarks</ a > </ li >
74+ </ ul >
75+
76+ </ div >
77+ </ div >
78+ </ nav >
79+
80+ < section data-toggle ="wy-nav-shift " class ="wy-nav-content-wrap "> < nav class ="wy-nav-top " aria-label ="Mobile navigation menu " >
81+ < i data-toggle ="wy-nav-top " class ="fa fa-bars "> </ i >
82+ < a href ="index.html "> NcPyApi</ a >
83+ </ nav >
84+
85+ < div class ="wy-nav-content ">
86+ < div class ="rst-content ">
87+ < div role ="navigation " aria-label ="Page navigation ">
88+ < ul class ="wy-breadcrumbs ">
89+ < li > < a href ="index.html " class ="icon icon-home " aria-label ="Home "> </ a > </ li >
90+ < li class ="breadcrumb-item active "> Setting up dev environment</ li >
91+ < li class ="wy-breadcrumbs-aside ">
92+ < a href ="_sources/DevSetup.rst.txt " rel ="nofollow "> View page source</ a >
93+ </ li >
94+ </ ul >
95+ < hr />
96+ </ div >
97+ < div role ="main " class ="document " itemscope ="itemscope " itemtype ="http://schema.org/Article ">
98+ < div itemprop ="articleBody ">
99+
100+ < section id ="setting-up-dev-environment ">
101+ < h1 > Setting up dev environment< a class ="headerlink " href ="#setting-up-dev-environment " title ="Link to this heading "> </ a > </ h1 >
102+ < p > We highly recommend to use < a class ="reference external " href ="https://github.com/juliushaertl/nextcloud-docker-dev "> Julius Haertl docker setup</ a > for Nextcloud dev setup.</ p >
103+ < p > Development of < cite > nc-py-api</ cite > can be done on any OS as it is a < strong > pure</ strong > Python package.</ p >
104+ < div class ="admonition note ">
105+ < p class ="admonition-title "> Note</ p >
106+ < p > We suggest to use < strong > PyCharm</ strong > , but of course you can use any IDE you like for this like < strong > VS Code</ strong > or < strong > Vim</ strong > .</ p >
107+ </ div >
108+ < p > Steps to setup up the development environment:</ p >
109+ < ol class ="arabic ">
110+ < li > < p > Setup Nextcloud locally or remotely.</ p > </ li >
111+ < li > < p > Install < a class ="reference external " href ="https://github.com/cloud-py-api/app_api "> AppAPI</ a > , follow it’s steps to register < code class ="docutils literal notranslate "> < span class ="pre "> deploy</ span > < span class ="pre "> daemon</ span > </ code > if needed.</ p > </ li >
112+ < li > < p > Clone the < a class ="reference external " href ="https://github.com/cloud-py-api/nc_py_api "> nc_py_api</ a > with < strong class ="command "> shell</ strong > :</ p >
113+ < div class ="highlight-default notranslate "> < div class ="highlight "> < pre > < span > </ span > < span class ="n "> git</ span > < span class ="n "> clone</ span > < span class ="n "> https</ span > < span class ="p "> :</ span > < span class ="o "> //</ span > < span class ="n "> github</ span > < span class ="o "> .</ span > < span class ="n "> com</ span > < span class ="o "> /</ span > < span class ="n "> cloud</ span > < span class ="o "> -</ span > < span class ="n "> py</ span > < span class ="o "> -</ span > < span class ="n "> api</ span > < span class ="o "> /</ span > < span class ="n "> nc_py_api</ span > < span class ="o "> .</ span > < span class ="n "> git</ span >
114+ </ pre > </ div >
115+ </ div >
116+ </ li >
117+ < li > < p > Set current working dir to the root folder of cloned < strong > nc_py_api</ strong > with < strong class ="command "> shell</ strong > :</ p >
118+ < div class ="highlight-default notranslate "> < div class ="highlight "> < pre > < span > </ span > < span class ="n "> cd</ span > < span class ="n "> nc_py_api</ span >
119+ </ pre > </ div >
120+ </ div >
121+ </ li >
122+ < li > < p > Create and activate Virtual Environment with < strong class ="command "> shell</ strong > :</ p >
123+ < div class ="highlight-default notranslate "> < div class ="highlight "> < pre > < span > </ span > < span class ="n "> python3</ span > < span class ="o "> -</ span > < span class ="n "> m</ span > < span class ="n "> venv</ span > < span class ="n "> env</ span >
124+ </ pre > </ div >
125+ </ div >
126+ </ li >
127+ < li > < p > Activate Python Virtual Environment with < strong class ="command "> shell</ strong > :</ p >
128+ < div class ="highlight-default notranslate "> < div class ="highlight "> < pre > < span > </ span > < span class ="n "> source</ span > < span class ="o "> ./</ span > < span class ="n "> env</ span > < span class ="o "> /</ span > < span class ="nb "> bin</ span > < span class ="o "> /</ span > < span class ="n "> activate</ span >
129+ </ pre > </ div >
130+ </ div >
131+ </ li >
132+ < li > < p > Update < code class ="docutils literal notranslate "> < span class ="pre "> pip</ span > </ code > to the last version with < strong class ="command "> pip</ strong > :</ p >
133+ < div class ="highlight-default notranslate "> < div class ="highlight "> < pre > < span > </ span > < span class ="n "> python3</ span > < span class ="o "> -</ span > < span class ="n "> m</ span > < span class ="n "> pip</ span > < span class ="n "> install</ span > < span class ="o "> --</ span > < span class ="n "> upgrade</ span > < span class ="n "> pip</ span >
134+ </ pre > </ div >
135+ </ div >
136+ </ li >
137+ < li > < p > Install dev-dependencies with < strong class ="command "> pip</ strong > :</ p >
138+ < div class ="highlight-default notranslate "> < div class ="highlight "> < pre > < span > </ span > < span class ="n "> pip</ span > < span class ="n "> install</ span > < span class ="s2 "> ".[dev]"</ span >
139+ </ pre > </ div >
140+ </ div >
141+ </ li >
142+ < li > < p > Install < cite > pre-commit</ cite > hooks with < strong class ="command "> shell</ strong > :</ p >
143+ < div class ="highlight-default notranslate "> < div class ="highlight "> < pre > < span > </ span > < span class ="n "> pre</ span > < span class ="o "> -</ span > < span class ="n "> commit</ span > < span class ="n "> install</ span >
144+ </ pre > </ div >
145+ </ div >
146+ </ li >
147+ < li > < p > Run < cite > nc_py_api</ cite > with appropriate PyCharm configuration(< code class ="docutils literal notranslate "> < span class ="pre "> register_nc_py_api(xx)</ span > </ code > ) or if you are not using PyCharm execute this command in the < strong class ="command "> shell</ strong > :</ p >
148+ < div class ="highlight-default notranslate "> < div class ="highlight "> < pre > < span > </ span > < span class ="n "> APP_ID</ span > < span class ="o "> =</ span > < span class ="n "> nc_py_api</ span > < span class ="n "> APP_PORT</ span > < span class ="o "> =</ span > < span class ="mi "> 9009</ span > < span class ="n "> APP_SECRET</ span > < span class ="o "> =</ span > < span class ="mi "> 12345</ span > < span class ="n "> APP_VERSION</ span > < span class ="o "> =</ span > < span class ="mf "> 1.0.0</ span > < span class ="n "> NEXTCLOUD_URL</ span > < span class ="o "> =</ span > < span class ="n "> http</ span > < span class ="p "> :</ span > < span class ="o "> //</ span > < span class ="n "> nextcloud</ span > < span class ="o "> .</ span > < span class ="n "> local</ span > < span class ="n "> APP_HOST</ span > < span class ="o "> =</ span > < span class ="mf "> 0.0.0.0</ span > < span class ="n "> python3</ span > < span class ="n "> tests</ span > < span class ="o "> /</ span > < span class ="n "> _install</ span > < span class ="o "> .</ span > < span class ="n "> py</ span >
149+ </ pre > </ div >
150+ </ div >
151+ </ li >
152+ < li > < p > In a separate terminal while the < code class ="docutils literal notranslate "> < span class ="pre "> nc_py_api</ span > </ code > < strong > _install.py</ strong > script is running execute this command in the < strong class ="command "> shell</ strong > :</ p >
153+ < div class ="highlight-default notranslate "> < div class ="highlight "> < pre > < span > </ span > < span class ="n "> make</ span > < span class ="n "> register28</ span >
154+ </ pre > </ div >
155+ </ div >
156+ </ li >
157+ < li > < p > In < code class ="docutils literal notranslate "> < span class ="pre "> tests/gfixture.py</ span > </ code > edit < code class ="docutils literal notranslate "> < span class ="pre "> NC_AUTH_USER</ span > </ code > and < code class ="docutils literal notranslate "> < span class ="pre "> NC_AUTH_PASS</ span > </ code > , if they are different in your setup.</ p > </ li >
158+ < li > < p > Run tests to check that everything works with < strong class ="command "> shell</ strong > :</ p >
159+ < div class ="highlight-default notranslate "> < div class ="highlight "> < pre > < span > </ span > < span class ="n "> python3</ span > < span class ="o "> -</ span > < span class ="n "> m</ span > < span class ="n "> pytest</ span >
160+ </ pre > </ div >
161+ </ div >
162+ </ li >
163+ < li > < p > Install documentation dependencies if needed with < strong class ="command "> pip</ strong > :</ p >
164+ < div class ="highlight-default notranslate "> < div class ="highlight "> < pre > < span > </ span > < span class ="n "> pip</ span > < span class ="n "> install</ span > < span class ="s2 "> ".[docs]"</ span >
165+ </ pre > </ div >
166+ </ div >
167+ </ li >
168+ < li > < p > You can easy build documentation with < strong class ="command "> shell</ strong > :</ p >
169+ < div class ="highlight-default notranslate "> < div class ="highlight "> < pre > < span > </ span > < span class ="n "> make</ span > < span class ="n "> docs</ span >
170+ </ pre > </ div >
171+ </ div >
172+ </ li >
173+ < li > < p > < strong > Your setup is ready for the developing nc_py_api and Applications based on it. Best of Luck!</ strong > </ p > </ li >
174+ </ ol >
175+ </ section >
176+
177+
178+ </ div >
179+ </ div >
180+ < footer > < div class ="rst-footer-buttons " role ="navigation " aria-label ="Footer ">
181+ < a href ="reference/Webhooks.html " class ="btn btn-neutral float-left " title ="Webhooks API " accesskey ="p " rel ="prev "> < span class ="fa fa-arrow-circle-left " aria-hidden ="true "> </ span > Previous</ a >
182+ < a href ="benchmarks/AppAPI.html " class ="btn btn-neutral float-right " title ="AppAPI Benchmarks " accesskey ="n " rel ="next "> Next < span class ="fa fa-arrow-circle-right " aria-hidden ="true "> </ span > </ a >
183+ </ div >
184+
185+ < hr />
186+
187+ < div role ="contentinfo ">
188+ < p > © Copyright 2025 NcPyApi Authors.</ p >
189+ </ div >
190+
191+ Built with < a href ="https://www.sphinx-doc.org/ "> Sphinx</ a > using a
192+ < a href ="https://github.com/readthedocs/sphinx_rtd_theme "> theme</ a >
193+ provided by < a href ="https://readthedocs.org "> Read the Docs</ a > .
194+
195+
196+ </ footer >
197+ </ div >
198+ </ div >
199+ </ section >
200+ </ div >
201+ < script >
202+ jQuery ( function ( ) {
203+ SphinxRtdTheme . Navigation . enable ( true ) ;
204+ } ) ;
205+ </ script >
206+
207+ </ body >
208+ </ html >
0 commit comments