nc-py-api 0.18.0__tar.gz → 0.18.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. {nc_py_api-0.18.0 → nc_py_api-0.18.2}/CHANGELOG.md +13 -0
  2. {nc_py_api-0.18.0 → nc_py_api-0.18.2}/PKG-INFO +4 -2
  3. {nc_py_api-0.18.0 → nc_py_api-0.18.2}/nc_py_api/_session.py +3 -0
  4. {nc_py_api-0.18.0 → nc_py_api-0.18.2}/nc_py_api/_version.py +1 -1
  5. {nc_py_api-0.18.0 → nc_py_api-0.18.2}/nc_py_api/ex_app/misc.py +1 -1
  6. {nc_py_api-0.18.0 → nc_py_api-0.18.2}/nc_py_api/files/files.py +2 -1
  7. {nc_py_api-0.18.0 → nc_py_api-0.18.2}/nc_py_api/options.py +12 -1
  8. {nc_py_api-0.18.0 → nc_py_api-0.18.2}/pyproject.toml +2 -8
  9. {nc_py_api-0.18.0 → nc_py_api-0.18.2}/.gitignore +0 -0
  10. {nc_py_api-0.18.0 → nc_py_api-0.18.2}/AUTHORS +0 -0
  11. {nc_py_api-0.18.0 → nc_py_api-0.18.2}/LICENSE.txt +0 -0
  12. {nc_py_api-0.18.0 → nc_py_api-0.18.2}/README.md +0 -0
  13. {nc_py_api-0.18.0 → nc_py_api-0.18.2}/nc_py_api/__init__.py +0 -0
  14. {nc_py_api-0.18.0 → nc_py_api-0.18.2}/nc_py_api/_deffered_error.py +0 -0
  15. {nc_py_api-0.18.0 → nc_py_api-0.18.2}/nc_py_api/_exceptions.py +0 -0
  16. {nc_py_api-0.18.0 → nc_py_api-0.18.2}/nc_py_api/_misc.py +0 -0
  17. {nc_py_api-0.18.0 → nc_py_api-0.18.2}/nc_py_api/_preferences.py +0 -0
  18. {nc_py_api-0.18.0 → nc_py_api-0.18.2}/nc_py_api/_preferences_ex.py +0 -0
  19. {nc_py_api-0.18.0 → nc_py_api-0.18.2}/nc_py_api/_talk_api.py +0 -0
  20. {nc_py_api-0.18.0 → nc_py_api-0.18.2}/nc_py_api/_theming.py +0 -0
  21. {nc_py_api-0.18.0 → nc_py_api-0.18.2}/nc_py_api/activity.py +0 -0
  22. {nc_py_api-0.18.0 → nc_py_api-0.18.2}/nc_py_api/apps.py +0 -0
  23. {nc_py_api-0.18.0 → nc_py_api-0.18.2}/nc_py_api/calendar.py +0 -0
  24. {nc_py_api-0.18.0 → nc_py_api-0.18.2}/nc_py_api/ex_app/__init__.py +0 -0
  25. {nc_py_api-0.18.0 → nc_py_api-0.18.2}/nc_py_api/ex_app/defs.py +0 -0
  26. {nc_py_api-0.18.0 → nc_py_api-0.18.2}/nc_py_api/ex_app/events_listener.py +0 -0
  27. {nc_py_api-0.18.0 → nc_py_api-0.18.2}/nc_py_api/ex_app/integration_fastapi.py +0 -0
  28. {nc_py_api-0.18.0 → nc_py_api-0.18.2}/nc_py_api/ex_app/logging.py +0 -0
  29. {nc_py_api-0.18.0 → nc_py_api-0.18.2}/nc_py_api/ex_app/occ_commands.py +0 -0
  30. {nc_py_api-0.18.0 → nc_py_api-0.18.2}/nc_py_api/ex_app/persist_transformers_cache.py +0 -0
  31. {nc_py_api-0.18.0 → nc_py_api-0.18.2}/nc_py_api/ex_app/providers/__init__.py +0 -0
  32. {nc_py_api-0.18.0 → nc_py_api-0.18.2}/nc_py_api/ex_app/providers/providers.py +0 -0
  33. {nc_py_api-0.18.0 → nc_py_api-0.18.2}/nc_py_api/ex_app/providers/task_processing.py +0 -0
  34. {nc_py_api-0.18.0 → nc_py_api-0.18.2}/nc_py_api/ex_app/ui/__init__.py +0 -0
  35. {nc_py_api-0.18.0 → nc_py_api-0.18.2}/nc_py_api/ex_app/ui/files_actions.py +0 -0
  36. {nc_py_api-0.18.0 → nc_py_api-0.18.2}/nc_py_api/ex_app/ui/resources.py +0 -0
  37. {nc_py_api-0.18.0 → nc_py_api-0.18.2}/nc_py_api/ex_app/ui/settings.py +0 -0
  38. {nc_py_api-0.18.0 → nc_py_api-0.18.2}/nc_py_api/ex_app/ui/top_menu.py +0 -0
  39. {nc_py_api-0.18.0 → nc_py_api-0.18.2}/nc_py_api/ex_app/ui/ui.py +0 -0
  40. {nc_py_api-0.18.0 → nc_py_api-0.18.2}/nc_py_api/ex_app/uvicorn_fastapi.py +0 -0
  41. {nc_py_api-0.18.0 → nc_py_api-0.18.2}/nc_py_api/files/__init__.py +0 -0
  42. {nc_py_api-0.18.0 → nc_py_api-0.18.2}/nc_py_api/files/_files.py +0 -0
  43. {nc_py_api-0.18.0 → nc_py_api-0.18.2}/nc_py_api/files/files_async.py +0 -0
  44. {nc_py_api-0.18.0 → nc_py_api-0.18.2}/nc_py_api/files/sharing.py +0 -0
  45. {nc_py_api-0.18.0 → nc_py_api-0.18.2}/nc_py_api/loginflow_v2.py +0 -0
  46. {nc_py_api-0.18.0 → nc_py_api-0.18.2}/nc_py_api/nextcloud.py +0 -0
  47. {nc_py_api-0.18.0 → nc_py_api-0.18.2}/nc_py_api/notes.py +0 -0
  48. {nc_py_api-0.18.0 → nc_py_api-0.18.2}/nc_py_api/notifications.py +0 -0
  49. {nc_py_api-0.18.0 → nc_py_api-0.18.2}/nc_py_api/talk.py +0 -0
  50. {nc_py_api-0.18.0 → nc_py_api-0.18.2}/nc_py_api/talk_bot.py +0 -0
  51. {nc_py_api-0.18.0 → nc_py_api-0.18.2}/nc_py_api/user_status.py +0 -0
  52. {nc_py_api-0.18.0 → nc_py_api-0.18.2}/nc_py_api/users.py +0 -0
  53. {nc_py_api-0.18.0 → nc_py_api-0.18.2}/nc_py_api/users_groups.py +0 -0
  54. {nc_py_api-0.18.0 → nc_py_api-0.18.2}/nc_py_api/weather_status.py +0 -0
  55. {nc_py_api-0.18.0 → nc_py_api-0.18.2}/nc_py_api/webhooks.py +0 -0
@@ -2,6 +2,19 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## [0.18.2 - 2025-01-19]
6
+
7
+ ### Changed
8
+
9
+ - Default "User-Agent" for ExApps now set to `ExApp/appid/version (httpx/version)`. #329
10
+ - `System Trust Store` from now are used by default. #328
11
+
12
+ ## [0.18.1 - 2025-01-14]
13
+
14
+ ### Fixed
15
+
16
+ - Chunked Upload V2 not working on Nextcloud 30 and later. #324 Thanks to @DrZoidberg09
17
+
5
18
  ## [0.18.0 - 2024-10-09]
6
19
 
7
20
  ### Added
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.3
1
+ Metadata-Version: 2.4
2
2
  Name: nc-py-api
3
- Version: 0.18.0
3
+ Version: 0.18.2
4
4
  Summary: Nextcloud Python Framework
5
5
  Project-URL: Changelog, https://github.com/cloud-py-api/nc_py_api/blob/main/CHANGELOG.md
6
6
  Project-URL: Documentation, https://cloud-py-api.github.io/nc_py_api/
@@ -20,6 +20,7 @@ Classifier: Programming Language :: Python :: 3 :: Only
20
20
  Classifier: Programming Language :: Python :: 3.10
21
21
  Classifier: Programming Language :: Python :: 3.11
22
22
  Classifier: Programming Language :: Python :: 3.12
23
+ Classifier: Programming Language :: Python :: 3.13
23
24
  Classifier: Programming Language :: Python :: Implementation :: CPython
24
25
  Classifier: Programming Language :: Python :: Implementation :: PyPy
25
26
  Classifier: Topic :: Internet :: WWW/HTTP
@@ -33,6 +34,7 @@ Requires-Dist: fastapi>=0.109.2
33
34
  Requires-Dist: httpx>=0.25.2
34
35
  Requires-Dist: pydantic>=2.1.1
35
36
  Requires-Dist: python-dotenv>=1
37
+ Requires-Dist: truststore==0.10
36
38
  Requires-Dist: xmltodict>=0.13
37
39
  Provides-Extra: app
38
40
  Requires-Dist: uvicorn[standard]>=0.23.2; extra == 'app'
@@ -12,6 +12,7 @@ from json import loads
12
12
  from os import environ
13
13
 
14
14
  from httpx import AsyncClient, Client, Headers, Limits, ReadTimeout, Request, Response
15
+ from httpx import __version__ as httpx_version
15
16
  from starlette.requests import HTTPConnection
16
17
 
17
18
  from . import options
@@ -511,6 +512,7 @@ class NcSessionApp(NcSessionAppBasic, NcSessionBasic):
511
512
  "AA-VERSION": self.cfg.aa_version,
512
513
  "EX-APP-ID": self.cfg.app_name,
513
514
  "EX-APP-VERSION": self.cfg.app_version,
515
+ "user-agent": f"ExApp/{self.cfg.app_name}/{self.cfg.app_version} (httpx/{httpx_version})",
514
516
  },
515
517
  )
516
518
 
@@ -535,6 +537,7 @@ class AsyncNcSessionApp(NcSessionAppBasic, AsyncNcSessionBasic):
535
537
  "AA-VERSION": self.cfg.aa_version,
536
538
  "EX-APP-ID": self.cfg.app_name,
537
539
  "EX-APP-VERSION": self.cfg.app_version,
540
+ "User-Agent": f"ExApp/{self.cfg.app_name}/{self.cfg.app_version} (httpx/{httpx_version})",
538
541
  },
539
542
  )
540
543
 
@@ -1,3 +1,3 @@
1
1
  """Version of nc_py_api."""
2
2
 
3
- __version__ = "0.18.0"
3
+ __version__ = "0.18.2"
@@ -33,7 +33,7 @@ def verify_version(finalize_update: bool = True) -> tuple[str, str] | None:
33
33
  """
34
34
  version_file_path = os.path.join(persistent_storage(), "_version.info")
35
35
  r = None
36
- with open(version_file_path, "a+t", encoding="UTF-8") as version_file:
36
+ with open(version_file_path, "a+", encoding="UTF-8") as version_file:
37
37
  version_file.seek(0)
38
38
  old_version = version_file.read()
39
39
  if old_version != os.environ["APP_VERSION"]:
@@ -485,7 +485,8 @@ class FilesAPI:
485
485
  response = self._session.adapter_dav.request("MKCOL", _dav_path)
486
486
  check_error(response)
487
487
  try:
488
- start_bytes = end_bytes = chunk_number = 0
488
+ start_bytes = end_bytes = 0
489
+ chunk_number = 1
489
490
  while True:
490
491
  piece = fp.read(chunk_size)
491
492
  if not piece:
@@ -33,11 +33,22 @@ NPA_NC_CERT: bool | str
33
33
  SSL certificates (a.k.a CA bundle) used to verify the identity of requested hosts. Either **True** (default CA bundle),
34
34
  a path to an SSL certificate file, or **False** (which will disable verification)."""
35
35
  str_val = environ.get("NPA_NC_CERT", "True")
36
- NPA_NC_CERT = True
36
+ # https://github.com/encode/httpx/issues/302
37
+ # when "httpx" will switch to use "truststore" by default - uncomment next line
38
+ # NPA_NC_CERT = True
37
39
  if str_val.lower() in ("false", "0"):
38
40
  NPA_NC_CERT = False
39
41
  elif str_val.lower() not in ("true", "1"):
40
42
  NPA_NC_CERT = str_val
43
+ else:
44
+ # Temporary workaround, see comment above.
45
+ # Use system certificate stores
46
+
47
+ import ssl
48
+
49
+ import truststore
50
+
51
+ NPA_NC_CERT = truststore.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
41
52
 
42
53
  CHUNKED_UPLOAD_V2 = environ.get("CHUNKED_UPLOAD_V2", True)
43
54
  """Option to enable/disable **version 2** chunked upload(better Object Storages support).
@@ -31,6 +31,7 @@ classifiers = [
31
31
  "Programming Language :: Python :: 3.10",
32
32
  "Programming Language :: Python :: 3.11",
33
33
  "Programming Language :: Python :: 3.12",
34
+ "Programming Language :: Python :: 3.13",
34
35
  "Programming Language :: Python :: Implementation :: CPython",
35
36
  "Programming Language :: Python :: Implementation :: PyPy",
36
37
  "Topic :: Internet :: WWW/HTTP",
@@ -48,6 +49,7 @@ dependencies = [
48
49
  "httpx>=0.25.2",
49
50
  "pydantic>=2.1.1",
50
51
  "python-dotenv>=1",
52
+ "truststore==0.10",
51
53
  "xmltodict>=0.13",
52
54
  ]
53
55
  optional-dependencies.app = [
@@ -247,11 +249,3 @@ exclude_lines = [
247
249
  "DeprecationWarning",
248
250
  "DEPRECATED",
249
251
  ]
250
-
251
- [tool.mypy]
252
- ignore_missing_imports = false
253
- warn_unreachable = true
254
- warn_no_return = true
255
- strict_optional = true
256
- check_untyped_defs = true
257
- show_error_codes = true
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes