tzafon 0.1.3__tar.gz → 1.3.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.
Potentially problematic release.
This version of tzafon might be problematic. Click here for more details.
- tzafon-1.3.2/.gitignore +16 -0
- tzafon-1.3.2/.release-please-manifest.json +3 -0
- tzafon-1.3.2/BATCH_API.md +124 -0
- tzafon-1.3.2/CHANGELOG.md +92 -0
- tzafon-1.3.2/CONTRIBUTING.md +128 -0
- tzafon-1.3.2/LICENSE +7 -0
- tzafon-1.3.2/PKG-INFO +429 -0
- tzafon-1.3.2/README.md +394 -0
- tzafon-1.3.2/SECURITY.md +27 -0
- tzafon-1.3.2/WRAPPER.md +38 -0
- tzafon-1.3.2/WRAPPER_FUNCTIONALITY.md +266 -0
- tzafon-1.3.2/api.md +25 -0
- tzafon-1.3.2/bin/check-release-environment +21 -0
- tzafon-1.3.2/bin/publish-pypi +6 -0
- tzafon-1.3.2/examples/.keep +4 -0
- tzafon-1.3.2/examples/batch_example.py +36 -0
- tzafon-1.3.2/examples/batch_example_simple.py +17 -0
- tzafon-1.3.2/examples/clean_api_example.py +41 -0
- tzafon-1.3.2/noxfile.py +9 -0
- tzafon-1.3.2/pyproject.toml +267 -0
- tzafon-1.3.2/release-please-config.json +66 -0
- tzafon-1.3.2/requirements-dev.lock +137 -0
- tzafon-1.3.2/requirements.lock +75 -0
- tzafon-1.3.2/src/computer/lib/.keep +4 -0
- tzafon-1.3.2/src/tzafon/__init__.py +115 -0
- tzafon-1.3.2/src/tzafon/_base_client.py +1995 -0
- tzafon-1.3.2/src/tzafon/_client.py +403 -0
- tzafon-1.3.2/src/tzafon/_compat.py +219 -0
- tzafon-1.3.2/src/tzafon/_constants.py +14 -0
- tzafon-1.3.2/src/tzafon/_exceptions.py +108 -0
- tzafon-1.3.2/src/tzafon/_files.py +123 -0
- tzafon-1.3.2/src/tzafon/_models.py +835 -0
- tzafon-1.3.2/src/tzafon/_qs.py +150 -0
- tzafon-1.3.2/src/tzafon/_resource.py +43 -0
- tzafon-1.3.2/src/tzafon/_response.py +830 -0
- tzafon-1.3.2/src/tzafon/_streaming.py +333 -0
- tzafon-1.3.2/src/tzafon/_types.py +260 -0
- tzafon-1.3.2/src/tzafon/_utils/__init__.py +64 -0
- tzafon-1.3.2/src/tzafon/_utils/_compat.py +45 -0
- tzafon-1.3.2/src/tzafon/_utils/_datetime_parse.py +136 -0
- tzafon-1.3.2/src/tzafon/_utils/_logs.py +25 -0
- tzafon-1.3.2/src/tzafon/_utils/_proxy.py +65 -0
- tzafon-1.3.2/src/tzafon/_utils/_reflection.py +42 -0
- tzafon-1.3.2/src/tzafon/_utils/_resources_proxy.py +24 -0
- tzafon-1.3.2/src/tzafon/_utils/_streams.py +12 -0
- tzafon-1.3.2/src/tzafon/_utils/_sync.py +86 -0
- tzafon-1.3.2/src/tzafon/_utils/_transform.py +457 -0
- tzafon-1.3.2/src/tzafon/_utils/_typing.py +156 -0
- tzafon-1.3.2/src/tzafon/_utils/_utils.py +421 -0
- tzafon-1.3.2/src/tzafon/_version.py +4 -0
- tzafon-1.3.2/src/tzafon/batch_wrapper.py +102 -0
- tzafon-1.3.2/src/tzafon/client_extensions.py +61 -0
- tzafon-1.3.2/src/tzafon/py.typed +0 -0
- tzafon-1.3.2/src/tzafon/resources/__init__.py +19 -0
- tzafon-1.3.2/src/tzafon/resources/computers.py +822 -0
- tzafon-1.3.2/src/tzafon/types/__init__.py +13 -0
- tzafon-1.3.2/src/tzafon/types/action_result.py +17 -0
- tzafon-1.3.2/src/tzafon/types/computer_create_params.py +30 -0
- tzafon-1.3.2/src/tzafon/types/computer_execute_action_params.py +11 -0
- tzafon-1.3.2/src/tzafon/types/computer_execute_batch_params.py +11 -0
- tzafon-1.3.2/src/tzafon/types/computer_execute_batch_response.py +8 -0
- tzafon-1.3.2/src/tzafon/types/computer_keep_alive_response.py +8 -0
- tzafon-1.3.2/src/tzafon/types/computer_list_response.py +10 -0
- tzafon-1.3.2/src/tzafon/types/computer_navigate_params.py +11 -0
- tzafon-1.3.2/src/tzafon/types/computer_response.py +19 -0
- tzafon-1.3.2/src/tzafon/wrapper.py +102 -0
- tzafon-1.3.2/tests/__init__.py +1 -0
- tzafon-1.3.2/tests/api_resources/__init__.py +1 -0
- tzafon-1.3.2/tests/api_resources/test_computers.py +786 -0
- tzafon-1.3.2/tests/conftest.py +84 -0
- tzafon-1.3.2/tests/sample_file.txt +1 -0
- tzafon-1.3.2/tests/test_client.py +1683 -0
- tzafon-1.3.2/tests/test_deepcopy.py +58 -0
- tzafon-1.3.2/tests/test_extract_files.py +64 -0
- tzafon-1.3.2/tests/test_files.py +51 -0
- tzafon-1.3.2/tests/test_models.py +963 -0
- tzafon-1.3.2/tests/test_qs.py +78 -0
- tzafon-1.3.2/tests/test_required_args.py +111 -0
- tzafon-1.3.2/tests/test_response.py +277 -0
- tzafon-1.3.2/tests/test_streaming.py +248 -0
- tzafon-1.3.2/tests/test_transform.py +460 -0
- tzafon-1.3.2/tests/test_utils/test_datetime_parse.py +110 -0
- tzafon-1.3.2/tests/test_utils/test_proxy.py +34 -0
- tzafon-1.3.2/tests/test_utils/test_typing.py +73 -0
- tzafon-1.3.2/tests/utils.py +167 -0
- tzafon-0.1.3/.gitignore +0 -2
- tzafon-0.1.3/.python-version +0 -1
- tzafon-0.1.3/PKG-INFO +0 -62
- tzafon-0.1.3/README.md +0 -48
- tzafon-0.1.3/examples/demo001.py +0 -28
- tzafon-0.1.3/pyproject.toml +0 -28
- tzafon-0.1.3/src/tzafon/__init__.py +0 -3
- tzafon-0.1.3/src/tzafon/_connection.py +0 -49
- tzafon-0.1.3/src/tzafon/client.py +0 -116
- tzafon-0.1.3/src/tzafon/exceptions.py +0 -6
- tzafon-0.1.3/src/tzafon/models.py +0 -99
- tzafon-0.1.3/tests/test_connection.py +0 -18
- tzafon-0.1.3/tests/test_models.py +0 -11
- tzafon-0.1.3/tests/test_waypoint_api.py +0 -35
- tzafon-0.1.3/uv.lock +0 -745
tzafon-1.3.2/.gitignore
ADDED
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
# Batch Execution API
|
|
2
|
+
|
|
3
|
+
Perfect for queuing multiple actions and executing them together.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```python
|
|
8
|
+
from tzafon import asyncComputer
|
|
9
|
+
|
|
10
|
+
client = asyncComputer()
|
|
11
|
+
|
|
12
|
+
computer = client.create(kind="browser")
|
|
13
|
+
computer.navigate("https://google.com")
|
|
14
|
+
computer.type("Hello World")
|
|
15
|
+
computer.click(100, 200)
|
|
16
|
+
|
|
17
|
+
# Execute all queued actions in batch
|
|
18
|
+
result = computer.execute()
|
|
19
|
+
|
|
20
|
+
computer.terminate()
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## How It Works
|
|
24
|
+
|
|
25
|
+
1. **Queue Actions** - Each method call queues an action (doesn't execute immediately)
|
|
26
|
+
2. **Batch Execute** - `computer.execute()` sends all queued actions to backend
|
|
27
|
+
3. **Backend processes** - Actions run sequentially, stops on first error
|
|
28
|
+
4. **Results returned** - Get results for all executed actions
|
|
29
|
+
|
|
30
|
+
## All Actions
|
|
31
|
+
|
|
32
|
+
```python
|
|
33
|
+
computer = client.create(kind="browser")
|
|
34
|
+
|
|
35
|
+
# Queue actions (chainable)
|
|
36
|
+
computer.navigate("https://github.com")
|
|
37
|
+
computer.wait(2.0)
|
|
38
|
+
computer.scroll("down", amount=500)
|
|
39
|
+
computer.hotkey("ctrl", "f")
|
|
40
|
+
computer.type("search term")
|
|
41
|
+
computer.click(100, 200)
|
|
42
|
+
computer.double_click(300, 400)
|
|
43
|
+
computer.right_click(500, 600)
|
|
44
|
+
computer.drag(100, 100, 200, 200)
|
|
45
|
+
computer.screenshot()
|
|
46
|
+
|
|
47
|
+
# Execute all at once
|
|
48
|
+
result = computer.execute()
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Response Format
|
|
52
|
+
|
|
53
|
+
```python
|
|
54
|
+
result = computer.execute()
|
|
55
|
+
|
|
56
|
+
# ComputerExecuteBatchResponse
|
|
57
|
+
result.results # List of ActionResult for each action
|
|
58
|
+
result.success # Overall success status
|
|
59
|
+
|
|
60
|
+
for i, action_result in enumerate(result.results):
|
|
61
|
+
print(f"Action {i+1}: {action_result.status}")
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Context Manager
|
|
65
|
+
|
|
66
|
+
```python
|
|
67
|
+
with client.create(kind="browser") as computer:
|
|
68
|
+
computer.navigate("https://google.com")
|
|
69
|
+
computer.type("Hello World")
|
|
70
|
+
computer.click(100, 200)
|
|
71
|
+
|
|
72
|
+
result = computer.execute()
|
|
73
|
+
# Automatically terminates on exit
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Why Batch Execution?
|
|
77
|
+
|
|
78
|
+
- **Performance**: Single API call instead of multiple
|
|
79
|
+
- **Atomic**: All actions or none (stops on first error)
|
|
80
|
+
- **Simpler**: Queue actions then execute
|
|
81
|
+
- **Efficient**: Network optimized
|
|
82
|
+
|
|
83
|
+
## Comparison
|
|
84
|
+
|
|
85
|
+
### asyncComputer (Batch)
|
|
86
|
+
```python
|
|
87
|
+
from tzafon import asyncComputer
|
|
88
|
+
|
|
89
|
+
client = asyncComputer()
|
|
90
|
+
computer = client.create(kind="browser")
|
|
91
|
+
computer.navigate("https://google.com") # Queued
|
|
92
|
+
computer.type("Hello") # Queued
|
|
93
|
+
computer.click(100, 200) # Queued
|
|
94
|
+
result = computer.execute() # Execute all
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### Computer (Immediate)
|
|
98
|
+
```python
|
|
99
|
+
from tzafon import Computer
|
|
100
|
+
|
|
101
|
+
client = Computer()
|
|
102
|
+
with client.create(kind="browser") as computer:
|
|
103
|
+
computer.navigate("https://google.com") # Executes immediately
|
|
104
|
+
computer.type("Hello") # Executes immediately
|
|
105
|
+
computer.click(100, 200) # Executes immediately
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### AsyncComputer (Async Immediate)
|
|
109
|
+
```python
|
|
110
|
+
from tzafon import AsyncComputer
|
|
111
|
+
|
|
112
|
+
client = AsyncComputer()
|
|
113
|
+
async with client.create(kind="browser") as computer:
|
|
114
|
+
await computer.navigate("https://google.com") # Async execute
|
|
115
|
+
await computer.type("Hello") # Async execute
|
|
116
|
+
await computer.click(100, 200) # Async execute
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
## Choose Your Style
|
|
120
|
+
|
|
121
|
+
- **`asyncComputer`** - Queue and batch execute
|
|
122
|
+
- **`Computer`** - Immediate sync execution
|
|
123
|
+
- **`AsyncComputer`** - Immediate async execution
|
|
124
|
+
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 1.3.2 (2025-10-08)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v1.3.1...v1.3.2](https://github.com/atulgavandetzafon/computer-python/compare/v1.3.1...v1.3.2)
|
|
6
|
+
|
|
7
|
+
### Chores
|
|
8
|
+
|
|
9
|
+
* update SDK settings ([05f237e](https://github.com/atulgavandetzafon/computer-python/commit/05f237ee8b8b72f28301dda597201e051f1b7ef4))
|
|
10
|
+
* update SDK settings ([89b4df6](https://github.com/atulgavandetzafon/computer-python/commit/89b4df64ee207a368dfa80e9ae47a9255da4d545))
|
|
11
|
+
|
|
12
|
+
## 1.3.1 (2025-10-08)
|
|
13
|
+
|
|
14
|
+
Full Changelog: [v1.3.0...v1.3.1](https://github.com/atulgavandetzafon/computer-python/compare/v1.3.0...v1.3.1)
|
|
15
|
+
|
|
16
|
+
## 1.3.0 (2025-10-08)
|
|
17
|
+
|
|
18
|
+
Full Changelog: [v1.2.0...v1.3.0](https://github.com/atulgavandetzafon/computer-python/compare/v1.2.0...v1.3.0)
|
|
19
|
+
|
|
20
|
+
### Features
|
|
21
|
+
|
|
22
|
+
* **api:** manual updates ([92a3ec3](https://github.com/atulgavandetzafon/computer-python/commit/92a3ec3c358004e432973fedd6844add8bcb1c7d))
|
|
23
|
+
|
|
24
|
+
## 1.2.0 (2025-10-08)
|
|
25
|
+
|
|
26
|
+
Full Changelog: [v1.1.4...v1.2.0](https://github.com/atulgavandetzafon/computer-python/compare/v1.1.4...v1.2.0)
|
|
27
|
+
|
|
28
|
+
### Features
|
|
29
|
+
|
|
30
|
+
* **api:** manual updates ([8ce5b6b](https://github.com/atulgavandetzafon/computer-python/commit/8ce5b6bc92fffc1baf956972489ceefbf987be3b))
|
|
31
|
+
* **api:** manual updates ([8fa5045](https://github.com/atulgavandetzafon/computer-python/commit/8fa5045b6bfbf00a3d44833100d36b58d27a83e3))
|
|
32
|
+
* **api:** manual updates ([3dc796f](https://github.com/atulgavandetzafon/computer-python/commit/3dc796fb27186307f81f6e3ad93e6715a707604d))
|
|
33
|
+
* **api:** manual updates ([ff7ae66](https://github.com/atulgavandetzafon/computer-python/commit/ff7ae66be8c4d9c69b52f803b23a0456aebe3c1e))
|
|
34
|
+
* **api:** manual updates ([3492063](https://github.com/atulgavandetzafon/computer-python/commit/3492063eeb600e5c42585ebc8805b50cc0ffe9c0))
|
|
35
|
+
* **api:** manual updates ([a68cfdb](https://github.com/atulgavandetzafon/computer-python/commit/a68cfdb2689829e82063eb672e1736e9f66bd81e))
|
|
36
|
+
* **api:** manual updates ([0e7ee2c](https://github.com/atulgavandetzafon/computer-python/commit/0e7ee2ca2568511b495a154a6b802dd5c4b42908))
|
|
37
|
+
|
|
38
|
+
## 1.1.4 (2025-10-08)
|
|
39
|
+
|
|
40
|
+
Full Changelog: [v1.1.3...v1.1.4](https://github.com/atulgavandetzafon/computer-python/compare/v1.1.3...v1.1.4)
|
|
41
|
+
|
|
42
|
+
## 1.1.3 (2025-10-08)
|
|
43
|
+
|
|
44
|
+
Full Changelog: [v1.1.2...v1.1.3](https://github.com/atulgavandetzafon/computer-python/compare/v1.1.2...v1.1.3)
|
|
45
|
+
|
|
46
|
+
## 1.1.2 (2025-10-08)
|
|
47
|
+
|
|
48
|
+
Full Changelog: [v1.1.1...v1.1.2](https://github.com/atulgavandetzafon/computer-python/compare/v1.1.1...v1.1.2)
|
|
49
|
+
|
|
50
|
+
## 1.1.1 (2025-10-08)
|
|
51
|
+
|
|
52
|
+
Full Changelog: [v1.1.0...v1.1.1](https://github.com/atulgavandetzafon/computer-python/compare/v1.1.0...v1.1.1)
|
|
53
|
+
|
|
54
|
+
## 1.1.0 (2025-10-07)
|
|
55
|
+
|
|
56
|
+
Full Changelog: [v1.0.1...v1.1.0](https://github.com/atulgavandetzafon/computer-python/compare/v1.0.1...v1.1.0)
|
|
57
|
+
|
|
58
|
+
### Features
|
|
59
|
+
|
|
60
|
+
* **api:** manual updates ([aaf8e53](https://github.com/atulgavandetzafon/computer-python/commit/aaf8e534415ea6bc8420f2ed8e3b854011a7bf71))
|
|
61
|
+
* **api:** manual updates ([833115e](https://github.com/atulgavandetzafon/computer-python/commit/833115e5e6814f6347de3e0521faceb4bf9e15e8))
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
### Chores
|
|
65
|
+
|
|
66
|
+
* update SDK settings ([0b62c4b](https://github.com/atulgavandetzafon/computer-python/commit/0b62c4b04323dabf192fe31e11f45ea94f366411))
|
|
67
|
+
|
|
68
|
+
## 1.0.1 (2025-10-07)
|
|
69
|
+
|
|
70
|
+
Full Changelog: [v0.0.1...v1.0.1](https://github.com/atulgavandetzafon/computer-python/compare/v0.0.1...v1.0.1)
|
|
71
|
+
|
|
72
|
+
### Features
|
|
73
|
+
|
|
74
|
+
* **api:** added python ([7bc6a73](https://github.com/atulgavandetzafon/computer-python/commit/7bc6a73f549bb57bb176de454d395fd692159a0e))
|
|
75
|
+
* **api:** manual updates ([57e4841](https://github.com/atulgavandetzafon/computer-python/commit/57e4841180a11f953e1d8db5e3c1ea7eebbb1d3e))
|
|
76
|
+
* **api:** manual updates ([a23814e](https://github.com/atulgavandetzafon/computer-python/commit/a23814e85afaa64e2a429b2bcb6507b0accb46bc))
|
|
77
|
+
* **api:** Updated to bearer auth ([c95903e](https://github.com/atulgavandetzafon/computer-python/commit/c95903e3795de2823b6266f914647dd55dc4eeba))
|
|
78
|
+
* **api:** v2 api ([db7fdb5](https://github.com/atulgavandetzafon/computer-python/commit/db7fdb5cbcb3ed5f38c2fcebe824573172c223d1))
|
|
79
|
+
* async ([38d796c](https://github.com/atulgavandetzafon/computer-python/commit/38d796c6538fad278abf122887a57a379c5a532b))
|
|
80
|
+
* lets test functionality ([3d5f515](https://github.com/atulgavandetzafon/computer-python/commit/3d5f515098e71964a431849a37c88a7a017424d2))
|
|
81
|
+
* wrapper test1 ([e329ec1](https://github.com/atulgavandetzafon/computer-python/commit/e329ec12ae711d64cad28e04a74bd7c1283669ce))
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
### Bug Fixes
|
|
85
|
+
|
|
86
|
+
* removed old async ([1b5c5cd](https://github.com/atulgavandetzafon/computer-python/commit/1b5c5cdf4a7c80089e8ca67e13540bdae898ac98))
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
### Chores
|
|
90
|
+
|
|
91
|
+
* update SDK settings ([a5da45a](https://github.com/atulgavandetzafon/computer-python/commit/a5da45a676c091d3d02fde9352d98d458e4dfe7f))
|
|
92
|
+
* update SDK settings ([3e68f6d](https://github.com/atulgavandetzafon/computer-python/commit/3e68f6db27fae3f75f411d76e15a6df07d22fa2b))
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
## Setting up the environment
|
|
2
|
+
|
|
3
|
+
### With Rye
|
|
4
|
+
|
|
5
|
+
We use [Rye](https://rye.astral.sh/) to manage dependencies because it will automatically provision a Python environment with the expected Python version. To set it up, run:
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
$ ./scripts/bootstrap
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Or [install Rye manually](https://rye.astral.sh/guide/installation/) and run:
|
|
12
|
+
|
|
13
|
+
```sh
|
|
14
|
+
$ rye sync --all-features
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
You can then run scripts using `rye run python script.py` or by activating the virtual environment:
|
|
18
|
+
|
|
19
|
+
```sh
|
|
20
|
+
# Activate the virtual environment - https://docs.python.org/3/library/venv.html#how-venvs-work
|
|
21
|
+
$ source .venv/bin/activate
|
|
22
|
+
|
|
23
|
+
# now you can omit the `rye run` prefix
|
|
24
|
+
$ python script.py
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### Without Rye
|
|
28
|
+
|
|
29
|
+
Alternatively if you don't want to install `Rye`, you can stick with the standard `pip` setup by ensuring you have the Python version specified in `.python-version`, create a virtual environment however you desire and then install dependencies using this command:
|
|
30
|
+
|
|
31
|
+
```sh
|
|
32
|
+
$ pip install -r requirements-dev.lock
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Modifying/Adding code
|
|
36
|
+
|
|
37
|
+
Most of the SDK is generated code. Modifications to code will be persisted between generations, but may
|
|
38
|
+
result in merge conflicts between manual patches and changes from the generator. The generator will never
|
|
39
|
+
modify the contents of the `src/tzafon/lib/` and `examples/` directories.
|
|
40
|
+
|
|
41
|
+
## Adding and running examples
|
|
42
|
+
|
|
43
|
+
All files in the `examples/` directory are not modified by the generator and can be freely edited or added to.
|
|
44
|
+
|
|
45
|
+
```py
|
|
46
|
+
# add an example to examples/<your-example>.py
|
|
47
|
+
|
|
48
|
+
#!/usr/bin/env -S rye run python
|
|
49
|
+
…
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
```sh
|
|
53
|
+
$ chmod +x examples/<your-example>.py
|
|
54
|
+
# run the example against your api
|
|
55
|
+
$ ./examples/<your-example>.py
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Using the repository from source
|
|
59
|
+
|
|
60
|
+
If you’d like to use the repository from source, you can either install from git or link to a cloned repository:
|
|
61
|
+
|
|
62
|
+
To install via git:
|
|
63
|
+
|
|
64
|
+
```sh
|
|
65
|
+
$ pip install git+ssh://git@github.com/atulgavandetzafon/computer-python.git
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Alternatively, you can build from source and install the wheel file:
|
|
69
|
+
|
|
70
|
+
Building this package will create two files in the `dist/` directory, a `.tar.gz` containing the source files and a `.whl` that can be used to install the package efficiently.
|
|
71
|
+
|
|
72
|
+
To create a distributable version of the library, all you have to do is run this command:
|
|
73
|
+
|
|
74
|
+
```sh
|
|
75
|
+
$ rye build
|
|
76
|
+
# or
|
|
77
|
+
$ python -m build
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Then to install:
|
|
81
|
+
|
|
82
|
+
```sh
|
|
83
|
+
$ pip install ./path-to-wheel-file.whl
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## Running tests
|
|
87
|
+
|
|
88
|
+
Most tests require you to [set up a mock server](https://github.com/stoplightio/prism) against the OpenAPI spec to run the tests.
|
|
89
|
+
|
|
90
|
+
```sh
|
|
91
|
+
# you will need npm installed
|
|
92
|
+
$ npx prism mock path/to/your/openapi.yml
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
```sh
|
|
96
|
+
$ ./scripts/test
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## Linting and formatting
|
|
100
|
+
|
|
101
|
+
This repository uses [ruff](https://github.com/astral-sh/ruff) and
|
|
102
|
+
[black](https://github.com/psf/black) to format the code in the repository.
|
|
103
|
+
|
|
104
|
+
To lint:
|
|
105
|
+
|
|
106
|
+
```sh
|
|
107
|
+
$ ./scripts/lint
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
To format and fix all ruff issues automatically:
|
|
111
|
+
|
|
112
|
+
```sh
|
|
113
|
+
$ ./scripts/format
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
## Publishing and releases
|
|
117
|
+
|
|
118
|
+
Changes made to this repository via the automated release PR pipeline should publish to PyPI automatically. If
|
|
119
|
+
the changes aren't made through the automated pipeline, you may want to make releases manually.
|
|
120
|
+
|
|
121
|
+
### Publish with a GitHub workflow
|
|
122
|
+
|
|
123
|
+
You can release to package managers by using [the `Publish PyPI` GitHub action](https://www.github.com/atulgavandetzafon/computer-python/actions/workflows/publish-pypi.yml). This requires a setup organization or repository secret to be set up.
|
|
124
|
+
|
|
125
|
+
### Publish manually
|
|
126
|
+
|
|
127
|
+
If you need to manually release a package, you can run the `bin/publish-pypi` script with a `PYPI_TOKEN` set on
|
|
128
|
+
the environment.
|
tzafon-1.3.2/LICENSE
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
Copyright 2025 computer
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
4
|
+
|
|
5
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
6
|
+
|
|
7
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|