loqedAPI 2.1.11__tar.gz → 2.1.14__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.
- loqedapi-2.1.14/.github/workflows/ci.yml +28 -0
- loqedapi-2.1.14/.github/workflows/release.yml +64 -0
- loqedapi-2.1.14/.gitignore +47 -0
- loqedapi-2.1.14/.vscode/launch.json +29 -0
- loqedapi-2.1.14/.vscode/settings.json +2 -0
- loqedapi-2.1.14/PKG-INFO +172 -0
- loqedapi-2.1.11/src/loqedAPI.egg-info/PKG-INFO → loqedapi-2.1.14/README.md +49 -37
- loqedapi-2.1.14/docs/Makefile +20 -0
- loqedapi-2.1.14/docs/conf.py +165 -0
- loqedapi-2.1.14/docs/index.rst +23 -0
- loqedapi-2.1.14/docs/mpi4py_module.rst +5 -0
- loqedapi-2.1.14/docs/readme.rst +1 -0
- loqedapi-2.1.14/pyproject.toml +47 -0
- loqedapi-2.1.14/pytest.ini +2 -0
- loqedapi-2.1.14/setup.cfg +4 -0
- loqedapi-2.1.14/src/.DS_Store +0 -0
- loqedapi-2.1.14/src/loqedAPI.egg-info/PKG-INFO +172 -0
- {loqedapi-2.1.11 → loqedapi-2.1.14}/src/loqedAPI.egg-info/SOURCES.txt +17 -2
- {loqedapi-2.1.11 → loqedapi-2.1.14}/src/loqedAPI.egg-info/requires.txt +1 -1
- loqedapi-2.1.14/src/loqedAPI.egg-info/scm_file_list.json +33 -0
- loqedapi-2.1.14/src/loqedAPI.egg-info/scm_version.json +8 -0
- loqedapi-2.1.14/tests/__init__.py +8 -0
- loqedapi-2.1.14/tests/temp.py +46 -0
- loqedapi-2.1.14/uv.lock +1752 -0
- loqedapi-2.1.11/PKG-INFO +0 -110
- loqedapi-2.1.11/README.md +0 -77
- loqedapi-2.1.11/pyproject.toml +0 -6
- loqedapi-2.1.11/setup.cfg +0 -29
- loqedapi-2.1.11/setup.py +0 -30
- {loqedapi-2.1.11 → loqedapi-2.1.14}/LICENSE +0 -0
- {loqedapi-2.1.11 → loqedapi-2.1.14}/src/loqedAPI/__init__.py +0 -0
- {loqedapi-2.1.11 → loqedapi-2.1.14}/src/loqedAPI/apiclient.py +0 -0
- {loqedapi-2.1.11 → loqedapi-2.1.14}/src/loqedAPI/cloud_loqed.py +0 -0
- {loqedapi-2.1.11 → loqedapi-2.1.14}/src/loqedAPI/exceptions.py +0 -0
- {loqedapi-2.1.11 → loqedapi-2.1.14}/src/loqedAPI/local_loqed.py +0 -0
- {loqedapi-2.1.11 → loqedapi-2.1.14}/src/loqedAPI/loqed.py +0 -0
- {loqedapi-2.1.11 → loqedapi-2.1.14}/src/loqedAPI/urls.py +0 -0
- {loqedapi-2.1.11 → loqedapi-2.1.14}/src/loqedAPI.egg-info/dependency_links.txt +0 -0
- {loqedapi-2.1.11 → loqedapi-2.1.14}/src/loqedAPI.egg-info/top_level.txt +0 -0
- {loqedapi-2.1.11 → loqedapi-2.1.14}/tests/test.py +0 -0
- {loqedapi-2.1.11 → loqedapi-2.1.14}/tests/test_cloud_loqed.py +0 -0
- {loqedapi-2.1.11 → loqedapi-2.1.14}/tests/test_local_loqed.py +0 -0
- {loqedapi-2.1.11 → loqedapi-2.1.14}/tests/test_loqed.py +0 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [master]
|
|
6
|
+
pull_request:
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
test:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
strategy:
|
|
15
|
+
matrix:
|
|
16
|
+
python-version: ["3.10", "3.11", "3.12"]
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@v4
|
|
19
|
+
|
|
20
|
+
- uses: actions/setup-python@v5
|
|
21
|
+
with:
|
|
22
|
+
python-version: ${{ matrix.python-version }}
|
|
23
|
+
|
|
24
|
+
- name: Install dependencies
|
|
25
|
+
run: python -m pip install --upgrade pip && pip install -e .[dev]
|
|
26
|
+
|
|
27
|
+
- name: Run tests
|
|
28
|
+
run: pytest --cov=src/loqedAPI --cov-report=term-missing
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
|
|
7
|
+
permissions:
|
|
8
|
+
contents: read
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
test:
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
steps:
|
|
14
|
+
- uses: actions/checkout@v4
|
|
15
|
+
with:
|
|
16
|
+
fetch-depth: 0
|
|
17
|
+
|
|
18
|
+
- uses: actions/setup-python@v5
|
|
19
|
+
with:
|
|
20
|
+
python-version: "3.12"
|
|
21
|
+
|
|
22
|
+
- name: Install dependencies
|
|
23
|
+
run: python -m pip install --upgrade pip && pip install -e .[dev]
|
|
24
|
+
|
|
25
|
+
- name: Run tests
|
|
26
|
+
run: pytest
|
|
27
|
+
|
|
28
|
+
build:
|
|
29
|
+
needs: test
|
|
30
|
+
runs-on: ubuntu-latest
|
|
31
|
+
steps:
|
|
32
|
+
- uses: actions/checkout@v4
|
|
33
|
+
with:
|
|
34
|
+
fetch-depth: 0
|
|
35
|
+
|
|
36
|
+
- uses: actions/setup-python@v5
|
|
37
|
+
with:
|
|
38
|
+
python-version: "3.12"
|
|
39
|
+
|
|
40
|
+
- name: Install build tooling
|
|
41
|
+
run: python -m pip install --upgrade pip build
|
|
42
|
+
|
|
43
|
+
- name: Build sdist and wheel
|
|
44
|
+
run: python -m build
|
|
45
|
+
|
|
46
|
+
- uses: actions/upload-artifact@v4
|
|
47
|
+
with:
|
|
48
|
+
name: dist
|
|
49
|
+
path: dist/
|
|
50
|
+
|
|
51
|
+
publish:
|
|
52
|
+
needs: build
|
|
53
|
+
runs-on: ubuntu-latest
|
|
54
|
+
environment: pypi
|
|
55
|
+
permissions:
|
|
56
|
+
id-token: write # required for PyPI trusted publishing
|
|
57
|
+
steps:
|
|
58
|
+
- uses: actions/download-artifact@v4
|
|
59
|
+
with:
|
|
60
|
+
name: dist
|
|
61
|
+
path: dist/
|
|
62
|
+
|
|
63
|
+
- name: Publish to PyPI
|
|
64
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Ignore Python cache and build artifacts
|
|
2
|
+
/.eggs/
|
|
3
|
+
__pycache__/
|
|
4
|
+
*.pyc
|
|
5
|
+
*.pyo
|
|
6
|
+
*.pyd
|
|
7
|
+
*.egg-info/
|
|
8
|
+
dist/
|
|
9
|
+
build/
|
|
10
|
+
*.egg
|
|
11
|
+
*.log
|
|
12
|
+
*.sqlite3
|
|
13
|
+
*.db
|
|
14
|
+
|
|
15
|
+
# Ignore virtual environments
|
|
16
|
+
.venv/
|
|
17
|
+
venv/
|
|
18
|
+
ENV/
|
|
19
|
+
|
|
20
|
+
# Ignore test and coverage outputs
|
|
21
|
+
.coverage
|
|
22
|
+
htmlcov/
|
|
23
|
+
.cache/
|
|
24
|
+
.pytest_cache/
|
|
25
|
+
|
|
26
|
+
# Ignore documentation build
|
|
27
|
+
/docs/_build/
|
|
28
|
+
|
|
29
|
+
# Ignore IDE/editor files
|
|
30
|
+
.vscode/
|
|
31
|
+
.idea/
|
|
32
|
+
*.swp
|
|
33
|
+
*.swo
|
|
34
|
+
|
|
35
|
+
# Ignore OS files
|
|
36
|
+
.DS_Store
|
|
37
|
+
Thumbs.db
|
|
38
|
+
|
|
39
|
+
# Ignore all files except source
|
|
40
|
+
!/src/
|
|
41
|
+
!/tests/
|
|
42
|
+
!/docs/
|
|
43
|
+
!/.github/
|
|
44
|
+
!/pyproject.toml
|
|
45
|
+
!/LICENSE
|
|
46
|
+
!/README.md
|
|
47
|
+
!/pytest.ini
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
// Use IntelliSense to learn about possible attributes.
|
|
3
|
+
// Hover to view descriptions of existing attributes.
|
|
4
|
+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
|
5
|
+
"version": "0.2.0",
|
|
6
|
+
"configurations": [
|
|
7
|
+
{
|
|
8
|
+
"name": "Python: Current File",
|
|
9
|
+
"type": "python",
|
|
10
|
+
"request": "launch",
|
|
11
|
+
"program": "${file}",
|
|
12
|
+
"console": "integratedTerminal",
|
|
13
|
+
"env": { "PYTHONPATH": "./src"},
|
|
14
|
+
"justMyCode": true
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"name": "Python: Module",
|
|
18
|
+
"type": "python",
|
|
19
|
+
"request": "launch",
|
|
20
|
+
"module": "tests.",
|
|
21
|
+
"cwd": "${workspaceRoot}",
|
|
22
|
+
"env": {
|
|
23
|
+
"PYTHONPATH": "${workspaceFolder}/src/"
|
|
24
|
+
},
|
|
25
|
+
"envFile": "${workspaceRoot}/.venv",
|
|
26
|
+
"justMyCode": true
|
|
27
|
+
}
|
|
28
|
+
]
|
|
29
|
+
}
|
loqedapi-2.1.14/PKG-INFO
ADDED
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: loqedAPI
|
|
3
|
+
Version: 2.1.14
|
|
4
|
+
Summary: Python package to use the Loqed Smart Door Lock APIs in a local network. To be used by Home Assistant.
|
|
5
|
+
Author-email: Casper Polhout <cpolhout@gmail.com>, Mike Woudenberg <mwoudenberg@xebia.com>
|
|
6
|
+
License: BSD 2-Clause License
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2017, pyexample
|
|
9
|
+
All rights reserved.
|
|
10
|
+
|
|
11
|
+
Redistribution and use in source and binary forms, with or without
|
|
12
|
+
modification, are permitted provided that the following conditions are met:
|
|
13
|
+
|
|
14
|
+
* Redistributions of source code must retain the above copyright notice, this
|
|
15
|
+
list of conditions and the following disclaimer.
|
|
16
|
+
|
|
17
|
+
* Redistributions in binary form must reproduce the above copyright notice,
|
|
18
|
+
this list of conditions and the following disclaimer in the documentation
|
|
19
|
+
and/or other materials provided with the distribution.
|
|
20
|
+
|
|
21
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
22
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
23
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
24
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
25
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
26
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
27
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
28
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
29
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
30
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
31
|
+
|
|
32
|
+
Project-URL: Homepage, https://github.com/cpolhout/loqedAPI
|
|
33
|
+
Project-URL: Bug Tracker, https://github.com/cpolhout/loqedAPI/issues
|
|
34
|
+
Classifier: Development Status :: 4 - Beta
|
|
35
|
+
Classifier: Intended Audience :: Developers
|
|
36
|
+
Classifier: License :: OSI Approved :: BSD License
|
|
37
|
+
Classifier: Programming Language :: Python :: 3
|
|
38
|
+
Classifier: Operating System :: OS Independent
|
|
39
|
+
Requires-Python: >=3.9
|
|
40
|
+
Description-Content-Type: text/markdown
|
|
41
|
+
License-File: LICENSE
|
|
42
|
+
Requires-Dist: aiohttp<3.14,>=3.8
|
|
43
|
+
Requires-Dist: async-timeout
|
|
44
|
+
Provides-Extra: dev
|
|
45
|
+
Requires-Dist: pytest; extra == "dev"
|
|
46
|
+
Requires-Dist: pytest-asyncio; extra == "dev"
|
|
47
|
+
Requires-Dist: pytest-cov; extra == "dev"
|
|
48
|
+
Requires-Dist: aioresponses; extra == "dev"
|
|
49
|
+
Dynamic: license-file
|
|
50
|
+
|
|
51
|
+
# Loqed Touch Smart Lock — Python client
|
|
52
|
+
|
|
53
|
+
This repository provides a small async-first Python client for the Loqed Touch smart lock. It wraps [the HTTP API used by Loqed devices](https://support.loqed.com/en/articles/6127856-loqed-local-bridge-api-integration) and exposes convenient helpers to read lock state, send lock/unlock commands, and manage webhooks.
|
|
54
|
+
|
|
55
|
+
## Quick start
|
|
56
|
+
|
|
57
|
+
1. Install the package (recommended: in a virtualenv):
|
|
58
|
+
|
|
59
|
+
Using [`uv`](https://docs.astral.sh/uv/) (recommended):
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
uv venv
|
|
63
|
+
uv pip install -e .
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Using `pip`:
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
python -m venv .venv
|
|
70
|
+
source .venv/bin/activate
|
|
71
|
+
pip install -e .
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
2. Install dev/test dependencies (optional):
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
uv pip install -e ".[dev]"
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
or with `pip`:
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
pip install -e ".[dev]"
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
> Note: quote `.[dev]` (as above) — in zsh, an unquoted `.[dev]` is interpreted as a
|
|
87
|
+
> glob pattern and fails with `no matches found: .[dev]`.
|
|
88
|
+
|
|
89
|
+
3. Use the client (async):
|
|
90
|
+
|
|
91
|
+
```python
|
|
92
|
+
import asyncio
|
|
93
|
+
from loqedAPI.loqed import APIClient, LoqedAPI
|
|
94
|
+
|
|
95
|
+
async def main():
|
|
96
|
+
client = APIClient(base_url="https://api.loqed.com", token="your-api-token")
|
|
97
|
+
api = LoqedAPI(client)
|
|
98
|
+
|
|
99
|
+
# fetch a lock by id
|
|
100
|
+
lock = await api.async_get_lock("lock-id")
|
|
101
|
+
print("state:", lock.bolt_state)
|
|
102
|
+
|
|
103
|
+
# send an unlock command
|
|
104
|
+
await lock.unlock()
|
|
105
|
+
|
|
106
|
+
asyncio.run(main())
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
Notes:
|
|
110
|
+
|
|
111
|
+
- The library is async-first and uses `aiohttp` for HTTP calls.
|
|
112
|
+
- `APIClient` accepts `base_url` and an optional `token` (for authorization) or you can provide your own `aiohttp.ClientSession`.
|
|
113
|
+
|
|
114
|
+
## Testing
|
|
115
|
+
|
|
116
|
+
Run the test suite with pytest (the project uses `pytest-asyncio` and `aioresponses`).
|
|
117
|
+
|
|
118
|
+
With `uv` (no need to activate the venv or pre-install anything — `uv run` syncs the
|
|
119
|
+
`dev` extra into an ephemeral environment automatically):
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
uv run --extra dev pytest --cov=src/loqedAPI --cov-report=term-missing
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
With `pip`/a manually activated venv:
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
source .venv/bin/activate
|
|
129
|
+
pytest --cov=src/loqedAPI --cov-report=term-missing
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
## Development
|
|
133
|
+
|
|
134
|
+
- The package follows standard Python packaging with `pyproject.toml` (version is
|
|
135
|
+
derived from git tags via `setuptools-scm`).
|
|
136
|
+
- Dev/test dependencies are available under the `dev` extra: `uv pip install -e ".[dev]"`
|
|
137
|
+
or `pip install -e ".[dev]"`.
|
|
138
|
+
- When editing code, run the tests frequently. The tests are fast and designed to mock network calls.
|
|
139
|
+
|
|
140
|
+
## Contributing
|
|
141
|
+
|
|
142
|
+
If you want to contribute:
|
|
143
|
+
|
|
144
|
+
1. Fork the repo, create a branch, and make your changes.
|
|
145
|
+
2. Add or update tests for new behavior.
|
|
146
|
+
3. Run the test suite and ensure all tests pass.
|
|
147
|
+
4. Open a pull request with a short description of the change.
|
|
148
|
+
|
|
149
|
+
## Releasing
|
|
150
|
+
|
|
151
|
+
Releases are built and published to PyPI automatically by a public GitHub Actions
|
|
152
|
+
workflow (`.github/workflows/release.yml`) — there is no manual/local publish step.
|
|
153
|
+
|
|
154
|
+
To cut a release:
|
|
155
|
+
|
|
156
|
+
1. Draft a [GitHub Release](https://github.com/cpolhout/loqedAPI/releases) with a
|
|
157
|
+
tag in the form `vX.Y.Z` (e.g. `v2.1.12`).
|
|
158
|
+
2. Publish the release. The package version is derived from the tag via
|
|
159
|
+
`setuptools-scm`, so the version on PyPI always matches a tagged commit in
|
|
160
|
+
this repository.
|
|
161
|
+
3. CI runs the test suite, builds the sdist/wheel, and publishes to PyPI using
|
|
162
|
+
[PyPI Trusted Publishing](https://docs.pypi.org/trusted-publishers/) (no
|
|
163
|
+
stored API tokens).
|
|
164
|
+
|
|
165
|
+
## Where to find docs
|
|
166
|
+
|
|
167
|
+
- Source code is under `src/loqedAPI`.
|
|
168
|
+
- Sphinx documentation lives in `docs/`.
|
|
169
|
+
|
|
170
|
+
## License
|
|
171
|
+
|
|
172
|
+
See the `LICENSE` file in the project root.
|
|
@@ -1,36 +1,3 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: loqedAPI
|
|
3
|
-
Version: 2.1.11
|
|
4
|
-
Summary: Python package to use the Loqed Smart Door Lock APIs in a local network. To be used by Home Assistant.
|
|
5
|
-
Home-page: https://github.com/cpolhout/loqedAPI
|
|
6
|
-
Author: Casper Polhout
|
|
7
|
-
Author-email: cpolhout@gmail.com
|
|
8
|
-
License: BSD 2-clause
|
|
9
|
-
Project-URL: Bug Tracker, https://github.com/cpolhout/loqedAPI/issues
|
|
10
|
-
Classifier: Development Status :: 4 - Beta
|
|
11
|
-
Classifier: Intended Audience :: Developers
|
|
12
|
-
Classifier: License :: OSI Approved :: BSD License
|
|
13
|
-
Classifier: Programming Language :: Python :: 3
|
|
14
|
-
Requires-Python: >=3.6
|
|
15
|
-
Description-Content-Type: text/markdown
|
|
16
|
-
License-File: LICENSE
|
|
17
|
-
Requires-Dist: aiohttp
|
|
18
|
-
Requires-Dist: async-timeout
|
|
19
|
-
Provides-Extra: dev
|
|
20
|
-
Requires-Dist: pytest; extra == "dev"
|
|
21
|
-
Requires-Dist: pytest-asyncio; extra == "dev"
|
|
22
|
-
Requires-Dist: pytest-cov; extra == "dev"
|
|
23
|
-
Requires-Dist: aioresponses; extra == "dev"
|
|
24
|
-
Dynamic: author
|
|
25
|
-
Dynamic: author-email
|
|
26
|
-
Dynamic: classifier
|
|
27
|
-
Dynamic: home-page
|
|
28
|
-
Dynamic: license
|
|
29
|
-
Dynamic: license-file
|
|
30
|
-
Dynamic: provides-extra
|
|
31
|
-
Dynamic: requires-dist
|
|
32
|
-
Dynamic: summary
|
|
33
|
-
|
|
34
1
|
# Loqed Touch Smart Lock — Python client
|
|
35
2
|
|
|
36
3
|
This repository provides a small async-first Python client for the Loqed Touch smart lock. It wraps [the HTTP API used by Loqed devices](https://support.loqed.com/en/articles/6127856-loqed-local-bridge-api-integration) and exposes convenient helpers to read lock state, send lock/unlock commands, and manage webhooks.
|
|
@@ -39,6 +6,15 @@ This repository provides a small async-first Python client for the Loqed Touch s
|
|
|
39
6
|
|
|
40
7
|
1. Install the package (recommended: in a virtualenv):
|
|
41
8
|
|
|
9
|
+
Using [`uv`](https://docs.astral.sh/uv/) (recommended):
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
uv venv
|
|
13
|
+
uv pip install -e .
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Using `pip`:
|
|
17
|
+
|
|
42
18
|
```bash
|
|
43
19
|
python -m venv .venv
|
|
44
20
|
source .venv/bin/activate
|
|
@@ -48,9 +24,18 @@ pip install -e .
|
|
|
48
24
|
2. Install dev/test dependencies (optional):
|
|
49
25
|
|
|
50
26
|
```bash
|
|
51
|
-
pip install -e .[dev]
|
|
27
|
+
uv pip install -e ".[dev]"
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
or with `pip`:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
pip install -e ".[dev]"
|
|
52
34
|
```
|
|
53
35
|
|
|
36
|
+
> Note: quote `.[dev]` (as above) — in zsh, an unquoted `.[dev]` is interpreted as a
|
|
37
|
+
> glob pattern and fails with `no matches found: .[dev]`.
|
|
38
|
+
|
|
54
39
|
3. Use the client (async):
|
|
55
40
|
|
|
56
41
|
```python
|
|
@@ -78,7 +63,16 @@ Notes:
|
|
|
78
63
|
|
|
79
64
|
## Testing
|
|
80
65
|
|
|
81
|
-
Run the test suite with pytest (the project uses `pytest-asyncio` and `aioresponses`)
|
|
66
|
+
Run the test suite with pytest (the project uses `pytest-asyncio` and `aioresponses`).
|
|
67
|
+
|
|
68
|
+
With `uv` (no need to activate the venv or pre-install anything — `uv run` syncs the
|
|
69
|
+
`dev` extra into an ephemeral environment automatically):
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
uv run --extra dev pytest --cov=src/loqedAPI --cov-report=term-missing
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
With `pip`/a manually activated venv:
|
|
82
76
|
|
|
83
77
|
```bash
|
|
84
78
|
source .venv/bin/activate
|
|
@@ -87,8 +81,10 @@ pytest --cov=src/loqedAPI --cov-report=term-missing
|
|
|
87
81
|
|
|
88
82
|
## Development
|
|
89
83
|
|
|
90
|
-
- The package follows standard Python packaging with `pyproject.toml
|
|
91
|
-
|
|
84
|
+
- The package follows standard Python packaging with `pyproject.toml` (version is
|
|
85
|
+
derived from git tags via `setuptools-scm`).
|
|
86
|
+
- Dev/test dependencies are available under the `dev` extra: `uv pip install -e ".[dev]"`
|
|
87
|
+
or `pip install -e ".[dev]"`.
|
|
92
88
|
- When editing code, run the tests frequently. The tests are fast and designed to mock network calls.
|
|
93
89
|
|
|
94
90
|
## Contributing
|
|
@@ -100,6 +96,22 @@ If you want to contribute:
|
|
|
100
96
|
3. Run the test suite and ensure all tests pass.
|
|
101
97
|
4. Open a pull request with a short description of the change.
|
|
102
98
|
|
|
99
|
+
## Releasing
|
|
100
|
+
|
|
101
|
+
Releases are built and published to PyPI automatically by a public GitHub Actions
|
|
102
|
+
workflow (`.github/workflows/release.yml`) — there is no manual/local publish step.
|
|
103
|
+
|
|
104
|
+
To cut a release:
|
|
105
|
+
|
|
106
|
+
1. Draft a [GitHub Release](https://github.com/cpolhout/loqedAPI/releases) with a
|
|
107
|
+
tag in the form `vX.Y.Z` (e.g. `v2.1.12`).
|
|
108
|
+
2. Publish the release. The package version is derived from the tag via
|
|
109
|
+
`setuptools-scm`, so the version on PyPI always matches a tagged commit in
|
|
110
|
+
this repository.
|
|
111
|
+
3. CI runs the test suite, builds the sdist/wheel, and publishes to PyPI using
|
|
112
|
+
[PyPI Trusted Publishing](https://docs.pypi.org/trusted-publishers/) (no
|
|
113
|
+
stored API tokens).
|
|
114
|
+
|
|
103
115
|
## Where to find docs
|
|
104
116
|
|
|
105
117
|
- Source code is under `src/loqedAPI`.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Minimal makefile for Sphinx documentation
|
|
2
|
+
#
|
|
3
|
+
|
|
4
|
+
# You can set these variables from the command line.
|
|
5
|
+
SPHINXOPTS =
|
|
6
|
+
SPHINXBUILD = sphinx-build
|
|
7
|
+
SPHINXPROJ = pyexample
|
|
8
|
+
SOURCEDIR = .
|
|
9
|
+
BUILDDIR = _build
|
|
10
|
+
|
|
11
|
+
# Put it first so that "make" without argument is like "make help".
|
|
12
|
+
help:
|
|
13
|
+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
|
14
|
+
|
|
15
|
+
.PHONY: help Makefile
|
|
16
|
+
|
|
17
|
+
# Catch-all target: route all unknown targets to Sphinx using the new
|
|
18
|
+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
|
|
19
|
+
%: Makefile
|
|
20
|
+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
#
|
|
3
|
+
# pyexample documentation build configuration file, created by
|
|
4
|
+
# sphinx-quickstart on Fri Feb 23 23:07:43 2018.
|
|
5
|
+
#
|
|
6
|
+
# This file is execfile()d with the current directory set to its
|
|
7
|
+
# containing dir.
|
|
8
|
+
#
|
|
9
|
+
# Note that not all possible configuration values are present in this
|
|
10
|
+
# autogenerated file.
|
|
11
|
+
#
|
|
12
|
+
# All configuration values have a default; values that are commented out
|
|
13
|
+
# serve to show the default.
|
|
14
|
+
|
|
15
|
+
# If extensions (or modules to document with autodoc) are in another directory,
|
|
16
|
+
# add these directories to sys.path here. If the directory is relative to the
|
|
17
|
+
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
|
18
|
+
#
|
|
19
|
+
import os
|
|
20
|
+
import sys
|
|
21
|
+
sys.path.insert(0, os.path.abspath('.'))
|
|
22
|
+
sys.path.append('../pyexample')
|
|
23
|
+
|
|
24
|
+
class Mock(MagicMock):
|
|
25
|
+
@classmethod
|
|
26
|
+
def __getattr__(cls, name):
|
|
27
|
+
return MagicMock()
|
|
28
|
+
|
|
29
|
+
MOCK_MODULES = ['numpy', 'mpi4py']
|
|
30
|
+
sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
# -- General configuration ------------------------------------------------
|
|
34
|
+
|
|
35
|
+
# If your documentation needs a minimal Sphinx version, state it here.
|
|
36
|
+
#
|
|
37
|
+
# needs_sphinx = '1.0'
|
|
38
|
+
|
|
39
|
+
# Add any Sphinx extension module names here, as strings. They can be
|
|
40
|
+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
|
|
41
|
+
# ones.
|
|
42
|
+
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.napoleon']
|
|
43
|
+
|
|
44
|
+
# Add any paths that contain templates here, relative to this directory.
|
|
45
|
+
templates_path = ['_templates']
|
|
46
|
+
|
|
47
|
+
# The suffix(es) of source filenames.
|
|
48
|
+
# You can specify multiple suffix as a list of string:
|
|
49
|
+
#
|
|
50
|
+
# source_suffix = ['.rst', '.md']
|
|
51
|
+
source_suffix = '.rst'
|
|
52
|
+
|
|
53
|
+
# The master toctree document.
|
|
54
|
+
master_doc = 'index'
|
|
55
|
+
|
|
56
|
+
# General information about the project.
|
|
57
|
+
project = u'pyexample'
|
|
58
|
+
copyright = u'2018, Stephen Hudson'
|
|
59
|
+
author = u'Stephen Hudson'
|
|
60
|
+
|
|
61
|
+
# The version info for the project you're documenting, acts as replacement for
|
|
62
|
+
# |version| and |release|, also used in various other places throughout the
|
|
63
|
+
# built documents.
|
|
64
|
+
#
|
|
65
|
+
# The short X.Y version.
|
|
66
|
+
version = u'0.1.0'
|
|
67
|
+
# The full version, including alpha/beta/rc tags.
|
|
68
|
+
release = u'0.1.0'
|
|
69
|
+
|
|
70
|
+
# The language for content autogenerated by Sphinx. Refer to documentation
|
|
71
|
+
# for a list of supported languages.
|
|
72
|
+
#
|
|
73
|
+
# This is also used if you do content translation via gettext catalogs.
|
|
74
|
+
# Usually you set "language" from the command line for these cases.
|
|
75
|
+
language = None
|
|
76
|
+
|
|
77
|
+
# List of patterns, relative to source directory, that match files and
|
|
78
|
+
# directories to ignore when looking for source files.
|
|
79
|
+
# This patterns also effect to html_static_path and html_extra_path
|
|
80
|
+
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
|
|
81
|
+
|
|
82
|
+
# The name of the Pygments (syntax highlighting) style to use.
|
|
83
|
+
pygments_style = 'sphinx'
|
|
84
|
+
|
|
85
|
+
# If true, `todo` and `todoList` produce output, else they produce nothing.
|
|
86
|
+
todo_include_todos = False
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
# -- Options for HTML output ----------------------------------------------
|
|
90
|
+
|
|
91
|
+
# The theme to use for HTML and HTML Help pages. See the documentation for
|
|
92
|
+
# a list of builtin themes.
|
|
93
|
+
#
|
|
94
|
+
html_theme = 'sphinx_rtd_theme'
|
|
95
|
+
|
|
96
|
+
# Theme options are theme-specific and customize the look and feel of a theme
|
|
97
|
+
# further. For a list of options available for each theme, see the
|
|
98
|
+
# documentation.
|
|
99
|
+
#
|
|
100
|
+
# html_theme_options = {}
|
|
101
|
+
|
|
102
|
+
# Add any paths that contain custom static files (such as style sheets) here,
|
|
103
|
+
# relative to this directory. They are copied after the builtin static files,
|
|
104
|
+
# so a file named "default.css" will overwrite the builtin "default.css".
|
|
105
|
+
html_static_path = ['_static']
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
# -- Options for HTMLHelp output ------------------------------------------
|
|
109
|
+
|
|
110
|
+
# Output file base name for HTML help builder.
|
|
111
|
+
htmlhelp_basename = 'pyexampledoc'
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
# -- Options for LaTeX output ---------------------------------------------
|
|
115
|
+
|
|
116
|
+
latex_elements = {
|
|
117
|
+
# The paper size ('letterpaper' or 'a4paper').
|
|
118
|
+
#
|
|
119
|
+
# 'papersize': 'letterpaper',
|
|
120
|
+
|
|
121
|
+
# The font size ('10pt', '11pt' or '12pt').
|
|
122
|
+
#
|
|
123
|
+
# 'pointsize': '10pt',
|
|
124
|
+
|
|
125
|
+
# Additional stuff for the LaTeX preamble.
|
|
126
|
+
#
|
|
127
|
+
# 'preamble': '',
|
|
128
|
+
|
|
129
|
+
# Latex figure (float) alignment
|
|
130
|
+
#
|
|
131
|
+
# 'figure_align': 'htbp',
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
# Grouping the document tree into LaTeX files. List of tuples
|
|
135
|
+
# (source start file, target name, title,
|
|
136
|
+
# author, documentclass [howto, manual, or own class]).
|
|
137
|
+
latex_documents = [
|
|
138
|
+
(master_doc, 'pyexample.tex', u'pyexample Documentation',
|
|
139
|
+
u'Stephen Hudson', 'manual'),
|
|
140
|
+
]
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
# -- Options for manual page output ---------------------------------------
|
|
144
|
+
|
|
145
|
+
# One entry per manual page. List of tuples
|
|
146
|
+
# (source start file, name, description, authors, manual section).
|
|
147
|
+
man_pages = [
|
|
148
|
+
(master_doc, 'pyexample', u'pyexample Documentation',
|
|
149
|
+
[author], 1)
|
|
150
|
+
]
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
# -- Options for Texinfo output -------------------------------------------
|
|
154
|
+
|
|
155
|
+
# Grouping the document tree into Texinfo files. List of tuples
|
|
156
|
+
# (source start file, target name, title, author,
|
|
157
|
+
# dir menu entry, description, category)
|
|
158
|
+
texinfo_documents = [
|
|
159
|
+
(master_doc, 'pyexample', u'pyexample Documentation',
|
|
160
|
+
author, 'pyexample', 'One line description of project.',
|
|
161
|
+
'Miscellaneous'),
|
|
162
|
+
]
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
.. pyexample documentation master file, created by
|
|
2
|
+
sphinx-quickstart on Fri Feb 23 23:07:43 2018.
|
|
3
|
+
You can adapt this file completely to your liking, but it should at least
|
|
4
|
+
contain the root `toctree` directive.
|
|
5
|
+
|
|
6
|
+
Welcome to pyexample's documentation!
|
|
7
|
+
=====================================
|
|
8
|
+
|
|
9
|
+
.. toctree::
|
|
10
|
+
:maxdepth: 2
|
|
11
|
+
:caption: Contents:
|
|
12
|
+
|
|
13
|
+
readme
|
|
14
|
+
mpi4py_module
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
Indices and tables
|
|
19
|
+
==================
|
|
20
|
+
|
|
21
|
+
* :ref:`genindex`
|
|
22
|
+
* :ref:`modindex`
|
|
23
|
+
* :ref:`search`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.. include:: ../README.rst
|