meshtrade 0.0.1__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 meshtrade might be problematic. Click here for more details.
- meshtrade-0.0.1/LICENSE +10 -0
- meshtrade-0.0.1/PKG-INFO +190 -0
- meshtrade-0.0.1/README.md +159 -0
- meshtrade-0.0.1/pyproject.toml +62 -0
- meshtrade-0.0.1/setup.cfg +4 -0
- meshtrade-0.0.1/src/meshtrade/__init__.py +0 -0
- meshtrade-0.0.1/src/meshtrade/account/v1/__init__.py +7 -0
- meshtrade-0.0.1/src/meshtrade/account/v1/account_pb2.py +37 -0
- meshtrade-0.0.1/src/meshtrade/account/v1/account_pb2.pyi +11 -0
- meshtrade-0.0.1/src/meshtrade/account/v1/service_pb2.py +42 -0
- meshtrade-0.0.1/src/meshtrade/account/v1/service_pb2.pyi +19 -0
- meshtrade-0.0.1/src/meshtrade/iam/v1/__init__.py +11 -0
- meshtrade-0.0.1/src/meshtrade/iam/v1/permission_pb2.py +37 -0
- meshtrade-0.0.1/src/meshtrade/iam/v1/permission_pb2.pyi +15 -0
- meshtrade-0.0.1/src/meshtrade/iam/v1/role_pb2.py +38 -0
- meshtrade-0.0.1/src/meshtrade/iam/v1/role_pb2.pyi +16 -0
- meshtrade-0.0.1/src/meshtrade.egg-info/PKG-INFO +190 -0
- meshtrade-0.0.1/src/meshtrade.egg-info/SOURCES.txt +19 -0
- meshtrade-0.0.1/src/meshtrade.egg-info/dependency_links.txt +1 -0
- meshtrade-0.0.1/src/meshtrade.egg-info/requires.txt +10 -0
- meshtrade-0.0.1/src/meshtrade.egg-info/top_level.txt +1 -0
meshtrade-0.0.1/LICENSE
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
PROPRIETARY LICENSE
|
|
2
|
+
|
|
3
|
+
Copyright (c) [2021] [Mesh B.V.]
|
|
4
|
+
All rights reserved.
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any authorized client of Mesh B.V. ("the Client") to use this software ("the Software") solely for the purpose of integrating with and accessing Mesh B.V.'s private application programming interfaces ("the APIs").
|
|
7
|
+
|
|
8
|
+
The Software may not be used for any other purpose. The Client is not permitted to sublicense, modify, merge, publish, distribute, or sell copies of the Software, and the above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
9
|
+
|
|
10
|
+
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.
|
meshtrade-0.0.1/PKG-INFO
ADDED
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: meshtrade
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary: Integration SDK for Mesh API Services
|
|
5
|
+
Author-email: Bernard Bussy <bernard@meshtrade.co>
|
|
6
|
+
License-Expression: LicenseRef-My-Custom-License
|
|
7
|
+
Project-URL: Repository, https://github.com/meshtrade/api
|
|
8
|
+
Keywords: meshtrade,mesh,mesh-sdk,grpc,betterproto,grpclib
|
|
9
|
+
Classifier: Development Status :: 1 - Planning
|
|
10
|
+
Classifier: Intended Audience :: Developers
|
|
11
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Requires-Python: >=3.8
|
|
19
|
+
Description-Content-Type: text/markdown
|
|
20
|
+
License-File: LICENSE
|
|
21
|
+
Requires-Dist: grpcio<2.0,>=1.73.0
|
|
22
|
+
Requires-Dist: protobuf<7.0,>=6.31.1
|
|
23
|
+
Provides-Extra: dev
|
|
24
|
+
Requires-Dist: ruff~=0.11.13; extra == "dev"
|
|
25
|
+
Requires-Dist: pytest~=8.4.0; extra == "dev"
|
|
26
|
+
Requires-Dist: build~=1.2.2; extra == "dev"
|
|
27
|
+
Requires-Dist: twine~=6.1.0; extra == "dev"
|
|
28
|
+
Requires-Dist: tox~=4.26.0; extra == "dev"
|
|
29
|
+
Requires-Dist: types-protobuf~=6.30.2.20250516; extra == "dev"
|
|
30
|
+
Dynamic: license-file
|
|
31
|
+
|
|
32
|
+
# Python SDKs for Mesh APIs
|
|
33
|
+
|
|
34
|
+
[](https://github.com/meshtrade/api)
|
|
35
|
+
|
|
36
|
+
This directory is the Python Monorepo for all official Mesh API client SDKs.
|
|
37
|
+
|
|
38
|
+
## Quick Start for API Consumers
|
|
39
|
+
|
|
40
|
+
This guide is for developers who want to **use** these SDKs in their own applications.
|
|
41
|
+
|
|
42
|
+
### 1. Installation
|
|
43
|
+
|
|
44
|
+
Install the desired SDK integration library from PyPI using pip:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
pip install meshtrade
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### 2. Example Usage
|
|
51
|
+
Here is a basic example of how to use SDK clients:
|
|
52
|
+
```python
|
|
53
|
+
import asyncio
|
|
54
|
+
from meshtrade.account.v1 import AccountService
|
|
55
|
+
from meshtrade.iam.v1 import as IAMService
|
|
56
|
+
|
|
57
|
+
# NOTE: ensure that MESH_API_KEY="your-secret-api-key" is set
|
|
58
|
+
|
|
59
|
+
async def main():
|
|
60
|
+
# Instantiate the client for the Account v1 service
|
|
61
|
+
account_client = AccountService()
|
|
62
|
+
|
|
63
|
+
# Call an RPC method
|
|
64
|
+
try:
|
|
65
|
+
response = await account_client.get(number="1000111")
|
|
66
|
+
print("Successfully retrieved account:", response.account)
|
|
67
|
+
except Exception as e:
|
|
68
|
+
print(f"An error occurred: {e}")
|
|
69
|
+
|
|
70
|
+
# You can similarly use other clients
|
|
71
|
+
iam_client = IAMService()
|
|
72
|
+
# ... use iam_client ...
|
|
73
|
+
|
|
74
|
+
if __name__ == "__main__":
|
|
75
|
+
asyncio.run(main())
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
For more detailed information on each SDK, please see their individual READMEs:
|
|
79
|
+
* **[Account v1](python/mesh/account/v1/README.md)**
|
|
80
|
+
* **[IAM v1](python/mesh/iam/v1/README.md)**
|
|
81
|
+
|
|
82
|
+
## Repository Structure
|
|
83
|
+
This directory is a workspace within a larger polyglot monorepo. It manages versioned Python packages for each integration SDK.
|
|
84
|
+
|
|
85
|
+
```
|
|
86
|
+
└── python
|
|
87
|
+
├── README.md <-- You are HERE
|
|
88
|
+
├── pyproject.toml <-- SDK workspace configuration
|
|
89
|
+
├── requirements-dev.txt <-- SDK Workspace development requirements
|
|
90
|
+
├── tox.ini <-- Task automation configuration
|
|
91
|
+
├── src
|
|
92
|
+
│ └── meshtrade
|
|
93
|
+
│ ├── __init__.py
|
|
94
|
+
│ └── account <-- Defines the mesh account api service
|
|
95
|
+
│ └── vX <-- Defines the mesh account vX api SDK
|
|
96
|
+
│ ├── __init__.py
|
|
97
|
+
│ ├── account_pb2.py
|
|
98
|
+
│ └── README.md
|
|
99
|
+
└── tests
|
|
100
|
+
├── integration
|
|
101
|
+
└── unit
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
## Developer Guide
|
|
105
|
+
This guide is for developers contributing to these SDKs. It explains how to set up the local development environment for this Python monorepo.
|
|
106
|
+
|
|
107
|
+
### 1. Prerequisites:
|
|
108
|
+
- Python 3.8+
|
|
109
|
+
- The `venv` module (usually included with Python)
|
|
110
|
+
|
|
111
|
+
### 2. Environment Setup
|
|
112
|
+
All commands should be run from within this `python/` directory.
|
|
113
|
+
|
|
114
|
+
Create and activate a single shared virtual environment for the workspace:
|
|
115
|
+
```
|
|
116
|
+
python3 -m venv .venv
|
|
117
|
+
source .venv/bin/activate
|
|
118
|
+
```
|
|
119
|
+
Your terminal prompt should now be prefixed with (.venv), indicating the environment is active.
|
|
120
|
+
|
|
121
|
+
<b>Tip:</b> If you are in an IDE that supports python you can point your IDE to the interpreter in this environment relative to the source of the repository: `./python/.venv/bin/python`. e.g. with VS code:
|
|
122
|
+
|
|
123
|
+
'cmd + shift + p' > 'Python: Select Interpreter' > 'Enter interpreter path...' > './python/.venv/bin/python'
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
### 3. Install Dependencies
|
|
128
|
+
|
|
129
|
+
This project uses `pip-tools` to manage dependencies for a reproducible development environment.
|
|
130
|
+
The top-level `pyproject.toml` is the source of truth for our direct dependencies, and `requirements-dev.txt` is the "lock file" that guarantees identical setups for everyone.
|
|
131
|
+
|
|
132
|
+
**A) For a new setup (e.g. after a `git pull`):**
|
|
133
|
+
|
|
134
|
+
Install the locked dependencies from `requirements-dev.txt`:
|
|
135
|
+
```bash
|
|
136
|
+
pip install -r requirements-dev.txt
|
|
137
|
+
```
|
|
138
|
+
This synchronises the local virtual environment to match the exact versions in the lock file.
|
|
139
|
+
|
|
140
|
+
Once this is complete you are set up to begin programming in the sdk source code in: `./python/src/mesh`.
|
|
141
|
+
|
|
142
|
+
Next to make the SDK discoverable locally for tests do:
|
|
143
|
+
```
|
|
144
|
+
pip install -e .
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
**B) After a manual change to `pyproject.toml` (e.g. to install a new workspace level dependency or bump its version):**
|
|
148
|
+
|
|
149
|
+
If changes are made in the pyproject.toml then the lockfile must be regenerated:
|
|
150
|
+
```
|
|
151
|
+
# Step 1: Re-compile the dependencies to update the lock file
|
|
152
|
+
pip-compile --extra=dev --output-file=requirements-dev.txt pyproject.toml
|
|
153
|
+
|
|
154
|
+
# Step 2: Synchronise the local virtual environment again with the newly updated lock file
|
|
155
|
+
pip install -r requirements-dev.txt
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
### 4. Run Common Development Tasks
|
|
159
|
+
Tox is used as the as the main command runner for all common tasks like linting, testing, and building.
|
|
160
|
+
|
|
161
|
+
Tasks can be run from the command line (within the active virtual environment) as follows:
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
- The linter:
|
|
165
|
+
```
|
|
166
|
+
tox -e lint
|
|
167
|
+
```
|
|
168
|
+
- The unit tests:
|
|
169
|
+
```
|
|
170
|
+
tox -e unit-tests
|
|
171
|
+
```
|
|
172
|
+
- The integration tests:
|
|
173
|
+
```
|
|
174
|
+
MESH_API_KEY="your-secret-api-key" tox -e integration-tests
|
|
175
|
+
```
|
|
176
|
+
- All checks (linting and unit tests):
|
|
177
|
+
```
|
|
178
|
+
tox
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
### 5. Building and Publishing Packages
|
|
182
|
+
- *Build all packages:* The build task in tox will create the distributable wheel (.whl) and sdist (.tar.gz) files for all packages and place them in their respective dist/ folders.
|
|
183
|
+
```
|
|
184
|
+
tox -e build
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
- *Publish to PyPi:* The `twine` tool is used to securely upload the built packages to PyPI. This is done as part of the official release process.
|
|
188
|
+
```
|
|
189
|
+
twine upload lib/*/v*/dist/*
|
|
190
|
+
```
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
# Python SDKs for Mesh APIs
|
|
2
|
+
|
|
3
|
+
[](https://github.com/meshtrade/api)
|
|
4
|
+
|
|
5
|
+
This directory is the Python Monorepo for all official Mesh API client SDKs.
|
|
6
|
+
|
|
7
|
+
## Quick Start for API Consumers
|
|
8
|
+
|
|
9
|
+
This guide is for developers who want to **use** these SDKs in their own applications.
|
|
10
|
+
|
|
11
|
+
### 1. Installation
|
|
12
|
+
|
|
13
|
+
Install the desired SDK integration library from PyPI using pip:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
pip install meshtrade
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### 2. Example Usage
|
|
20
|
+
Here is a basic example of how to use SDK clients:
|
|
21
|
+
```python
|
|
22
|
+
import asyncio
|
|
23
|
+
from meshtrade.account.v1 import AccountService
|
|
24
|
+
from meshtrade.iam.v1 import as IAMService
|
|
25
|
+
|
|
26
|
+
# NOTE: ensure that MESH_API_KEY="your-secret-api-key" is set
|
|
27
|
+
|
|
28
|
+
async def main():
|
|
29
|
+
# Instantiate the client for the Account v1 service
|
|
30
|
+
account_client = AccountService()
|
|
31
|
+
|
|
32
|
+
# Call an RPC method
|
|
33
|
+
try:
|
|
34
|
+
response = await account_client.get(number="1000111")
|
|
35
|
+
print("Successfully retrieved account:", response.account)
|
|
36
|
+
except Exception as e:
|
|
37
|
+
print(f"An error occurred: {e}")
|
|
38
|
+
|
|
39
|
+
# You can similarly use other clients
|
|
40
|
+
iam_client = IAMService()
|
|
41
|
+
# ... use iam_client ...
|
|
42
|
+
|
|
43
|
+
if __name__ == "__main__":
|
|
44
|
+
asyncio.run(main())
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
For more detailed information on each SDK, please see their individual READMEs:
|
|
48
|
+
* **[Account v1](python/mesh/account/v1/README.md)**
|
|
49
|
+
* **[IAM v1](python/mesh/iam/v1/README.md)**
|
|
50
|
+
|
|
51
|
+
## Repository Structure
|
|
52
|
+
This directory is a workspace within a larger polyglot monorepo. It manages versioned Python packages for each integration SDK.
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
└── python
|
|
56
|
+
├── README.md <-- You are HERE
|
|
57
|
+
├── pyproject.toml <-- SDK workspace configuration
|
|
58
|
+
├── requirements-dev.txt <-- SDK Workspace development requirements
|
|
59
|
+
├── tox.ini <-- Task automation configuration
|
|
60
|
+
├── src
|
|
61
|
+
│ └── meshtrade
|
|
62
|
+
│ ├── __init__.py
|
|
63
|
+
│ └── account <-- Defines the mesh account api service
|
|
64
|
+
│ └── vX <-- Defines the mesh account vX api SDK
|
|
65
|
+
│ ├── __init__.py
|
|
66
|
+
│ ├── account_pb2.py
|
|
67
|
+
│ └── README.md
|
|
68
|
+
└── tests
|
|
69
|
+
├── integration
|
|
70
|
+
└── unit
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Developer Guide
|
|
74
|
+
This guide is for developers contributing to these SDKs. It explains how to set up the local development environment for this Python monorepo.
|
|
75
|
+
|
|
76
|
+
### 1. Prerequisites:
|
|
77
|
+
- Python 3.8+
|
|
78
|
+
- The `venv` module (usually included with Python)
|
|
79
|
+
|
|
80
|
+
### 2. Environment Setup
|
|
81
|
+
All commands should be run from within this `python/` directory.
|
|
82
|
+
|
|
83
|
+
Create and activate a single shared virtual environment for the workspace:
|
|
84
|
+
```
|
|
85
|
+
python3 -m venv .venv
|
|
86
|
+
source .venv/bin/activate
|
|
87
|
+
```
|
|
88
|
+
Your terminal prompt should now be prefixed with (.venv), indicating the environment is active.
|
|
89
|
+
|
|
90
|
+
<b>Tip:</b> If you are in an IDE that supports python you can point your IDE to the interpreter in this environment relative to the source of the repository: `./python/.venv/bin/python`. e.g. with VS code:
|
|
91
|
+
|
|
92
|
+
'cmd + shift + p' > 'Python: Select Interpreter' > 'Enter interpreter path...' > './python/.venv/bin/python'
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
### 3. Install Dependencies
|
|
97
|
+
|
|
98
|
+
This project uses `pip-tools` to manage dependencies for a reproducible development environment.
|
|
99
|
+
The top-level `pyproject.toml` is the source of truth for our direct dependencies, and `requirements-dev.txt` is the "lock file" that guarantees identical setups for everyone.
|
|
100
|
+
|
|
101
|
+
**A) For a new setup (e.g. after a `git pull`):**
|
|
102
|
+
|
|
103
|
+
Install the locked dependencies from `requirements-dev.txt`:
|
|
104
|
+
```bash
|
|
105
|
+
pip install -r requirements-dev.txt
|
|
106
|
+
```
|
|
107
|
+
This synchronises the local virtual environment to match the exact versions in the lock file.
|
|
108
|
+
|
|
109
|
+
Once this is complete you are set up to begin programming in the sdk source code in: `./python/src/mesh`.
|
|
110
|
+
|
|
111
|
+
Next to make the SDK discoverable locally for tests do:
|
|
112
|
+
```
|
|
113
|
+
pip install -e .
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
**B) After a manual change to `pyproject.toml` (e.g. to install a new workspace level dependency or bump its version):**
|
|
117
|
+
|
|
118
|
+
If changes are made in the pyproject.toml then the lockfile must be regenerated:
|
|
119
|
+
```
|
|
120
|
+
# Step 1: Re-compile the dependencies to update the lock file
|
|
121
|
+
pip-compile --extra=dev --output-file=requirements-dev.txt pyproject.toml
|
|
122
|
+
|
|
123
|
+
# Step 2: Synchronise the local virtual environment again with the newly updated lock file
|
|
124
|
+
pip install -r requirements-dev.txt
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### 4. Run Common Development Tasks
|
|
128
|
+
Tox is used as the as the main command runner for all common tasks like linting, testing, and building.
|
|
129
|
+
|
|
130
|
+
Tasks can be run from the command line (within the active virtual environment) as follows:
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
- The linter:
|
|
134
|
+
```
|
|
135
|
+
tox -e lint
|
|
136
|
+
```
|
|
137
|
+
- The unit tests:
|
|
138
|
+
```
|
|
139
|
+
tox -e unit-tests
|
|
140
|
+
```
|
|
141
|
+
- The integration tests:
|
|
142
|
+
```
|
|
143
|
+
MESH_API_KEY="your-secret-api-key" tox -e integration-tests
|
|
144
|
+
```
|
|
145
|
+
- All checks (linting and unit tests):
|
|
146
|
+
```
|
|
147
|
+
tox
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
### 5. Building and Publishing Packages
|
|
151
|
+
- *Build all packages:* The build task in tox will create the distributable wheel (.whl) and sdist (.tar.gz) files for all packages and place them in their respective dist/ folders.
|
|
152
|
+
```
|
|
153
|
+
tox -e build
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
- *Publish to PyPi:* The `twine` tool is used to securely upload the built packages to PyPI. This is done as part of the official release process.
|
|
157
|
+
```
|
|
158
|
+
twine upload lib/*/v*/dist/*
|
|
159
|
+
```
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "meshtrade"
|
|
7
|
+
version = "v0.0.1"
|
|
8
|
+
authors = [
|
|
9
|
+
{ name = "Bernard Bussy", email = "bernard@meshtrade.co" },
|
|
10
|
+
]
|
|
11
|
+
description = "Integration SDK for Mesh API Services"
|
|
12
|
+
requires-python = ">=3.8"
|
|
13
|
+
keywords = ["meshtrade", "mesh", "mesh-sdk", "grpc", "betterproto", "grpclib"]
|
|
14
|
+
license = "LicenseRef-My-Custom-License"
|
|
15
|
+
license-files = ["LICENSE"]
|
|
16
|
+
readme = "README.md"
|
|
17
|
+
dependencies = [
|
|
18
|
+
"grpcio >= 1.73.0, < 2.0",
|
|
19
|
+
"protobuf >= 6.31.1, < 7.0",
|
|
20
|
+
]
|
|
21
|
+
classifiers = [
|
|
22
|
+
# --- Development Status ---
|
|
23
|
+
"Development Status :: 1 - Planning",
|
|
24
|
+
|
|
25
|
+
# --- Audience & Topic ---
|
|
26
|
+
"Intended Audience :: Developers",
|
|
27
|
+
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
28
|
+
|
|
29
|
+
# --- Python Versions Supported ---
|
|
30
|
+
"Programming Language :: Python :: 3",
|
|
31
|
+
"Programming Language :: Python :: 3.8",
|
|
32
|
+
"Programming Language :: Python :: 3.9",
|
|
33
|
+
"Programming Language :: Python :: 3.10",
|
|
34
|
+
"Programming Language :: Python :: 3.11",
|
|
35
|
+
"Programming Language :: Python :: 3.12",
|
|
36
|
+
]
|
|
37
|
+
urls = {"Repository"= "https://github.com/meshtrade/api"}
|
|
38
|
+
|
|
39
|
+
[project.optional-dependencies]
|
|
40
|
+
dev = [
|
|
41
|
+
"ruff ~= 0.11.13",
|
|
42
|
+
"pytest ~= 8.4.0",
|
|
43
|
+
"build ~= 1.2.2",
|
|
44
|
+
"twine ~= 6.1.0",
|
|
45
|
+
"tox ~= 4.26.0",
|
|
46
|
+
"types-protobuf ~= 6.30.2.20250516",
|
|
47
|
+
]
|
|
48
|
+
|
|
49
|
+
[tool.setuptools.packages.find]
|
|
50
|
+
where = ["src"]
|
|
51
|
+
|
|
52
|
+
# --- Ruff Configuration (Linter and Formatter) ---
|
|
53
|
+
[tool.ruff]
|
|
54
|
+
target-version = "py38"
|
|
55
|
+
line-length = 88
|
|
56
|
+
exclude = ["*_pb2.py", "*_pb2.pyi"]
|
|
57
|
+
|
|
58
|
+
[tool.ruff.lint]
|
|
59
|
+
# E/W: flake8 errors/warnings | F: Pyflakes
|
|
60
|
+
# I: isort | B: flake8-bugbear | C4: flake8-comprehensions
|
|
61
|
+
# SIM: flake8-simplify | UP: pyupgrade | TID: flake8-tidy-imports
|
|
62
|
+
select = ["E", "W", "F", "I", "B", "C4", "SIM", "UP", "TID"]
|
|
File without changes
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
3
|
+
# NO CHECKED-IN PROTOBUF GENCODE
|
|
4
|
+
# source: meshtrade/account/v1/account.proto
|
|
5
|
+
# Protobuf Python Version: 6.31.1
|
|
6
|
+
"""Generated protocol buffer code."""
|
|
7
|
+
from google.protobuf import descriptor as _descriptor
|
|
8
|
+
from google.protobuf import descriptor_pool as _descriptor_pool
|
|
9
|
+
from google.protobuf import runtime_version as _runtime_version
|
|
10
|
+
from google.protobuf import symbol_database as _symbol_database
|
|
11
|
+
from google.protobuf.internal import builder as _builder
|
|
12
|
+
_runtime_version.ValidateProtobufRuntimeVersion(
|
|
13
|
+
_runtime_version.Domain.PUBLIC,
|
|
14
|
+
6,
|
|
15
|
+
31,
|
|
16
|
+
1,
|
|
17
|
+
'',
|
|
18
|
+
'meshtrade/account/v1/account.proto'
|
|
19
|
+
)
|
|
20
|
+
# @@protoc_insertion_point(imports)
|
|
21
|
+
|
|
22
|
+
_sym_db = _symbol_database.Default()
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\"meshtrade/account/v1/account.proto\x12\x14meshtrade.account.v1\"\x1d\n\x07\x41\x63\x63ount\x12\x12\n\x04name\x18\x01 \x01(\tR\x04nameB(Z&github.com/meshtrade/api/go/account/v1b\x06proto3')
|
|
28
|
+
|
|
29
|
+
_globals = globals()
|
|
30
|
+
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
|
31
|
+
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'meshtrade.account.v1.account_pb2', _globals)
|
|
32
|
+
if not _descriptor._USE_C_DESCRIPTORS:
|
|
33
|
+
_globals['DESCRIPTOR']._loaded_options = None
|
|
34
|
+
_globals['DESCRIPTOR']._serialized_options = b'Z&github.com/meshtrade/api/go/account/v1'
|
|
35
|
+
_globals['_ACCOUNT']._serialized_start=60
|
|
36
|
+
_globals['_ACCOUNT']._serialized_end=89
|
|
37
|
+
# @@protoc_insertion_point(module_scope)
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
from google.protobuf import descriptor as _descriptor
|
|
2
|
+
from google.protobuf import message as _message
|
|
3
|
+
from typing import ClassVar as _ClassVar, Optional as _Optional
|
|
4
|
+
|
|
5
|
+
DESCRIPTOR: _descriptor.FileDescriptor
|
|
6
|
+
|
|
7
|
+
class Account(_message.Message):
|
|
8
|
+
__slots__ = ("name",)
|
|
9
|
+
NAME_FIELD_NUMBER: _ClassVar[int]
|
|
10
|
+
name: str
|
|
11
|
+
def __init__(self, name: _Optional[str] = ...) -> None: ...
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
3
|
+
# NO CHECKED-IN PROTOBUF GENCODE
|
|
4
|
+
# source: meshtrade/account/v1/service.proto
|
|
5
|
+
# Protobuf Python Version: 6.31.1
|
|
6
|
+
"""Generated protocol buffer code."""
|
|
7
|
+
from google.protobuf import descriptor as _descriptor
|
|
8
|
+
from google.protobuf import descriptor_pool as _descriptor_pool
|
|
9
|
+
from google.protobuf import runtime_version as _runtime_version
|
|
10
|
+
from google.protobuf import symbol_database as _symbol_database
|
|
11
|
+
from google.protobuf.internal import builder as _builder
|
|
12
|
+
_runtime_version.ValidateProtobufRuntimeVersion(
|
|
13
|
+
_runtime_version.Domain.PUBLIC,
|
|
14
|
+
6,
|
|
15
|
+
31,
|
|
16
|
+
1,
|
|
17
|
+
'',
|
|
18
|
+
'meshtrade/account/v1/service.proto'
|
|
19
|
+
)
|
|
20
|
+
# @@protoc_insertion_point(imports)
|
|
21
|
+
|
|
22
|
+
_sym_db = _symbol_database.Default()
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
from meshtrade.account.v1 import account_pb2 as meshtrade_dot_account_dot_v1_dot_account__pb2
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\"meshtrade/account/v1/service.proto\x12\x14meshtrade.account.v1\x1a\"meshtrade/account/v1/account.proto\"$\n\nGetRequest\x12\x16\n\x06number\x18\x01 \x01(\tR\x06number\"F\n\x0bGetResponse\x12\x37\n\x07\x61\x63\x63ount\x18\x01 \x01(\x0b\x32\x1d.meshtrade.account.v1.AccountR\x07\x61\x63\x63ount2U\n\x07Service\x12J\n\x03Get\x12 .meshtrade.account.v1.GetRequest\x1a!.meshtrade.account.v1.GetResponseB(Z&github.com/meshtrade/api/go/account/v1b\x06proto3')
|
|
29
|
+
|
|
30
|
+
_globals = globals()
|
|
31
|
+
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
|
32
|
+
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'meshtrade.account.v1.service_pb2', _globals)
|
|
33
|
+
if not _descriptor._USE_C_DESCRIPTORS:
|
|
34
|
+
_globals['DESCRIPTOR']._loaded_options = None
|
|
35
|
+
_globals['DESCRIPTOR']._serialized_options = b'Z&github.com/meshtrade/api/go/account/v1'
|
|
36
|
+
_globals['_GETREQUEST']._serialized_start=96
|
|
37
|
+
_globals['_GETREQUEST']._serialized_end=132
|
|
38
|
+
_globals['_GETRESPONSE']._serialized_start=134
|
|
39
|
+
_globals['_GETRESPONSE']._serialized_end=204
|
|
40
|
+
_globals['_SERVICE']._serialized_start=206
|
|
41
|
+
_globals['_SERVICE']._serialized_end=291
|
|
42
|
+
# @@protoc_insertion_point(module_scope)
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
from meshtrade.account.v1 import account_pb2 as _account_pb2
|
|
2
|
+
from google.protobuf import descriptor as _descriptor
|
|
3
|
+
from google.protobuf import message as _message
|
|
4
|
+
from collections.abc import Mapping as _Mapping
|
|
5
|
+
from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union
|
|
6
|
+
|
|
7
|
+
DESCRIPTOR: _descriptor.FileDescriptor
|
|
8
|
+
|
|
9
|
+
class GetRequest(_message.Message):
|
|
10
|
+
__slots__ = ("number",)
|
|
11
|
+
NUMBER_FIELD_NUMBER: _ClassVar[int]
|
|
12
|
+
number: str
|
|
13
|
+
def __init__(self, number: _Optional[str] = ...) -> None: ...
|
|
14
|
+
|
|
15
|
+
class GetResponse(_message.Message):
|
|
16
|
+
__slots__ = ("account",)
|
|
17
|
+
ACCOUNT_FIELD_NUMBER: _ClassVar[int]
|
|
18
|
+
account: _account_pb2.Account
|
|
19
|
+
def __init__(self, account: _Optional[_Union[_account_pb2.Account, _Mapping]] = ...) -> None: ...
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
3
|
+
# NO CHECKED-IN PROTOBUF GENCODE
|
|
4
|
+
# source: meshtrade/iam/v1/permission.proto
|
|
5
|
+
# Protobuf Python Version: 6.31.1
|
|
6
|
+
"""Generated protocol buffer code."""
|
|
7
|
+
from google.protobuf import descriptor as _descriptor
|
|
8
|
+
from google.protobuf import descriptor_pool as _descriptor_pool
|
|
9
|
+
from google.protobuf import runtime_version as _runtime_version
|
|
10
|
+
from google.protobuf import symbol_database as _symbol_database
|
|
11
|
+
from google.protobuf.internal import builder as _builder
|
|
12
|
+
_runtime_version.ValidateProtobufRuntimeVersion(
|
|
13
|
+
_runtime_version.Domain.PUBLIC,
|
|
14
|
+
6,
|
|
15
|
+
31,
|
|
16
|
+
1,
|
|
17
|
+
'',
|
|
18
|
+
'meshtrade/iam/v1/permission.proto'
|
|
19
|
+
)
|
|
20
|
+
# @@protoc_insertion_point(imports)
|
|
21
|
+
|
|
22
|
+
_sym_db = _symbol_database.Default()
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n!meshtrade/iam/v1/permission.proto\x12\x10meshtrade.iam.v1\"s\n\nPermission\x12)\n\x10service_provider\x18\x01 \x01(\tR\x0fserviceProvider\x12\x18\n\x07service\x18\x02 \x01(\tR\x07service\x12 \n\x0b\x64\x65scription\x18\x03 \x01(\tR\x0b\x64\x65scriptionB$Z\"github.com/meshtrade/api/go/iam/v1b\x06proto3')
|
|
28
|
+
|
|
29
|
+
_globals = globals()
|
|
30
|
+
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
|
31
|
+
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'meshtrade.iam.v1.permission_pb2', _globals)
|
|
32
|
+
if not _descriptor._USE_C_DESCRIPTORS:
|
|
33
|
+
_globals['DESCRIPTOR']._loaded_options = None
|
|
34
|
+
_globals['DESCRIPTOR']._serialized_options = b'Z\"github.com/meshtrade/api/go/iam/v1'
|
|
35
|
+
_globals['_PERMISSION']._serialized_start=55
|
|
36
|
+
_globals['_PERMISSION']._serialized_end=170
|
|
37
|
+
# @@protoc_insertion_point(module_scope)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
from google.protobuf import descriptor as _descriptor
|
|
2
|
+
from google.protobuf import message as _message
|
|
3
|
+
from typing import ClassVar as _ClassVar, Optional as _Optional
|
|
4
|
+
|
|
5
|
+
DESCRIPTOR: _descriptor.FileDescriptor
|
|
6
|
+
|
|
7
|
+
class Permission(_message.Message):
|
|
8
|
+
__slots__ = ("service_provider", "service", "description")
|
|
9
|
+
SERVICE_PROVIDER_FIELD_NUMBER: _ClassVar[int]
|
|
10
|
+
SERVICE_FIELD_NUMBER: _ClassVar[int]
|
|
11
|
+
DESCRIPTION_FIELD_NUMBER: _ClassVar[int]
|
|
12
|
+
service_provider: str
|
|
13
|
+
service: str
|
|
14
|
+
description: str
|
|
15
|
+
def __init__(self, service_provider: _Optional[str] = ..., service: _Optional[str] = ..., description: _Optional[str] = ...) -> None: ...
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
3
|
+
# NO CHECKED-IN PROTOBUF GENCODE
|
|
4
|
+
# source: meshtrade/iam/v1/role.proto
|
|
5
|
+
# Protobuf Python Version: 6.31.1
|
|
6
|
+
"""Generated protocol buffer code."""
|
|
7
|
+
from google.protobuf import descriptor as _descriptor
|
|
8
|
+
from google.protobuf import descriptor_pool as _descriptor_pool
|
|
9
|
+
from google.protobuf import runtime_version as _runtime_version
|
|
10
|
+
from google.protobuf import symbol_database as _symbol_database
|
|
11
|
+
from google.protobuf.internal import builder as _builder
|
|
12
|
+
_runtime_version.ValidateProtobufRuntimeVersion(
|
|
13
|
+
_runtime_version.Domain.PUBLIC,
|
|
14
|
+
6,
|
|
15
|
+
31,
|
|
16
|
+
1,
|
|
17
|
+
'',
|
|
18
|
+
'meshtrade/iam/v1/role.proto'
|
|
19
|
+
)
|
|
20
|
+
# @@protoc_insertion_point(imports)
|
|
21
|
+
|
|
22
|
+
_sym_db = _symbol_database.Default()
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
from meshtrade.iam.v1 import permission_pb2 as meshtrade_dot_iam_dot_v1_dot_permission__pb2
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1bmeshtrade/iam/v1/role.proto\x12\x10meshtrade.iam.v1\x1a!meshtrade/iam/v1/permission.proto\"Z\n\x04Role\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12>\n\x0bpermissions\x18\x02 \x03(\x0b\x32\x1c.meshtrade.iam.v1.PermissionR\x0bpermissionsB$Z\"github.com/meshtrade/api/go/iam/v1b\x06proto3')
|
|
29
|
+
|
|
30
|
+
_globals = globals()
|
|
31
|
+
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
|
32
|
+
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'meshtrade.iam.v1.role_pb2', _globals)
|
|
33
|
+
if not _descriptor._USE_C_DESCRIPTORS:
|
|
34
|
+
_globals['DESCRIPTOR']._loaded_options = None
|
|
35
|
+
_globals['DESCRIPTOR']._serialized_options = b'Z\"github.com/meshtrade/api/go/iam/v1'
|
|
36
|
+
_globals['_ROLE']._serialized_start=84
|
|
37
|
+
_globals['_ROLE']._serialized_end=174
|
|
38
|
+
# @@protoc_insertion_point(module_scope)
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
from meshtrade.iam.v1 import permission_pb2 as _permission_pb2
|
|
2
|
+
from google.protobuf.internal import containers as _containers
|
|
3
|
+
from google.protobuf import descriptor as _descriptor
|
|
4
|
+
from google.protobuf import message as _message
|
|
5
|
+
from collections.abc import Iterable as _Iterable, Mapping as _Mapping
|
|
6
|
+
from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union
|
|
7
|
+
|
|
8
|
+
DESCRIPTOR: _descriptor.FileDescriptor
|
|
9
|
+
|
|
10
|
+
class Role(_message.Message):
|
|
11
|
+
__slots__ = ("name", "permissions")
|
|
12
|
+
NAME_FIELD_NUMBER: _ClassVar[int]
|
|
13
|
+
PERMISSIONS_FIELD_NUMBER: _ClassVar[int]
|
|
14
|
+
name: str
|
|
15
|
+
permissions: _containers.RepeatedCompositeFieldContainer[_permission_pb2.Permission]
|
|
16
|
+
def __init__(self, name: _Optional[str] = ..., permissions: _Optional[_Iterable[_Union[_permission_pb2.Permission, _Mapping]]] = ...) -> None: ...
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: meshtrade
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary: Integration SDK for Mesh API Services
|
|
5
|
+
Author-email: Bernard Bussy <bernard@meshtrade.co>
|
|
6
|
+
License-Expression: LicenseRef-My-Custom-License
|
|
7
|
+
Project-URL: Repository, https://github.com/meshtrade/api
|
|
8
|
+
Keywords: meshtrade,mesh,mesh-sdk,grpc,betterproto,grpclib
|
|
9
|
+
Classifier: Development Status :: 1 - Planning
|
|
10
|
+
Classifier: Intended Audience :: Developers
|
|
11
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Requires-Python: >=3.8
|
|
19
|
+
Description-Content-Type: text/markdown
|
|
20
|
+
License-File: LICENSE
|
|
21
|
+
Requires-Dist: grpcio<2.0,>=1.73.0
|
|
22
|
+
Requires-Dist: protobuf<7.0,>=6.31.1
|
|
23
|
+
Provides-Extra: dev
|
|
24
|
+
Requires-Dist: ruff~=0.11.13; extra == "dev"
|
|
25
|
+
Requires-Dist: pytest~=8.4.0; extra == "dev"
|
|
26
|
+
Requires-Dist: build~=1.2.2; extra == "dev"
|
|
27
|
+
Requires-Dist: twine~=6.1.0; extra == "dev"
|
|
28
|
+
Requires-Dist: tox~=4.26.0; extra == "dev"
|
|
29
|
+
Requires-Dist: types-protobuf~=6.30.2.20250516; extra == "dev"
|
|
30
|
+
Dynamic: license-file
|
|
31
|
+
|
|
32
|
+
# Python SDKs for Mesh APIs
|
|
33
|
+
|
|
34
|
+
[](https://github.com/meshtrade/api)
|
|
35
|
+
|
|
36
|
+
This directory is the Python Monorepo for all official Mesh API client SDKs.
|
|
37
|
+
|
|
38
|
+
## Quick Start for API Consumers
|
|
39
|
+
|
|
40
|
+
This guide is for developers who want to **use** these SDKs in their own applications.
|
|
41
|
+
|
|
42
|
+
### 1. Installation
|
|
43
|
+
|
|
44
|
+
Install the desired SDK integration library from PyPI using pip:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
pip install meshtrade
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### 2. Example Usage
|
|
51
|
+
Here is a basic example of how to use SDK clients:
|
|
52
|
+
```python
|
|
53
|
+
import asyncio
|
|
54
|
+
from meshtrade.account.v1 import AccountService
|
|
55
|
+
from meshtrade.iam.v1 import as IAMService
|
|
56
|
+
|
|
57
|
+
# NOTE: ensure that MESH_API_KEY="your-secret-api-key" is set
|
|
58
|
+
|
|
59
|
+
async def main():
|
|
60
|
+
# Instantiate the client for the Account v1 service
|
|
61
|
+
account_client = AccountService()
|
|
62
|
+
|
|
63
|
+
# Call an RPC method
|
|
64
|
+
try:
|
|
65
|
+
response = await account_client.get(number="1000111")
|
|
66
|
+
print("Successfully retrieved account:", response.account)
|
|
67
|
+
except Exception as e:
|
|
68
|
+
print(f"An error occurred: {e}")
|
|
69
|
+
|
|
70
|
+
# You can similarly use other clients
|
|
71
|
+
iam_client = IAMService()
|
|
72
|
+
# ... use iam_client ...
|
|
73
|
+
|
|
74
|
+
if __name__ == "__main__":
|
|
75
|
+
asyncio.run(main())
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
For more detailed information on each SDK, please see their individual READMEs:
|
|
79
|
+
* **[Account v1](python/mesh/account/v1/README.md)**
|
|
80
|
+
* **[IAM v1](python/mesh/iam/v1/README.md)**
|
|
81
|
+
|
|
82
|
+
## Repository Structure
|
|
83
|
+
This directory is a workspace within a larger polyglot monorepo. It manages versioned Python packages for each integration SDK.
|
|
84
|
+
|
|
85
|
+
```
|
|
86
|
+
└── python
|
|
87
|
+
├── README.md <-- You are HERE
|
|
88
|
+
├── pyproject.toml <-- SDK workspace configuration
|
|
89
|
+
├── requirements-dev.txt <-- SDK Workspace development requirements
|
|
90
|
+
├── tox.ini <-- Task automation configuration
|
|
91
|
+
├── src
|
|
92
|
+
│ └── meshtrade
|
|
93
|
+
│ ├── __init__.py
|
|
94
|
+
│ └── account <-- Defines the mesh account api service
|
|
95
|
+
│ └── vX <-- Defines the mesh account vX api SDK
|
|
96
|
+
│ ├── __init__.py
|
|
97
|
+
│ ├── account_pb2.py
|
|
98
|
+
│ └── README.md
|
|
99
|
+
└── tests
|
|
100
|
+
├── integration
|
|
101
|
+
└── unit
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
## Developer Guide
|
|
105
|
+
This guide is for developers contributing to these SDKs. It explains how to set up the local development environment for this Python monorepo.
|
|
106
|
+
|
|
107
|
+
### 1. Prerequisites:
|
|
108
|
+
- Python 3.8+
|
|
109
|
+
- The `venv` module (usually included with Python)
|
|
110
|
+
|
|
111
|
+
### 2. Environment Setup
|
|
112
|
+
All commands should be run from within this `python/` directory.
|
|
113
|
+
|
|
114
|
+
Create and activate a single shared virtual environment for the workspace:
|
|
115
|
+
```
|
|
116
|
+
python3 -m venv .venv
|
|
117
|
+
source .venv/bin/activate
|
|
118
|
+
```
|
|
119
|
+
Your terminal prompt should now be prefixed with (.venv), indicating the environment is active.
|
|
120
|
+
|
|
121
|
+
<b>Tip:</b> If you are in an IDE that supports python you can point your IDE to the interpreter in this environment relative to the source of the repository: `./python/.venv/bin/python`. e.g. with VS code:
|
|
122
|
+
|
|
123
|
+
'cmd + shift + p' > 'Python: Select Interpreter' > 'Enter interpreter path...' > './python/.venv/bin/python'
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
### 3. Install Dependencies
|
|
128
|
+
|
|
129
|
+
This project uses `pip-tools` to manage dependencies for a reproducible development environment.
|
|
130
|
+
The top-level `pyproject.toml` is the source of truth for our direct dependencies, and `requirements-dev.txt` is the "lock file" that guarantees identical setups for everyone.
|
|
131
|
+
|
|
132
|
+
**A) For a new setup (e.g. after a `git pull`):**
|
|
133
|
+
|
|
134
|
+
Install the locked dependencies from `requirements-dev.txt`:
|
|
135
|
+
```bash
|
|
136
|
+
pip install -r requirements-dev.txt
|
|
137
|
+
```
|
|
138
|
+
This synchronises the local virtual environment to match the exact versions in the lock file.
|
|
139
|
+
|
|
140
|
+
Once this is complete you are set up to begin programming in the sdk source code in: `./python/src/mesh`.
|
|
141
|
+
|
|
142
|
+
Next to make the SDK discoverable locally for tests do:
|
|
143
|
+
```
|
|
144
|
+
pip install -e .
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
**B) After a manual change to `pyproject.toml` (e.g. to install a new workspace level dependency or bump its version):**
|
|
148
|
+
|
|
149
|
+
If changes are made in the pyproject.toml then the lockfile must be regenerated:
|
|
150
|
+
```
|
|
151
|
+
# Step 1: Re-compile the dependencies to update the lock file
|
|
152
|
+
pip-compile --extra=dev --output-file=requirements-dev.txt pyproject.toml
|
|
153
|
+
|
|
154
|
+
# Step 2: Synchronise the local virtual environment again with the newly updated lock file
|
|
155
|
+
pip install -r requirements-dev.txt
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
### 4. Run Common Development Tasks
|
|
159
|
+
Tox is used as the as the main command runner for all common tasks like linting, testing, and building.
|
|
160
|
+
|
|
161
|
+
Tasks can be run from the command line (within the active virtual environment) as follows:
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
- The linter:
|
|
165
|
+
```
|
|
166
|
+
tox -e lint
|
|
167
|
+
```
|
|
168
|
+
- The unit tests:
|
|
169
|
+
```
|
|
170
|
+
tox -e unit-tests
|
|
171
|
+
```
|
|
172
|
+
- The integration tests:
|
|
173
|
+
```
|
|
174
|
+
MESH_API_KEY="your-secret-api-key" tox -e integration-tests
|
|
175
|
+
```
|
|
176
|
+
- All checks (linting and unit tests):
|
|
177
|
+
```
|
|
178
|
+
tox
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
### 5. Building and Publishing Packages
|
|
182
|
+
- *Build all packages:* The build task in tox will create the distributable wheel (.whl) and sdist (.tar.gz) files for all packages and place them in their respective dist/ folders.
|
|
183
|
+
```
|
|
184
|
+
tox -e build
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
- *Publish to PyPi:* The `twine` tool is used to securely upload the built packages to PyPI. This is done as part of the official release process.
|
|
188
|
+
```
|
|
189
|
+
twine upload lib/*/v*/dist/*
|
|
190
|
+
```
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
README.md
|
|
3
|
+
pyproject.toml
|
|
4
|
+
src/meshtrade/__init__.py
|
|
5
|
+
src/meshtrade.egg-info/PKG-INFO
|
|
6
|
+
src/meshtrade.egg-info/SOURCES.txt
|
|
7
|
+
src/meshtrade.egg-info/dependency_links.txt
|
|
8
|
+
src/meshtrade.egg-info/requires.txt
|
|
9
|
+
src/meshtrade.egg-info/top_level.txt
|
|
10
|
+
src/meshtrade/account/v1/__init__.py
|
|
11
|
+
src/meshtrade/account/v1/account_pb2.py
|
|
12
|
+
src/meshtrade/account/v1/account_pb2.pyi
|
|
13
|
+
src/meshtrade/account/v1/service_pb2.py
|
|
14
|
+
src/meshtrade/account/v1/service_pb2.pyi
|
|
15
|
+
src/meshtrade/iam/v1/__init__.py
|
|
16
|
+
src/meshtrade/iam/v1/permission_pb2.py
|
|
17
|
+
src/meshtrade/iam/v1/permission_pb2.pyi
|
|
18
|
+
src/meshtrade/iam/v1/role_pb2.py
|
|
19
|
+
src/meshtrade/iam/v1/role_pb2.pyi
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
meshtrade
|