diff --git a/Makefile b/Makefile index 789460c3..5ff83b1d 100644 --- a/Makefile +++ b/Makefile @@ -12,15 +12,36 @@ help: @echo " html make HTML docs" @echo " " @echo " Next commands are only for dev environment with nextcloud-docker-dev!" - @echo " register register nc_py_api in host as an application(requires activated venv)" - @echo " this should run from the host you are developing on, not in a container with Nextcloud" - @echo " and only last Nextcloud version(28) is supported, for other versions tests runs on GitHub" - @echo " tests run nc_py_api tests to check that registration was successful" - -.PHONY: register -register: - /bin/sh scripts/dev_register.sh - -.PHONY: tests -tests: - python3 -m pytest + @echo " They should run from the host you are developing on(with activated venv) and not in the container with Nextcloud!" + @echo " " + @echo " register28 register nc_py_api for Nextcloud 28" + @echo " register27 register nc_py_api for Nextcloud 27" + @echo " register26 register nc_py_api for Nextcloud 26" + @echo " " + @echo " tests28 run nc_py_api tests for Nextcloud 28" + @echo " tests27 run nc_py_api tests for Nextcloud 27" + @echo " tests26 run nc_py_api tests for Nextcloud 26" + +.PHONY: register28 +register28: + /bin/sh scripts/dev_register.sh master-nextcloud-1 nextcloud.local + +.PHONY: register27 +register27: + /bin/sh scripts/dev_register.sh master-stable27-1 stable27.local + +.PHONY: register26 +register26: + /bin/sh scripts/dev_register.sh master-stable26-1 stable26.local + +.PHONY: tests28 +tests28: + NEXTCLOUD_URL=http://nextcloud.local python3 -m pytest + +.PHONY: tests27 +tests27: + NEXTCLOUD_URL=http://stable27.local python3 -m pytest + +.PHONY: tests26 +tests26: + NEXTCLOUD_URL=http://stable26.local python3 -m pytest diff --git a/benchmarks/ae_overhead_common.py b/benchmarks/ae_overhead_common.py new file mode 100644 index 00000000..b573cf82 --- /dev/null +++ b/benchmarks/ae_overhead_common.py @@ -0,0 +1,74 @@ +import sys + +import matplotlib.pyplot as plt +import numpy as np +from conf import NC_CFGS, init_nc, init_nc_app, init_nc_by_app_pass + +NC_VERSIONS = [] + + +def measure_overhead(measure, title: str): + penguin_means = { + "Password": [], + "AppPassword": [], + "AppEcosystem": [], + } + + for k, v in NC_CFGS.items(): + NC_VERSIONS.append(init_nc_app(k, v).srv_version["string"]) + + for k, v in NC_CFGS.items(): + nc = init_nc(k, v) + if nc: + result_nc, time_nc = measure(nc) + penguin_means["Password"].append(time_nc) + else: + penguin_means["Password"].append(0) + + nc_ap = init_nc_by_app_pass(k, v) + if nc_ap: + result_nc_ap, time_nc_ap = measure(nc_ap) + penguin_means["AppPassword"].append(time_nc_ap) + else: + penguin_means["AppPassword"].append(0) + + nc_ae = init_nc_app(k, v) + result_nc_ae, time_nc_ae = measure(nc_ae) + penguin_means["AppEcosystem"].append(time_nc_ae) + + # Uncomment only for functions that return predictable values. + # if result_nc is not None: + # assert result_nc == result_nc_ae + # if result_nc_ap is not None: + # assert result_nc_ap == result_nc_ae + + penguin_means = {k: v for k, v in penguin_means.items() if v} + + x = np.arange(len(NC_VERSIONS)) # the label locations + width = 0.25 # the width of the bars + multiplier = 0 + + fig, ax = plt.subplots(layout="constrained") + + for attribute, measurement in penguin_means.items(): + offset = width * multiplier + rects = ax.bar(x + offset, measurement, width, label=attribute) + ax.bar_label(rects, padding=3) + multiplier += 1 + + ax.set_ylabel("Time to execute") + ax.set_title(title) + ax.set_xticks(x + width, NC_VERSIONS) + ax.legend(loc="upper left", ncols=3) + values = [] + for v in penguin_means.values(): + values.append(max(v)) + ax.set_ylim(0, max(values) + 0.18 * max(values)) + + +def os_id(): + if sys.platform.lower() == "darwin": + return "macOS" + elif sys.platform.lower() == "win32": + return "Windows" + return "Linux" diff --git a/benchmarks/ae_overhead_dav_download.py b/benchmarks/ae_overhead_dav_download.py new file mode 100644 index 00000000..f8f4b8f5 --- /dev/null +++ b/benchmarks/ae_overhead_dav_download.py @@ -0,0 +1,33 @@ +from getpass import getuser +from random import randbytes +from time import perf_counter +from typing import Any, Union + +import matplotlib.pyplot as plt +from ae_overhead_common import measure_overhead, os_id +from cpuinfo import get_cpu_info + +from nc_py_api import Nextcloud, NextcloudApp + +ITERS = 30 +CACHE_SESS = False + + +def measure_download_1mb(nc_obj: Union[Nextcloud, NextcloudApp]) -> [Any, float]: + __result = None + small_file_name = "1Mb.bin" + small_file = randbytes(1024 * 1024) + nc_obj.files.upload(small_file_name, small_file) + start_time = perf_counter() + for _ in range(ITERS): + nc_obj.files.download(small_file_name) + nc_obj._session.init_adapter(restart=not CACHE_SESS) # noqa + end_time = perf_counter() + nc_obj.files.delete(small_file_name, not_fail=True) + return __result, round((end_time - start_time) / ITERS, 3) + + +if __name__ == "__main__": + title = f"download 1mb({ITERS} iters, CACHE={CACHE_SESS}) - {os_id()}, {get_cpu_info()['brand_raw']}" + measure_overhead(measure_download_1mb, title) + plt.savefig(f"results/dav_download_1mb__cache{int(CACHE_SESS)}_iters{ITERS}__{getuser()}.png", dpi=200) diff --git a/benchmarks/ae_overhead_dav_download_stream.py b/benchmarks/ae_overhead_dav_download_stream.py new file mode 100644 index 00000000..841ef9d1 --- /dev/null +++ b/benchmarks/ae_overhead_dav_download_stream.py @@ -0,0 +1,37 @@ +from getpass import getuser +from io import BytesIO +from random import randbytes +from time import perf_counter +from typing import Any, Union + +import matplotlib.pyplot as plt +from ae_overhead_common import measure_overhead, os_id +from cpuinfo import get_cpu_info + +from nc_py_api import Nextcloud, NextcloudApp + +ITERS = 10 +CACHE_SESS = False + + +def measure_download_100mb(nc_obj: Union[Nextcloud, NextcloudApp]) -> [Any, float]: + __result = None + medium_file_name = "100Mb.bin" + medium_file = BytesIO() + medium_file.write(randbytes(100 * 1024 * 1024)) + medium_file.seek(0) + nc_obj.files.upload_stream(medium_file_name, medium_file) + start_time = perf_counter() + for _ in range(ITERS): + medium_file.seek(0) + nc_obj.files.download2stream(medium_file_name, medium_file) + nc_obj._session.init_adapter(restart=not CACHE_SESS) # noqa + end_time = perf_counter() + nc_obj.files.delete(medium_file_name, not_fail=True) + return __result, round((end_time - start_time) / ITERS, 3) + + +if __name__ == "__main__": + title = f"download stream 100mb({ITERS} iters, CACHE={CACHE_SESS}) - {os_id()}, {get_cpu_info()['brand_raw']}" + measure_overhead(measure_download_100mb, title) + plt.savefig(f"results/dav_download_stream_100mb__cache{int(CACHE_SESS)}_iters{ITERS}__{getuser()}.png", dpi=200) diff --git a/benchmarks/ae_overhead_dav_upload.py b/benchmarks/ae_overhead_dav_upload.py new file mode 100644 index 00000000..0ca25d13 --- /dev/null +++ b/benchmarks/ae_overhead_dav_upload.py @@ -0,0 +1,32 @@ +from getpass import getuser +from random import randbytes +from time import perf_counter +from typing import Any, Union + +import matplotlib.pyplot as plt +from ae_overhead_common import measure_overhead, os_id +from cpuinfo import get_cpu_info + +from nc_py_api import Nextcloud, NextcloudApp + +ITERS = 30 +CACHE_SESS = False + + +def measure_upload_1mb(nc_obj: Union[Nextcloud, NextcloudApp]) -> [Any, float]: + __result = None + small_file_name = "1Mb.bin" + small_file = randbytes(1024 * 1024) + start_time = perf_counter() + for _ in range(ITERS): + nc_obj.files.upload(small_file_name, small_file) + nc_obj._session.init_adapter(restart=not CACHE_SESS) # noqa + end_time = perf_counter() + nc_obj.files.delete(small_file_name, not_fail=True) + return __result, round((end_time - start_time) / ITERS, 3) + + +if __name__ == "__main__": + title = f"upload 1mb({ITERS} iters, CACHE={CACHE_SESS}) - {os_id()}, {get_cpu_info()['brand_raw']}" + measure_overhead(measure_upload_1mb, title) + plt.savefig(f"results/dav_upload_1mb__cache{int(CACHE_SESS)}_iters{ITERS}__{getuser()}.png", dpi=200) diff --git a/benchmarks/ae_overhead_dav_upload_stream.py b/benchmarks/ae_overhead_dav_upload_stream.py new file mode 100644 index 00000000..90e988b9 --- /dev/null +++ b/benchmarks/ae_overhead_dav_upload_stream.py @@ -0,0 +1,35 @@ +from getpass import getuser +from io import BytesIO +from random import randbytes +from time import perf_counter +from typing import Any, Union + +import matplotlib.pyplot as plt +from ae_overhead_common import measure_overhead, os_id +from cpuinfo import get_cpu_info + +from nc_py_api import Nextcloud, NextcloudApp + +ITERS = 10 +CACHE_SESS = False + + +def measure_upload_100mb(nc_obj: Union[Nextcloud, NextcloudApp]) -> [Any, float]: + __result = None + medium_file_name = "100Mb.bin" + medium_file = BytesIO() + medium_file.write(randbytes(100 * 1024 * 1024)) + start_time = perf_counter() + for _ in range(ITERS): + medium_file.seek(0) + nc_obj.files.upload_stream(medium_file_name, medium_file) + nc_obj._session.init_adapter(restart=not CACHE_SESS) # noqa + end_time = perf_counter() + nc_obj.files.delete(medium_file_name, not_fail=True) + return __result, round((end_time - start_time) / ITERS, 3) + + +if __name__ == "__main__": + title = f"upload stream 100mb({ITERS} iters, CACHE={CACHE_SESS}) - {os_id()}, {get_cpu_info()['brand_raw']}" + measure_overhead(measure_upload_100mb, title) + plt.savefig(f"results/dav_upload_stream_100mb__cache{int(CACHE_SESS)}_iters{ITERS}__{getuser()}.png", dpi=200) diff --git a/benchmarks/ae_overhead_heavy_op.py b/benchmarks/ae_overhead_heavy_op.py deleted file mode 100644 index 246ab008..00000000 --- a/benchmarks/ae_overhead_heavy_op.py +++ /dev/null @@ -1,77 +0,0 @@ -import sys -from io import BytesIO -from pathlib import Path -from random import randbytes -from time import perf_counter - -import matplotlib.pyplot as plt -from conf import NC_CFGS, init_nc, init_nc_app -from cpuinfo import get_cpu_info - -USER_NAME = "admin" - - -if __name__ == "__main__": - nc_versions = [] - results_medium_file_upload_chunked = [] - results_medium_file_upload_chunked_ae = [] - results_medium_file_download_stream = [] - results_medium_file_download_stream_ae = [] - for nextcloud_url, v in NC_CFGS.items(): - nc = init_nc(nextcloud_url, v) - nc_app = init_nc_app(nextcloud_url, v) - - nc_versions.append(nc.srv_version["string"] if nc else nc_app.srv_version["string"]) - - medium_file_name = "100Mb.bin" - # First benchmark, medium file(1mb) upload - medium_file = BytesIO() - medium_file.write(randbytes(100 * 1024 * 1024)) - n_iter = 10 - if nc: - start_time = perf_counter() - for i in range(n_iter): - medium_file.seek(0) - nc.files.upload_stream(medium_file_name, medium_file) - end_time = perf_counter() - results_medium_file_upload_chunked.append((end_time - start_time) / n_iter) - if nc_app: - start_time = perf_counter() - for i in range(n_iter): - medium_file.seek(0) - nc_app.files.upload_stream(medium_file_name, medium_file) - end_time = perf_counter() - results_medium_file_upload_chunked_ae.append((end_time - start_time) / n_iter) - - # Second benchmark, medium file(1mb) download - n_iter = 10 - if nc: - start_time = perf_counter() - for i in range(n_iter): - buf = BytesIO() - nc.files.download2stream(medium_file_name, buf) - end_time = perf_counter() - results_medium_file_download_stream.append((end_time - start_time) / n_iter) - if nc_app: - start_time = perf_counter() - for i in range(n_iter): - buf = BytesIO() - nc_app.files.download2stream(medium_file_name, buf) - end_time = perf_counter() - results_medium_file_download_stream_ae.append((end_time - start_time) / n_iter) - - fig, ax = plt.subplots() - ax.plot(nc_versions, results_medium_file_upload_chunked, label="upload chunked 100Mb file") - ax.plot(nc_versions, results_medium_file_upload_chunked_ae, label="upload chunked 100Mb file(AE)") - ax.plot(nc_versions, results_medium_file_download_stream, label="download stream 100Mb file") - ax.plot(nc_versions, results_medium_file_download_stream_ae, label="download stream 100Mb file(AE)") - plt.ylabel("time to execute(s)") - if sys.platform.lower() == "darwin": - _os = "macOS" - elif sys.platform.lower() == "win32": - _os = "Windows" - else: - _os = "Linux" - plt.xlabel(f"{_os} - {get_cpu_info()['brand_raw']}") - ax.legend() - plt.savefig(f"results/{Path(__file__).stem}_{_os}.png", dpi=200) diff --git a/benchmarks/ae_overhead_light_op.py b/benchmarks/ae_overhead_light_op.py deleted file mode 100644 index c2e9a39a..00000000 --- a/benchmarks/ae_overhead_light_op.py +++ /dev/null @@ -1,89 +0,0 @@ -import sys -from pathlib import Path -from random import randbytes -from time import perf_counter - -import matplotlib.pyplot as plt -from conf import NC_CFGS, init_nc, init_nc_app -from cpuinfo import get_cpu_info - -USER_NAME = "admin" - - -if __name__ == "__main__": - nc_versions = [] - results_get_user = [] - results_get_user_ae = [] - results_small_file_upload = [] - results_small_file_upload_ae = [] - results_small_file_download = [] - results_small_file_download_ae = [] - for nextcloud_url, v in NC_CFGS.items(): - nc = init_nc(nextcloud_url, v) - nc_app = init_nc_app(nextcloud_url, v) - - nc_versions.append(nc.srv_version["string"] if nc else nc_app.srv_version["string"]) - # First benchmark, OCS call - n_iter = 100 - if nc: - start_time = perf_counter() - for i in range(n_iter): - nc.users.get_details() - end_time = perf_counter() - results_get_user.append((end_time - start_time) / n_iter) - if nc_app: - start_time = perf_counter() - for i in range(n_iter): - nc_app.users.get_details() - end_time = perf_counter() - results_get_user_ae.append((end_time - start_time) / n_iter) - - small_file_name = "1Mb.bin" - # Second benchmark, small file(1mb) upload - small_file = randbytes(1024 * 1024) - n_iter = 100 - if nc: - start_time = perf_counter() - for i in range(n_iter): - nc.files.upload(small_file_name, small_file) - end_time = perf_counter() - results_small_file_upload.append((end_time - start_time) / n_iter) - if nc_app: - start_time = perf_counter() - for i in range(n_iter): - nc_app.files.upload(small_file_name, small_file) - end_time = perf_counter() - results_small_file_upload_ae.append((end_time - start_time) / n_iter) - - # Third benchmark, small file(1mb) download - n_iter = 100 - if nc: - start_time = perf_counter() - for i in range(n_iter): - nc.files.download(small_file_name) - end_time = perf_counter() - results_small_file_download.append((end_time - start_time) / n_iter) - if nc_app: - start_time = perf_counter() - for i in range(n_iter): - nc_app.files.download(small_file_name) - end_time = perf_counter() - results_small_file_download_ae.append((end_time - start_time) / n_iter) - - fig, ax = plt.subplots() - ax.plot(nc_versions, results_get_user, label="get_user") - ax.plot(nc_versions, results_get_user_ae, label="get_user(AE)") - ax.plot(nc_versions, results_small_file_upload, label="upload 1Mb file") - ax.plot(nc_versions, results_small_file_upload_ae, label="upload 1Mb file(AE)") - ax.plot(nc_versions, results_small_file_download, label="download 1Mb file") - ax.plot(nc_versions, results_small_file_download_ae, label="download 1Mb file(AE)") - plt.ylabel("time to execute(s)") - if sys.platform.lower() == "darwin": - _os = "macOS" - elif sys.platform.lower() == "win32": - _os = "Windows" - else: - _os = "Linux" - plt.xlabel(f"{_os} - {get_cpu_info()['brand_raw']}") - ax.legend() - plt.savefig(f"results/{Path(__file__).stem}_{_os}.png", dpi=200) diff --git a/benchmarks/ae_overhead_ocs.py b/benchmarks/ae_overhead_ocs.py new file mode 100644 index 00000000..d46de38c --- /dev/null +++ b/benchmarks/ae_overhead_ocs.py @@ -0,0 +1,28 @@ +from getpass import getuser +from time import perf_counter +from typing import Any, Union + +import matplotlib.pyplot as plt +from ae_overhead_common import measure_overhead, os_id +from cpuinfo import get_cpu_info + +from nc_py_api import Nextcloud, NextcloudApp + +ITERS = 100 +CACHE_SESSION = False + + +def measure_get_details(nc_obj: Union[Nextcloud, NextcloudApp]) -> [Any, float]: + __result = None + start_time = perf_counter() + for _ in range(ITERS): + __result = nc_obj.users.get_details() + nc_obj._session.init_adapter(restart=not CACHE_SESSION) # noqa + end_time = perf_counter() + return __result, round((end_time - start_time) / ITERS, 3) + + +if __name__ == "__main__": + title = f"OCS: get_user({ITERS} iters, CACHE={CACHE_SESSION}) - {os_id()}, {get_cpu_info()['brand_raw']}" + measure_overhead(measure_get_details, title) + plt.savefig(f"results/ocs_user_get_details__cache{int(CACHE_SESSION)}_iters{ITERS}__{getuser()}.png", dpi=200) diff --git a/benchmarks/conf.py b/benchmarks/conf.py index 1d738b59..d0f12d0c 100644 --- a/benchmarks/conf.py +++ b/benchmarks/conf.py @@ -3,43 +3,56 @@ from nc_py_api import Nextcloud, NextcloudApp NC_CFGS = { - "http://stable27.local/index.php": { + "http://stable26.local": { # NC_APP - "secret": ( - "tC6vkwPhcppjMykD1r0n9NlI95uJMBYjs5blpIcA1PAdoPDmc5qoAjaBAkyocZ6E" - "X1T8Pi+T5papEolTLxz3fJSPS8ffC4204YmggxPsbJdCkXHWNPHKWS9B+vTj2SIV" - ), + "secret": "12345", "app_id": "nc_py_api", "app_version": "1.0.0", "user": "admin", # NC "nc_auth_user": "admin", "nc_auth_pass": "admin", + "nc_auth_app_pass": "kFEfH-cqR8T-563tB-8CAjd-96LNj", }, - "http://nextcloud.local/index.php": { + "http://stable27.local": { # NC_APP - "secret": ( - "tC6vkwPhcppjMykD1r0n9NlI95uJMBYjs5blpIcA1PAdoPDmc5qoAjaBAkyocZ6E" - "X1T8Pi+T5papEolTLxz3fJSPS8ffC4204YmggxPsbJdCkXHWNPHKWS9B+vTj2SIV" - ), + "secret": "12345", "app_id": "nc_py_api", "app_version": "1.0.0", "user": "admin", # NC "nc_auth_user": "admin", "nc_auth_pass": "admin", + "nc_auth_app_pass": "Npi8A-LAtWM-WaPm8-CPpEA-jq9od", + }, + "http://nextcloud.local": { + # NC_APP + "secret": "12345", + "app_id": "nc_py_api", + "app_version": "1.0.0", + "user": "admin", + # NC + "nc_auth_user": "admin", + "nc_auth_pass": "admin", + "nc_auth_app_pass": "yEaoa-5Z96a-Z7SHs-44spP-EkC4o", }, } def init_nc(url, cfg) -> Optional[Nextcloud]: - if "nc_auth_user" in cfg and "nc_auth_pass" in cfg: + if cfg.get("nc_auth_user", "") and cfg.get("nc_auth_pass", ""): return Nextcloud(nc_auth_user=cfg["nc_auth_user"], nc_auth_pass=cfg["nc_auth_pass"], nextcloud_url=url) return None +def init_nc_by_app_pass(url, cfg) -> Optional[Nextcloud]: + if cfg.get("nc_auth_user", "") and cfg.get("nc_auth_app_pass", ""): + return Nextcloud(nc_auth_user=cfg["nc_auth_user"], nc_auth_pass=cfg["nc_auth_app_pass"], nextcloud_url=url) + return None + + def init_nc_app(url, cfg) -> Optional[NextcloudApp]: - if "secret" in cfg and "app_id" in cfg: + if cfg.get("secret", "") and cfg.get("app_id", ""): return NextcloudApp( app_id=cfg["app_id"], app_version=cfg["app_version"], diff --git a/benchmarks/results/ae_overhead_heavy_op_macOS.png b/benchmarks/results/ae_overhead_heavy_op_macOS.png deleted file mode 100644 index 8476f5eb..00000000 Binary files a/benchmarks/results/ae_overhead_heavy_op_macOS.png and /dev/null differ diff --git a/benchmarks/results/ae_overhead_light_op_macOS.png b/benchmarks/results/ae_overhead_light_op_macOS.png deleted file mode 100644 index fe741fad..00000000 Binary files a/benchmarks/results/ae_overhead_light_op_macOS.png and /dev/null differ diff --git a/scripts/dev_register.sh b/scripts/dev_register.sh index 8f21de1f..ccbcc38d 100644 --- a/scripts/dev_register.sh +++ b/scripts/dev_register.sh @@ -1,20 +1,20 @@ #!/bin/bash -echo "removing 'manual_install' deploy daemon for nextcloud 28 container" -docker exec master-nextcloud-1 sudo -u www-data php occ app_ecosystem_v2:daemon:unregister manual_install || true -echo "creating 'manual_install' deploy daemon for nextcloud 28 container" -docker exec master-nextcloud-1 sudo -u www-data php occ app_ecosystem_v2:daemon:register \ +echo "removing 'manual_install' deploy daemon for $1 container" +docker exec "$1" sudo -u www-data php occ app_ecosystem_v2:daemon:unregister manual_install || true +echo "creating 'manual_install' deploy daemon for $1 container" +docker exec "$1" sudo -u www-data php occ app_ecosystem_v2:daemon:register \ manual_install "Manual Install" manual-install 0 0 0 -echo "unregistering nc_py_api as an app for nextcloud 28 container" -docker exec master-nextcloud-1 sudo -u www-data php occ app_ecosystem_v2:app:unregister nc_py_api --silent || true -echo "registering nc_py_api as an app for nextcloud 28 container" -NEXTCLOUD_URL="http://nextcloud.local" APP_PORT=9009 APP_ID="nc_py_api" APP_SECRET="12345" APP_VERSION="1.0.0" \ +echo "unregistering nc_py_api as an app for $1 container" +docker exec "$1" sudo -u www-data php occ app_ecosystem_v2:app:unregister nc_py_api --silent || true +echo "registering nc_py_api as an app for $1 container" +NEXTCLOUD_URL="http://$2" APP_PORT=9009 APP_ID="nc_py_api" APP_SECRET="12345" APP_VERSION="1.0.0" \ python3 tests/_install.py > /dev/null 2>&1 & echo $! > /tmp/_install.pid sleep 7 -docker exec master-nextcloud-1 sudo -u www-data php occ app_ecosystem_v2:app:register nc_py_api manual_install --json-info \ +docker exec "$1" sudo -u www-data php occ app_ecosystem_v2:app:register nc_py_api manual_install --json-info \ "{\"appid\":\"nc_py_api\",\"name\":\"NC_Py_API\",\"daemon_config_name\":\"manual_install\",\"version\":\"1.0.0\",\"secret\":\"12345\",\"host\":\"host.docker.internal\",\"port\":9009,\"protocol\":\"http\",\"system_app\":1}" \ -e --force-scopes cat /tmp/_install.pid kill -15 "$(cat /tmp/_install.pid)" -echo "nc_py_api - ready" +echo "nc_py_api for $1 is ready to use" diff --git a/setup.cfg b/setup.cfg index 1691a59f..939e2820 100644 --- a/setup.cfg +++ b/setup.cfg @@ -52,6 +52,7 @@ docs = bench= matplotlib py-cpuinfo + numpy dev = pytest pre-commit diff --git a/tests/gfixture.py b/tests/gfixture.py index acf2c50b..a91d71ba 100644 --- a/tests/gfixture.py +++ b/tests/gfixture.py @@ -6,7 +6,7 @@ if not environ.get("CI", False): # For local tests environ["NC_AUTH_USER"] = "admin" environ["NC_AUTH_PASS"] = "admin" # "MrtGY-KfY24-iiDyg-cr4n4-GLsNZ" - environ["NEXTCLOUD_URL"] = "http://nextcloud.local" + environ["NEXTCLOUD_URL"] = environ.get("NEXTCLOUD_URL", "http://nextcloud.local") environ["APP_ID"] = "nc_py_api" environ["APP_VERSION"] = "1.0.0" environ["APP_SECRET"] = "12345"