http-dynamix 1.0.0__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.
- http_dynamix-1.0.0/.gitignore +175 -0
- http_dynamix-1.0.0/LICENSE +21 -0
- http_dynamix-1.0.0/PKG-INFO +193 -0
- http_dynamix-1.0.0/README.md +154 -0
- http_dynamix-1.0.0/http_dynamix/__init__.py +38 -0
- http_dynamix-1.0.0/http_dynamix/_version.py +21 -0
- http_dynamix-1.0.0/http_dynamix/auth.py +194 -0
- http_dynamix-1.0.0/http_dynamix/clients/__init__.py +9 -0
- http_dynamix-1.0.0/http_dynamix/clients/async_client.py +313 -0
- http_dynamix-1.0.0/http_dynamix/clients/sync_client.py +312 -0
- http_dynamix-1.0.0/http_dynamix/core/__init__.py +7 -0
- http_dynamix-1.0.0/http_dynamix/core/segment_format.py +226 -0
- http_dynamix-1.0.0/http_dynamix/enums.py +39 -0
- http_dynamix-1.0.0/http_dynamix/factory.py +72 -0
- http_dynamix-1.0.0/http_dynamix/httpx_logger.py +598 -0
- http_dynamix-1.0.0/http_dynamix/log.py +448 -0
- http_dynamix-1.0.0/http_dynamix/protocols.py +126 -0
- http_dynamix-1.0.0/http_dynamix/py.typed +0 -0
- http_dynamix-1.0.0/http_dynamix/types.py +7 -0
- http_dynamix-1.0.0/pyproject.toml +276 -0
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
share/python-wheels/
|
|
24
|
+
*.egg-info/
|
|
25
|
+
.installed.cfg
|
|
26
|
+
*.egg
|
|
27
|
+
MANIFEST
|
|
28
|
+
_version.py
|
|
29
|
+
.DS_Store
|
|
30
|
+
|
|
31
|
+
# PyInstaller
|
|
32
|
+
# Usually these files are written by a python script from a template
|
|
33
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
34
|
+
*.manifest
|
|
35
|
+
*.spec
|
|
36
|
+
|
|
37
|
+
# Installer logs
|
|
38
|
+
pip-log.txt
|
|
39
|
+
pip-delete-this-directory.txt
|
|
40
|
+
|
|
41
|
+
# Unit test / coverage reports
|
|
42
|
+
htmlcov/
|
|
43
|
+
.tox/
|
|
44
|
+
.nox/
|
|
45
|
+
.coverage
|
|
46
|
+
.coverage.*
|
|
47
|
+
.cache
|
|
48
|
+
nosetests.xml
|
|
49
|
+
coverage.xml
|
|
50
|
+
*.cover
|
|
51
|
+
*.py,cover
|
|
52
|
+
.hypothesis/
|
|
53
|
+
.pytest_cache/
|
|
54
|
+
test-report/
|
|
55
|
+
cover/
|
|
56
|
+
.ruff_cache/
|
|
57
|
+
|
|
58
|
+
# Translations
|
|
59
|
+
*.mo
|
|
60
|
+
*.pot
|
|
61
|
+
|
|
62
|
+
# Django stuff:
|
|
63
|
+
*.log
|
|
64
|
+
local_settings.py
|
|
65
|
+
db.sqlite3
|
|
66
|
+
db.sqlite3-journal
|
|
67
|
+
|
|
68
|
+
# Flask stuff:
|
|
69
|
+
instance/
|
|
70
|
+
.webassets-cache
|
|
71
|
+
|
|
72
|
+
# Scrapy stuff:
|
|
73
|
+
.scrapy
|
|
74
|
+
|
|
75
|
+
# Sphinx documentation
|
|
76
|
+
docs/_build/
|
|
77
|
+
|
|
78
|
+
# PyBuilder
|
|
79
|
+
.pybuilder/
|
|
80
|
+
target/
|
|
81
|
+
|
|
82
|
+
# Jupyter Notebook
|
|
83
|
+
.ipynb_checkpoints
|
|
84
|
+
|
|
85
|
+
# IPython
|
|
86
|
+
profile_default/
|
|
87
|
+
ipython_config.py
|
|
88
|
+
|
|
89
|
+
# pyenv
|
|
90
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
91
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
92
|
+
# .python-version
|
|
93
|
+
|
|
94
|
+
# pipenv
|
|
95
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
96
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
97
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
98
|
+
# install all needed dependencies.
|
|
99
|
+
#Pipfile.lock
|
|
100
|
+
|
|
101
|
+
# UV
|
|
102
|
+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
|
|
103
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
104
|
+
# commonly ignored for libraries.
|
|
105
|
+
#uv.lock
|
|
106
|
+
|
|
107
|
+
# poetry
|
|
108
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
109
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
110
|
+
# commonly ignored for libraries.
|
|
111
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
112
|
+
#poetry.lock
|
|
113
|
+
|
|
114
|
+
# pdm
|
|
115
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
116
|
+
#pdm.lock
|
|
117
|
+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
|
|
118
|
+
# in version control.
|
|
119
|
+
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
|
|
120
|
+
.pdm.toml
|
|
121
|
+
.pdm-python
|
|
122
|
+
.pdm-build/
|
|
123
|
+
|
|
124
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
125
|
+
__pypackages__/
|
|
126
|
+
|
|
127
|
+
# Celery stuff
|
|
128
|
+
celerybeat-schedule
|
|
129
|
+
celerybeat.pid
|
|
130
|
+
|
|
131
|
+
# SageMath parsed files
|
|
132
|
+
*.sage.py
|
|
133
|
+
|
|
134
|
+
# Environments
|
|
135
|
+
.env
|
|
136
|
+
.venv
|
|
137
|
+
env/
|
|
138
|
+
venv/
|
|
139
|
+
ENV/
|
|
140
|
+
env.bak/
|
|
141
|
+
venv.bak/
|
|
142
|
+
|
|
143
|
+
# Spyder project settings
|
|
144
|
+
.spyderproject
|
|
145
|
+
.spyproject
|
|
146
|
+
|
|
147
|
+
# Rope project settings
|
|
148
|
+
.ropeproject
|
|
149
|
+
|
|
150
|
+
# mkdocs documentation
|
|
151
|
+
/site
|
|
152
|
+
|
|
153
|
+
# mypy
|
|
154
|
+
.mypy_cache/
|
|
155
|
+
.dmypy.json
|
|
156
|
+
dmypy.json
|
|
157
|
+
|
|
158
|
+
# Pyre type checker
|
|
159
|
+
.pyre/
|
|
160
|
+
|
|
161
|
+
# pytype static type analyzer
|
|
162
|
+
.pytype/
|
|
163
|
+
|
|
164
|
+
# Cython debug symbols
|
|
165
|
+
cython_debug/
|
|
166
|
+
|
|
167
|
+
# PyCharm
|
|
168
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
169
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
170
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
171
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
172
|
+
#.idea/
|
|
173
|
+
|
|
174
|
+
# PyPI configuration file
|
|
175
|
+
.pypirc
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Aydina
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: http-dynamix
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Dynamic HTTP client from httpx
|
|
5
|
+
Author-email: Aydin Abdi <ayd.abd@gmail.com>
|
|
6
|
+
Maintainer-email: Aydin Abdi <ayd.abd@gmail.com>
|
|
7
|
+
License-Expression: MIT
|
|
8
|
+
License-File: LICENSE
|
|
9
|
+
Keywords: api-client,async,automation,dynamic-client,http-client,httpx,library,pytest,python,quality-assurance,rest-api,sync,testing
|
|
10
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
11
|
+
Classifier: Framework :: AsyncIO
|
|
12
|
+
Classifier: Framework :: Hatch
|
|
13
|
+
Classifier: Framework :: Pytest
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Intended Audience :: Information Technology
|
|
16
|
+
Classifier: Intended Audience :: Other Audience
|
|
17
|
+
Classifier: Intended Audience :: Science/Research
|
|
18
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
19
|
+
Classifier: Operating System :: OS Independent
|
|
20
|
+
Classifier: Programming Language :: Python
|
|
21
|
+
Classifier: Programming Language :: Python :: 3
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
25
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
26
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
27
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
28
|
+
Classifier: Topic :: Software Development :: Testing
|
|
29
|
+
Classifier: Topic :: Utilities
|
|
30
|
+
Classifier: Typing :: Typed
|
|
31
|
+
Requires-Python: >=3.11
|
|
32
|
+
Requires-Dist: bs4
|
|
33
|
+
Requires-Dist: httpx[cli]
|
|
34
|
+
Requires-Dist: loguru
|
|
35
|
+
Requires-Dist: lxml
|
|
36
|
+
Requires-Dist: pyyaml
|
|
37
|
+
Requires-Dist: tenacity
|
|
38
|
+
Description-Content-Type: text/markdown
|
|
39
|
+
|
|
40
|
+
# Http Dynamix
|
|
41
|
+
|
|
42
|
+
[](https://docs.astral.sh/ruff/)
|
|
43
|
+
[](https://www.sphinx-doc.org)
|
|
44
|
+
[](https://hatch.pypa.io/latest/)
|
|
45
|
+
|
|
46
|
+
Library for creating dynamic HTTP requests in puthon
|
|
47
|
+
|
|
48
|
+
## Quick Start
|
|
49
|
+
|
|
50
|
+
This guide helps you get started with Http Dynamix.
|
|
51
|
+
|
|
52
|
+
## Prerequisites
|
|
53
|
+
|
|
54
|
+
- Docker installed and running
|
|
55
|
+
|
|
56
|
+
## Basic Setup with Docker Compose (Recommended)
|
|
57
|
+
|
|
58
|
+
1. Create test directory:
|
|
59
|
+
|
|
60
|
+
``` bash
|
|
61
|
+
mkdir -p test-api-service/tests && cd test-api-service
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
2. create pytest configuration file <span class="title-ref">pytest.ini</span> in the <span class="title-ref">tests</span> directory:
|
|
65
|
+
|
|
66
|
+
<div class="literalinclude" caption="pytest.ini" linenos="">
|
|
67
|
+
|
|
68
|
+
../examples/tests/pytest.ini
|
|
69
|
+
|
|
70
|
+
</div>
|
|
71
|
+
|
|
72
|
+
3. Create pytest test cases in \`tests/test_httpbin_org_service.py\`:
|
|
73
|
+
|
|
74
|
+
<div class="literalinclude" language="python" caption="test_httpbin_org_service.py" linenos="">
|
|
75
|
+
|
|
76
|
+
../examples/tests/test_httpbin_org_service.py
|
|
77
|
+
|
|
78
|
+
</div>
|
|
79
|
+
|
|
80
|
+
4. Create compose.yaml:
|
|
81
|
+
|
|
82
|
+
<div class="literalinclude" language="yaml" caption="compose.yaml" linenos="">
|
|
83
|
+
|
|
84
|
+
../examples/compose.yaml
|
|
85
|
+
|
|
86
|
+
</div>
|
|
87
|
+
|
|
88
|
+
5. Run all tests in parallel:
|
|
89
|
+
|
|
90
|
+
``` bash
|
|
91
|
+
docker compose up --build
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
6. To run only specified tests, override the command in compose.yaml:
|
|
95
|
+
|
|
96
|
+
``` yaml
|
|
97
|
+
command: ["pytest", "-n", "auto", "tests/test_httpbin_org_service.py"]
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
This uses pytest-xdist for parallel execution.
|
|
101
|
+
|
|
102
|
+
## Contributing
|
|
103
|
+
|
|
104
|
+
We welcome contributions to Http Dynamix!
|
|
105
|
+
There are many ways to contribute, from improving the documentation, submitting
|
|
106
|
+
bug reports and feature requests or writing code which can be incorporated into
|
|
107
|
+
the main project itself.
|
|
108
|
+
|
|
109
|
+
## Local Development Installation
|
|
110
|
+
|
|
111
|
+
For developers or contributors:
|
|
112
|
+
|
|
113
|
+
``` bash
|
|
114
|
+
# Install mamba-githook for creation of isolated virtual environment,
|
|
115
|
+
# Choose the correct installer for your platform
|
|
116
|
+
# Supported: linux-amd64, linux-arm64, windows-amd64, windows-arm64
|
|
117
|
+
curl -L https://github.com/aydabd/mamba-githook/releases/download/1.0.1/mamba-githook-installer-linux-arm64 \
|
|
118
|
+
-o mamba-githook-installer && \
|
|
119
|
+
chmod +x mamba-githook-installer && \
|
|
120
|
+
./mamba-githook-installer install
|
|
121
|
+
|
|
122
|
+
# Install micromamba via mamba-githook
|
|
123
|
+
mamnba-githook install-micromamba
|
|
124
|
+
# Activate permanent micromamba in your shell, Then you need to restart your shell
|
|
125
|
+
mamba-githook init-shell
|
|
126
|
+
|
|
127
|
+
# Create virtual environment via micromamba
|
|
128
|
+
micromamba create -n http-dynamix-env hatch pandoc
|
|
129
|
+
|
|
130
|
+
# Activate virtual environment
|
|
131
|
+
micromamba activate http-dynamix-env
|
|
132
|
+
|
|
133
|
+
# Clone repository
|
|
134
|
+
git clone ssh://git@github.com:aydabd/http-dynamix.git
|
|
135
|
+
cd http-dynamix
|
|
136
|
+
|
|
137
|
+
# Install development dependencies
|
|
138
|
+
# This will install all dependencies from pyproject.toml
|
|
139
|
+
hatch env create
|
|
140
|
+
|
|
141
|
+
# Run hatch for pre-release:all environment
|
|
142
|
+
hatch run pre-release:all
|
|
143
|
+
|
|
144
|
+
# Install the package in editable mode inside the micromamba environment
|
|
145
|
+
pip install -e .
|
|
146
|
+
|
|
147
|
+
# Build documentation in HTML format
|
|
148
|
+
hatch run pre-release:docs-html
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
## Docker/Compose Test Execution
|
|
152
|
+
|
|
153
|
+
You can run all tests in parallel using Docker Compose:
|
|
154
|
+
|
|
155
|
+
``` bash
|
|
156
|
+
docker compose up --build
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
To run only integration tests, override the command in compose.yaml:
|
|
160
|
+
|
|
161
|
+
``` yaml
|
|
162
|
+
command: ["pytest", "-n", "auto", "tests/test_clients_integration.py"]
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
This uses pytest-xdist for parallel execution. The Dockerfile and compose.yaml are set up for both CI and local testing.
|
|
166
|
+
|
|
167
|
+
## Publish Documentation To Confluence
|
|
168
|
+
|
|
169
|
+
To publish the documentation to Confluence, you need to virtualenv python and
|
|
170
|
+
installed hatch.
|
|
171
|
+
Then you need to set the following environment variables into <span class="title-ref">.env</span> file:
|
|
172
|
+
|
|
173
|
+
``` bash
|
|
174
|
+
CONFLUENCE_SERVER_USER=<your_confluence_user-at-server>
|
|
175
|
+
CONFLUENCE_API_TOKEN=<your-api-token-for-confluence>
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
After that, you can run the following command to publish the documentation to Confluence:
|
|
179
|
+
|
|
180
|
+
``` bash
|
|
181
|
+
# Publish the documentation to Confluence
|
|
182
|
+
hatch run release:all
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
> [!NOTE]
|
|
186
|
+
> Ensure your project is released with the version number before publishing the
|
|
187
|
+
> documentation to Confluence.
|
|
188
|
+
|
|
189
|
+
You can find the published documentation at the link provided in the output of
|
|
190
|
+
the command.
|
|
191
|
+
|
|
192
|
+
For more information about documentation publishing, check the
|
|
193
|
+
`pyproject.toml` file and `docs/conf.py` file.
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
# Http Dynamix
|
|
2
|
+
|
|
3
|
+
[](https://docs.astral.sh/ruff/)
|
|
4
|
+
[](https://www.sphinx-doc.org)
|
|
5
|
+
[](https://hatch.pypa.io/latest/)
|
|
6
|
+
|
|
7
|
+
Library for creating dynamic HTTP requests in puthon
|
|
8
|
+
|
|
9
|
+
## Quick Start
|
|
10
|
+
|
|
11
|
+
This guide helps you get started with Http Dynamix.
|
|
12
|
+
|
|
13
|
+
## Prerequisites
|
|
14
|
+
|
|
15
|
+
- Docker installed and running
|
|
16
|
+
|
|
17
|
+
## Basic Setup with Docker Compose (Recommended)
|
|
18
|
+
|
|
19
|
+
1. Create test directory:
|
|
20
|
+
|
|
21
|
+
``` bash
|
|
22
|
+
mkdir -p test-api-service/tests && cd test-api-service
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
2. create pytest configuration file <span class="title-ref">pytest.ini</span> in the <span class="title-ref">tests</span> directory:
|
|
26
|
+
|
|
27
|
+
<div class="literalinclude" caption="pytest.ini" linenos="">
|
|
28
|
+
|
|
29
|
+
../examples/tests/pytest.ini
|
|
30
|
+
|
|
31
|
+
</div>
|
|
32
|
+
|
|
33
|
+
3. Create pytest test cases in \`tests/test_httpbin_org_service.py\`:
|
|
34
|
+
|
|
35
|
+
<div class="literalinclude" language="python" caption="test_httpbin_org_service.py" linenos="">
|
|
36
|
+
|
|
37
|
+
../examples/tests/test_httpbin_org_service.py
|
|
38
|
+
|
|
39
|
+
</div>
|
|
40
|
+
|
|
41
|
+
4. Create compose.yaml:
|
|
42
|
+
|
|
43
|
+
<div class="literalinclude" language="yaml" caption="compose.yaml" linenos="">
|
|
44
|
+
|
|
45
|
+
../examples/compose.yaml
|
|
46
|
+
|
|
47
|
+
</div>
|
|
48
|
+
|
|
49
|
+
5. Run all tests in parallel:
|
|
50
|
+
|
|
51
|
+
``` bash
|
|
52
|
+
docker compose up --build
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
6. To run only specified tests, override the command in compose.yaml:
|
|
56
|
+
|
|
57
|
+
``` yaml
|
|
58
|
+
command: ["pytest", "-n", "auto", "tests/test_httpbin_org_service.py"]
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
This uses pytest-xdist for parallel execution.
|
|
62
|
+
|
|
63
|
+
## Contributing
|
|
64
|
+
|
|
65
|
+
We welcome contributions to Http Dynamix!
|
|
66
|
+
There are many ways to contribute, from improving the documentation, submitting
|
|
67
|
+
bug reports and feature requests or writing code which can be incorporated into
|
|
68
|
+
the main project itself.
|
|
69
|
+
|
|
70
|
+
## Local Development Installation
|
|
71
|
+
|
|
72
|
+
For developers or contributors:
|
|
73
|
+
|
|
74
|
+
``` bash
|
|
75
|
+
# Install mamba-githook for creation of isolated virtual environment,
|
|
76
|
+
# Choose the correct installer for your platform
|
|
77
|
+
# Supported: linux-amd64, linux-arm64, windows-amd64, windows-arm64
|
|
78
|
+
curl -L https://github.com/aydabd/mamba-githook/releases/download/1.0.1/mamba-githook-installer-linux-arm64 \
|
|
79
|
+
-o mamba-githook-installer && \
|
|
80
|
+
chmod +x mamba-githook-installer && \
|
|
81
|
+
./mamba-githook-installer install
|
|
82
|
+
|
|
83
|
+
# Install micromamba via mamba-githook
|
|
84
|
+
mamnba-githook install-micromamba
|
|
85
|
+
# Activate permanent micromamba in your shell, Then you need to restart your shell
|
|
86
|
+
mamba-githook init-shell
|
|
87
|
+
|
|
88
|
+
# Create virtual environment via micromamba
|
|
89
|
+
micromamba create -n http-dynamix-env hatch pandoc
|
|
90
|
+
|
|
91
|
+
# Activate virtual environment
|
|
92
|
+
micromamba activate http-dynamix-env
|
|
93
|
+
|
|
94
|
+
# Clone repository
|
|
95
|
+
git clone ssh://git@github.com:aydabd/http-dynamix.git
|
|
96
|
+
cd http-dynamix
|
|
97
|
+
|
|
98
|
+
# Install development dependencies
|
|
99
|
+
# This will install all dependencies from pyproject.toml
|
|
100
|
+
hatch env create
|
|
101
|
+
|
|
102
|
+
# Run hatch for pre-release:all environment
|
|
103
|
+
hatch run pre-release:all
|
|
104
|
+
|
|
105
|
+
# Install the package in editable mode inside the micromamba environment
|
|
106
|
+
pip install -e .
|
|
107
|
+
|
|
108
|
+
# Build documentation in HTML format
|
|
109
|
+
hatch run pre-release:docs-html
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
## Docker/Compose Test Execution
|
|
113
|
+
|
|
114
|
+
You can run all tests in parallel using Docker Compose:
|
|
115
|
+
|
|
116
|
+
``` bash
|
|
117
|
+
docker compose up --build
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
To run only integration tests, override the command in compose.yaml:
|
|
121
|
+
|
|
122
|
+
``` yaml
|
|
123
|
+
command: ["pytest", "-n", "auto", "tests/test_clients_integration.py"]
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
This uses pytest-xdist for parallel execution. The Dockerfile and compose.yaml are set up for both CI and local testing.
|
|
127
|
+
|
|
128
|
+
## Publish Documentation To Confluence
|
|
129
|
+
|
|
130
|
+
To publish the documentation to Confluence, you need to virtualenv python and
|
|
131
|
+
installed hatch.
|
|
132
|
+
Then you need to set the following environment variables into <span class="title-ref">.env</span> file:
|
|
133
|
+
|
|
134
|
+
``` bash
|
|
135
|
+
CONFLUENCE_SERVER_USER=<your_confluence_user-at-server>
|
|
136
|
+
CONFLUENCE_API_TOKEN=<your-api-token-for-confluence>
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
After that, you can run the following command to publish the documentation to Confluence:
|
|
140
|
+
|
|
141
|
+
``` bash
|
|
142
|
+
# Publish the documentation to Confluence
|
|
143
|
+
hatch run release:all
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
> [!NOTE]
|
|
147
|
+
> Ensure your project is released with the version number before publishing the
|
|
148
|
+
> documentation to Confluence.
|
|
149
|
+
|
|
150
|
+
You can find the published documentation at the link provided in the output of
|
|
151
|
+
the command.
|
|
152
|
+
|
|
153
|
+
For more information about documentation publishing, check the
|
|
154
|
+
`pyproject.toml` file and `docs/conf.py` file.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"""Copyright (c) 2024, Aydin A.
|
|
2
|
+
|
|
3
|
+
This module is the entry point for the http_dynamix package. It imports the
|
|
4
|
+
version number and the logger from the log module. It also imports the
|
|
5
|
+
HttpClientFactory class from the client_factory module.
|
|
6
|
+
"""
|
|
7
|
+
from http_dynamix.factory import ClientFactory
|
|
8
|
+
from http_dynamix.enums import SegmentFormat, ClientType
|
|
9
|
+
from http_dynamix._version import version
|
|
10
|
+
from http_dynamix.auth import BearerAuth, ApiKeyAuth
|
|
11
|
+
from http_dynamix.log import log as logger, LogMaster
|
|
12
|
+
from http_dynamix.core import SegmentFormatter
|
|
13
|
+
from http_dynamix.clients import SyncClient, AsyncClient, AsyncDynamicClient, SyncDynamicClient
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
__all__ = [
|
|
17
|
+
"ClientFactory",
|
|
18
|
+
"ClientType",
|
|
19
|
+
"SegmentFormat",
|
|
20
|
+
"logger",
|
|
21
|
+
"LogMaster",
|
|
22
|
+
"version",
|
|
23
|
+
"BearerAuth",
|
|
24
|
+
"ApiKeyAuth"
|
|
25
|
+
"SegmentFormatter",
|
|
26
|
+
"BaseClient",
|
|
27
|
+
"BaseDynamicClient",
|
|
28
|
+
"SyncClient",
|
|
29
|
+
"AsyncClient",
|
|
30
|
+
"AsyncDynamicClient",
|
|
31
|
+
"SyncDynamicClient"
|
|
32
|
+
]
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
__author__ = "Aydin Abdi"
|
|
36
|
+
__version__ = version
|
|
37
|
+
__license__ = "MIT"
|
|
38
|
+
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# file generated by setuptools-scm
|
|
2
|
+
# don't change, don't track in version control
|
|
3
|
+
|
|
4
|
+
__all__ = ["__version__", "__version_tuple__", "version", "version_tuple"]
|
|
5
|
+
|
|
6
|
+
TYPE_CHECKING = False
|
|
7
|
+
if TYPE_CHECKING:
|
|
8
|
+
from typing import Tuple
|
|
9
|
+
from typing import Union
|
|
10
|
+
|
|
11
|
+
VERSION_TUPLE = Tuple[Union[int, str], ...]
|
|
12
|
+
else:
|
|
13
|
+
VERSION_TUPLE = object
|
|
14
|
+
|
|
15
|
+
version: str
|
|
16
|
+
__version__: str
|
|
17
|
+
__version_tuple__: VERSION_TUPLE
|
|
18
|
+
version_tuple: VERSION_TUPLE
|
|
19
|
+
|
|
20
|
+
__version__ = version = '1.0.0'
|
|
21
|
+
__version_tuple__ = version_tuple = (1, 0, 0)
|