python-anvil 5.0.0__tar.gz → 5.0.0b1__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 (31) hide show
  1. {python_anvil-5.0.0 → python_anvil-5.0.0b1}/PKG-INFO +6 -3
  2. {python_anvil-5.0.0 → python_anvil-5.0.0b1}/README.md +1 -1
  3. {python_anvil-5.0.0 → python_anvil-5.0.0b1}/pyproject.toml +9 -4
  4. {python_anvil-5.0.0 → python_anvil-5.0.0b1}/python_anvil/api.py +16 -0
  5. {python_anvil-5.0.0 → python_anvil-5.0.0b1}/python_anvil/models.py +7 -0
  6. {python_anvil-5.0.0 → python_anvil-5.0.0b1}/LICENSE.md +0 -0
  7. {python_anvil-5.0.0 → python_anvil-5.0.0b1}/python_anvil/__init__.py +0 -0
  8. {python_anvil-5.0.0 → python_anvil-5.0.0b1}/python_anvil/api_resources/__init__.py +0 -0
  9. {python_anvil-5.0.0 → python_anvil-5.0.0b1}/python_anvil/api_resources/base.py +0 -0
  10. {python_anvil-5.0.0 → python_anvil-5.0.0b1}/python_anvil/api_resources/mutations/__init__.py +0 -0
  11. {python_anvil-5.0.0 → python_anvil-5.0.0b1}/python_anvil/api_resources/mutations/base.py +0 -0
  12. {python_anvil-5.0.0 → python_anvil-5.0.0b1}/python_anvil/api_resources/mutations/create_etch_packet.py +0 -0
  13. {python_anvil-5.0.0 → python_anvil-5.0.0b1}/python_anvil/api_resources/mutations/forge_submit.py +0 -0
  14. {python_anvil-5.0.0 → python_anvil-5.0.0b1}/python_anvil/api_resources/mutations/generate_etch_signing_url.py +0 -0
  15. {python_anvil-5.0.0 → python_anvil-5.0.0b1}/python_anvil/api_resources/mutations/helpers.py +0 -0
  16. {python_anvil-5.0.0 → python_anvil-5.0.0b1}/python_anvil/api_resources/payload.py +0 -0
  17. {python_anvil-5.0.0 → python_anvil-5.0.0b1}/python_anvil/api_resources/requests.py +0 -0
  18. {python_anvil-5.0.0 → python_anvil-5.0.0b1}/python_anvil/cli.py +0 -0
  19. {python_anvil-5.0.0 → python_anvil-5.0.0b1}/python_anvil/constants.py +0 -0
  20. {python_anvil-5.0.0 → python_anvil-5.0.0b1}/python_anvil/exceptions.py +0 -0
  21. {python_anvil-5.0.0 → python_anvil-5.0.0b1}/python_anvil/http.py +0 -0
  22. {python_anvil-5.0.0 → python_anvil-5.0.0b1}/python_anvil/py.typed +0 -0
  23. {python_anvil-5.0.0 → python_anvil-5.0.0b1}/python_anvil/tests/__init__.py +0 -0
  24. {python_anvil-5.0.0 → python_anvil-5.0.0b1}/python_anvil/tests/conftest.py +0 -0
  25. {python_anvil-5.0.0 → python_anvil-5.0.0b1}/python_anvil/tests/payloads.py +0 -0
  26. {python_anvil-5.0.0 → python_anvil-5.0.0b1}/python_anvil/tests/test_api.py +0 -0
  27. {python_anvil-5.0.0 → python_anvil-5.0.0b1}/python_anvil/tests/test_cli.py +0 -0
  28. {python_anvil-5.0.0 → python_anvil-5.0.0b1}/python_anvil/tests/test_http.py +0 -0
  29. {python_anvil-5.0.0 → python_anvil-5.0.0b1}/python_anvil/tests/test_models.py +0 -0
  30. {python_anvil-5.0.0 → python_anvil-5.0.0b1}/python_anvil/tests/test_utils.py +0 -0
  31. {python_anvil-5.0.0 → python_anvil-5.0.0b1}/python_anvil/utils.py +0 -0
@@ -1,13 +1,13 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python_anvil
3
- Version: 5.0.0
3
+ Version: 5.0.0b1
4
4
  Summary: Anvil API
5
5
  Home-page: https://www.useanvil.com/
6
6
  License: MIT
7
7
  Keywords: anvil,api,pdf,signing
8
8
  Author: Anvil Foundry Inc.
9
9
  Author-email: developers@useanvil.com
10
- Requires-Python: >=3.8.0,<3.12
10
+ Requires-Python: >=3.8.0,<3.13
11
11
  Classifier: Development Status :: 3 - Alpha
12
12
  Classifier: License :: OSI Approved :: MIT License
13
13
  Classifier: Natural Language :: English
@@ -18,6 +18,8 @@ Classifier: Programming Language :: Python :: 3.8
18
18
  Classifier: Programming Language :: Python :: 3.9
19
19
  Classifier: Programming Language :: Python :: 3.10
20
20
  Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Programming Language :: Python :: 3.7
21
23
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
22
24
  Requires-Dist: click (>=8.0,<9.0)
23
25
  Requires-Dist: gql[requests] (==3.6.0b1)
@@ -25,6 +27,7 @@ Requires-Dist: pydantic (>=2.6.1,<3.0.0)
25
27
  Requires-Dist: ratelimit (>=2.2.1,<3.0.0)
26
28
  Requires-Dist: requests (>=2.28.2,<3.0.0)
27
29
  Requires-Dist: tabulate (>=0.9.0,<0.10.0)
30
+ Requires-Dist: urllib3 (<2)
28
31
  Project-URL: Documentation, https://github.com/anvilco/python-anvil
29
32
  Project-URL: Repository, https://github.com/anvilco/python-anvil
30
33
  Description-Content-Type: text/markdown
@@ -57,7 +60,7 @@ General API documentation: [Anvil API docs](https://www.useanvil.com/docs)
57
60
 
58
61
  ## Requirements
59
62
 
60
- * Python >=3.8
63
+ * Python 3.7.2+
61
64
 
62
65
  ## Installation
63
66
 
@@ -26,7 +26,7 @@ General API documentation: [Anvil API docs](https://www.useanvil.com/docs)
26
26
 
27
27
  ## Requirements
28
28
 
29
- * Python >=3.8
29
+ * Python 3.7.2+
30
30
 
31
31
  ## Installation
32
32
 
@@ -1,7 +1,7 @@
1
1
  [tool.poetry]
2
2
 
3
3
  name = "python_anvil"
4
- version = "5.0.0"
4
+ version = "5.0.0b1"
5
5
  description = "Anvil API"
6
6
  license = "MIT"
7
7
  authors = ["Anvil Foundry Inc. <developers@useanvil.com>"]
@@ -23,16 +23,21 @@ classifiers = [
23
23
  "Operating System :: OS Independent",
24
24
  "Programming Language :: Python",
25
25
  "Programming Language :: Python :: 3",
26
+ "Programming Language :: Python :: 3.7",
26
27
  "Programming Language :: Python :: 3.8",
27
28
  "Programming Language :: Python :: 3.9",
28
29
  "Programming Language :: Python :: 3.10",
29
- "Programming Language :: Python :: 3.11",
30
30
  "Topic :: Software Development :: Libraries :: Python Modules",
31
31
  ]
32
32
 
33
33
  [tool.poetry.dependencies]
34
34
 
35
- python = ">=3.8.0,<3.12"
35
+ python = ">=3.8.0,<3.13"
36
+
37
+ # urllib must be pinned to <2 due to an issue with the `requests_toolbelt`
38
+ # dependency in `gql`.
39
+ # Similar: https://github.com/apache/arrow/commit/4295e3dd06f9f507f75ccc780eaca16a6b621a02
40
+ urllib3 = "<2"
36
41
 
37
42
  click = "^8.0"
38
43
  requests = "^2.28.2"
@@ -93,7 +98,7 @@ anvil = "python_anvil.cli:cli"
93
98
 
94
99
  [tool.black]
95
100
 
96
- target-version = ["py38", "py39", "py310", "py311"]
101
+ target-version = ["py37", "py38", "py39", "py310"]
97
102
  skip-string-normalization = true
98
103
 
99
104
  [build-system]
@@ -392,8 +392,24 @@ class Anvil:
392
392
  )
393
393
 
394
394
  payload = mutation.create_payload()
395
+
396
+ # FIXME: do something here to prevent or fix pydantic from converting
397
+ # files into "SerializationIterator" objects
395
398
  variables = payload.model_dump(by_alias=True, exclude_none=True)
396
399
 
400
+ # print('Files', variables["files"])
401
+ # print('Each')
402
+ for file_obj in variables["files"]:
403
+ if (
404
+ file_obj["file"]
405
+ and file_obj["file"].__class__.__name__ == 'SerializationIterator'
406
+ ):
407
+ # print("FML1", file_obj["file"])
408
+ # print("FML2", dir(file_obj["file"]))
409
+
410
+ # TODO: how to get the value out of the iterator??????????
411
+ file_obj["file"] = file_obj["file"]
412
+
397
413
  return self.mutate(mutation, variables=variables, upload_files=True, **kwargs)
398
414
 
399
415
  def generate_etch_signing_url(self, signer_eid: str, client_user_id: str, **kwargs):
@@ -29,8 +29,15 @@ class FileCompatibleBaseModel(BaseModel):
29
29
  except StopIteration:
30
30
  # Create a BytesIO with the content
31
31
  bio = BytesIO(bytes(content))
32
+ # Get the total length
33
+ bio.seek(0, 2) # Seek to end
34
+ total_length = bio.tell()
35
+ bio.seek(0) # Reset to start
36
+
32
37
  # Create a BufferedReader with the content
33
38
  reader = BufferedReader(bio) # type: ignore[arg-type]
39
+ # Add a length attribute that requests_toolbelt can use
40
+ reader.len = total_length # type: ignore[attr-defined]
34
41
  return reader
35
42
 
36
43
  def _check_if_serialization_iterator(self, value):
File without changes