edq-utils 0.1.0__tar.gz → 0.1.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of edq-utils might be problematic. Click here for more details.
- {edq_utils-0.1.0 → edq_utils-0.1.2}/.github/workflows/main.yml +69 -2
- {edq_utils-0.1.0 → edq_utils-0.1.2}/.pylintrc +0 -4
- {edq_utils-0.1.0 → edq_utils-0.1.2}/PKG-INFO +7 -1
- {edq_utils-0.1.0 → edq_utils-0.1.2}/README.md +6 -0
- {edq_utils-0.1.0 → edq_utils-0.1.2}/edq/__init__.py +1 -1
- {edq_utils-0.1.0 → edq_utils-0.1.2}/edq/testing/cli.py +3 -2
- edq_utils-0.1.2/edq/testing/testdata/cli/tests/help_base.txt +9 -0
- {edq_utils-0.1.0 → edq_utils-0.1.2}/edq/testing/unittest.py +14 -0
- {edq_utils-0.1.0 → edq_utils-0.1.2}/edq/util/net.py +7 -2
- {edq_utils-0.1.0 → edq_utils-0.1.2}/edq_utils.egg-info/PKG-INFO +7 -1
- {edq_utils-0.1.0 → edq_utils-0.1.2}/edq_utils.egg-info/SOURCES.txt +7 -1
- edq_utils-0.1.2/scripts/build_site.sh +113 -0
- {edq_utils-0.1.0 → edq_utils-0.1.2}/scripts/gen_docs.sh +1 -1
- edq_utils-0.1.2/scripts/template/html/css/style.css +20 -0
- edq_utils-0.1.2/scripts/template/html/favicon.ico +0 -0
- edq_utils-0.1.2/scripts/template/html/images/favicon.png +0 -0
- edq_utils-0.1.2/scripts/template/html/index.html +32 -0
- {edq_utils-0.1.0 → edq_utils-0.1.2}/.gitignore +0 -0
- {edq_utils-0.1.0 → edq_utils-0.1.2}/.mypy.ini +0 -0
- {edq_utils-0.1.0 → edq_utils-0.1.2}/LICENSE +0 -0
- {edq_utils-0.1.0 → edq_utils-0.1.2}/edq/cli/__init__.py +0 -0
- {edq_utils-0.1.0 → edq_utils-0.1.2}/edq/cli/config/__init__.py +0 -0
- {edq_utils-0.1.0 → edq_utils-0.1.2}/edq/cli/config/list.py +0 -0
- {edq_utils-0.1.0 → edq_utils-0.1.2}/edq/cli/http/__init__.py +0 -0
- {edq_utils-0.1.0 → edq_utils-0.1.2}/edq/cli/http/exchange-server.py +0 -0
- {edq_utils-0.1.0 → edq_utils-0.1.2}/edq/cli/http/send-exchange.py +0 -0
- {edq_utils-0.1.0 → edq_utils-0.1.2}/edq/cli/http/verify-exchanges.py +0 -0
- {edq_utils-0.1.0 → edq_utils-0.1.2}/edq/cli/testing/__init__.py +0 -0
- {edq_utils-0.1.0 → edq_utils-0.1.2}/edq/cli/testing/cli-test.py +0 -0
- {edq_utils-0.1.0 → edq_utils-0.1.2}/edq/cli/version.py +0 -0
- {edq_utils-0.1.0 → edq_utils-0.1.2}/edq/core/__init__.py +0 -0
- {edq_utils-0.1.0 → edq_utils-0.1.2}/edq/core/argparser.py +0 -0
- {edq_utils-0.1.0 → edq_utils-0.1.2}/edq/core/argparser_test.py +0 -0
- {edq_utils-0.1.0 → edq_utils-0.1.2}/edq/core/config.py +0 -0
- {edq_utils-0.1.0 → edq_utils-0.1.2}/edq/core/config_test.py +0 -0
- {edq_utils-0.1.0 → edq_utils-0.1.2}/edq/core/log.py +0 -0
- {edq_utils-0.1.0 → edq_utils-0.1.2}/edq/core/version.py +0 -0
- {edq_utils-0.1.0 → edq_utils-0.1.2}/edq/procedure/__init__.py +0 -0
- {edq_utils-0.1.0 → edq_utils-0.1.2}/edq/procedure/verify_exchanges.py +0 -0
- {edq_utils-0.1.0 → edq_utils-0.1.2}/edq/py.typed +0 -0
- {edq_utils-0.1.0 → edq_utils-0.1.2}/edq/testing/__init__.py +0 -0
- {edq_utils-0.1.0 → edq_utils-0.1.2}/edq/testing/asserts.py +0 -0
- {edq_utils-0.1.0 → edq_utils-0.1.2}/edq/testing/cli_test.py +0 -0
- {edq_utils-0.1.0 → edq_utils-0.1.2}/edq/testing/httpserver.py +0 -0
- {edq_utils-0.1.0 → edq_utils-0.1.2}/edq/testing/httpserver_test.py +0 -0
- {edq_utils-0.1.0 → edq_utils-0.1.2}/edq/testing/run.py +0 -0
- {edq_utils-0.1.0 → edq_utils-0.1.2}/edq/testing/testdata/cli/data/configs/empty/edq-config.json +0 -0
- {edq_utils-0.1.0 → edq_utils-0.1.2}/edq/testing/testdata/cli/data/configs/simple-1/edq-config.json +0 -0
- {edq_utils-0.1.0 → edq_utils-0.1.2}/edq/testing/testdata/cli/data/configs/simple-2/edq-config.json +0 -0
- {edq_utils-0.1.0 → edq_utils-0.1.2}/edq/testing/testdata/cli/data/configs/value-number/edq-config.json +0 -0
- {edq_utils-0.1.0 → edq_utils-0.1.2}/edq/testing/testdata/cli/tests/config/list/config_list_base.txt +0 -0
- {edq_utils-0.1.0 → edq_utils-0.1.2}/edq/testing/testdata/cli/tests/config/list/config_list_config_value_number.txt +0 -0
- {edq_utils-0.1.0 → edq_utils-0.1.2}/edq/testing/testdata/cli/tests/config/list/config_list_ignore_config.txt +0 -0
- {edq_utils-0.1.0 → edq_utils-0.1.2}/edq/testing/testdata/cli/tests/config/list/config_list_no_config.txt +0 -0
- {edq_utils-0.1.0 → edq_utils-0.1.2}/edq/testing/testdata/cli/tests/config/list/config_list_show_origin.txt +0 -0
- {edq_utils-0.1.0 → edq_utils-0.1.2}/edq/testing/testdata/cli/tests/config/list/config_list_skip_header.txt +0 -0
- {edq_utils-0.1.0 → edq_utils-0.1.2}/edq/testing/testdata/cli/tests/platform_skip.txt +0 -0
- {edq_utils-0.1.0 → edq_utils-0.1.2}/edq/testing/testdata/cli/tests/version_base.txt +0 -0
- {edq_utils-0.1.0 → edq_utils-0.1.2}/edq/testing/testdata/http/exchanges/simple.httpex.json +0 -0
- {edq_utils-0.1.0 → edq_utils-0.1.2}/edq/testing/testdata/http/exchanges/simple_anchor.httpex.json +0 -0
- {edq_utils-0.1.0 → edq_utils-0.1.2}/edq/testing/testdata/http/exchanges/simple_file.httpex.json +0 -0
- {edq_utils-0.1.0 → edq_utils-0.1.2}/edq/testing/testdata/http/exchanges/simple_file_binary.httpex.json +0 -0
- {edq_utils-0.1.0 → edq_utils-0.1.2}/edq/testing/testdata/http/exchanges/simple_file_get_params.httpex.json +0 -0
- {edq_utils-0.1.0 → edq_utils-0.1.2}/edq/testing/testdata/http/exchanges/simple_file_multiple.httpex.json +0 -0
- {edq_utils-0.1.0 → edq_utils-0.1.2}/edq/testing/testdata/http/exchanges/simple_file_name.httpex.json +0 -0
- {edq_utils-0.1.0 → edq_utils-0.1.2}/edq/testing/testdata/http/exchanges/simple_file_post_multiple.httpex.json +0 -0
- {edq_utils-0.1.0 → edq_utils-0.1.2}/edq/testing/testdata/http/exchanges/simple_file_post_params.httpex.json +0 -0
- {edq_utils-0.1.0 → edq_utils-0.1.2}/edq/testing/testdata/http/exchanges/simple_headers.httpex.json +0 -0
- {edq_utils-0.1.0 → edq_utils-0.1.2}/edq/testing/testdata/http/exchanges/simple_jsonresponse_dict.httpex.json +0 -0
- {edq_utils-0.1.0 → edq_utils-0.1.2}/edq/testing/testdata/http/exchanges/simple_jsonresponse_list.httpex.json +0 -0
- {edq_utils-0.1.0 → edq_utils-0.1.2}/edq/testing/testdata/http/exchanges/simple_params.httpex.json +0 -0
- {edq_utils-0.1.0 → edq_utils-0.1.2}/edq/testing/testdata/http/exchanges/simple_post.httpex.json +0 -0
- {edq_utils-0.1.0 → edq_utils-0.1.2}/edq/testing/testdata/http/exchanges/simple_post_params.httpex.json +0 -0
- {edq_utils-0.1.0 → edq_utils-0.1.2}/edq/testing/testdata/http/exchanges/simple_post_urlparams.httpex.json +0 -0
- {edq_utils-0.1.0 → edq_utils-0.1.2}/edq/testing/testdata/http/exchanges/simple_urlparams.httpex.json +0 -0
- {edq_utils-0.1.0 → edq_utils-0.1.2}/edq/testing/testdata/http/exchanges/specialcase_listparams_explicit.httpex.json +0 -0
- {edq_utils-0.1.0 → edq_utils-0.1.2}/edq/testing/testdata/http/exchanges/specialcase_listparams_url.httpex.json +0 -0
- {edq_utils-0.1.0 → edq_utils-0.1.2}/edq/testing/testdata/http/files/a.txt +0 -0
- {edq_utils-0.1.0 → edq_utils-0.1.2}/edq/testing/testdata/http/files/tiny.png +0 -0
- {edq_utils-0.1.0 → edq_utils-0.1.2}/edq/util/__init__.py +0 -0
- {edq_utils-0.1.0 → edq_utils-0.1.2}/edq/util/dirent.py +0 -0
- {edq_utils-0.1.0 → edq_utils-0.1.2}/edq/util/dirent_test.py +0 -0
- {edq_utils-0.1.0 → edq_utils-0.1.2}/edq/util/json.py +0 -0
- {edq_utils-0.1.0 → edq_utils-0.1.2}/edq/util/json_test.py +0 -0
- {edq_utils-0.1.0 → edq_utils-0.1.2}/edq/util/pyimport.py +0 -0
- {edq_utils-0.1.0 → edq_utils-0.1.2}/edq/util/pyimport_test.py +0 -0
- {edq_utils-0.1.0 → edq_utils-0.1.2}/edq/util/reflection.py +0 -0
- {edq_utils-0.1.0 → edq_utils-0.1.2}/edq/util/time.py +0 -0
- {edq_utils-0.1.0 → edq_utils-0.1.2}/edq/util/time_test.py +0 -0
- {edq_utils-0.1.0 → edq_utils-0.1.2}/edq_utils.egg-info/dependency_links.txt +0 -0
- {edq_utils-0.1.0 → edq_utils-0.1.2}/edq_utils.egg-info/requires.txt +0 -0
- {edq_utils-0.1.0 → edq_utils-0.1.2}/edq_utils.egg-info/top_level.txt +0 -0
- {edq_utils-0.1.0 → edq_utils-0.1.2}/pyproject.toml +0 -0
- {edq_utils-0.1.0 → edq_utils-0.1.2}/requirements-dev.txt +0 -0
- {edq_utils-0.1.0 → edq_utils-0.1.2}/requirements.txt +0 -0
- {edq_utils-0.1.0 → edq_utils-0.1.2}/scripts/check_all.sh +0 -0
- {edq_utils-0.1.0 → edq_utils-0.1.2}/scripts/check_lint.sh +0 -0
- {edq_utils-0.1.0 → edq_utils-0.1.2}/scripts/check_python_version.sh +0 -0
- {edq_utils-0.1.0 → edq_utils-0.1.2}/scripts/check_strict_types.sh +0 -0
- {edq_utils-0.1.0 → edq_utils-0.1.2}/scripts/check_types.sh +0 -0
- {edq_utils-0.1.0 → edq_utils-0.1.2}/scripts/run_tests.sh +0 -0
- {edq_utils-0.1.0 → edq_utils-0.1.2}/setup.cfg +0 -0
|
@@ -51,13 +51,80 @@ jobs:
|
|
|
51
51
|
shell: bash
|
|
52
52
|
run: ./scripts/run_tests.sh
|
|
53
53
|
|
|
54
|
-
|
|
54
|
+
docs:
|
|
55
55
|
needs: test
|
|
56
|
+
if: ${{ github.event_name == 'push' && github.repository_owner == 'edulinq' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')) }}
|
|
57
|
+
|
|
58
|
+
permissions:
|
|
59
|
+
contents: read
|
|
60
|
+
pages: write
|
|
61
|
+
id-token: write
|
|
62
|
+
|
|
63
|
+
environment:
|
|
64
|
+
name: github-pages
|
|
65
|
+
url: ${{ steps.deployment.outputs.page_url }}
|
|
66
|
+
|
|
67
|
+
strategy:
|
|
68
|
+
matrix:
|
|
69
|
+
python-version: ['3.11']
|
|
70
|
+
os: ['ubuntu-24.04']
|
|
71
|
+
|
|
72
|
+
runs-on: ${{ matrix.os }}
|
|
73
|
+
|
|
74
|
+
steps:
|
|
75
|
+
- name: Checkout
|
|
76
|
+
uses: actions/checkout@v4
|
|
77
|
+
with:
|
|
78
|
+
fetch-depth: 0
|
|
79
|
+
fetch-tags: true
|
|
80
|
+
|
|
81
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
82
|
+
uses: actions/setup-python@v5
|
|
83
|
+
with:
|
|
84
|
+
python-version: ${{ matrix.python-version }}
|
|
85
|
+
|
|
86
|
+
- name: Cache Python Dependencies
|
|
87
|
+
uses: actions/cache@v4
|
|
88
|
+
with:
|
|
89
|
+
path: ${{ env.pythonLocation }}
|
|
90
|
+
key: ${{ runner.os }}-os:${{ matrix.os }}-python:${{ matrix.python-version }}-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements-dev.txt') }}
|
|
91
|
+
|
|
92
|
+
- name: Install Dependencies
|
|
93
|
+
shell: bash
|
|
94
|
+
run: pip install -r requirements.txt -r requirements-dev.txt
|
|
95
|
+
|
|
96
|
+
- name: Setup Pages
|
|
97
|
+
uses: actions/configure-pages@v5
|
|
98
|
+
|
|
99
|
+
- name: Build Site
|
|
100
|
+
shell: bash
|
|
101
|
+
run: |
|
|
102
|
+
git checkout main
|
|
103
|
+
./scripts/build_site.sh
|
|
104
|
+
|
|
105
|
+
- name: Upload Artifact
|
|
106
|
+
uses: actions/upload-pages-artifact@v3
|
|
107
|
+
with:
|
|
108
|
+
path: 'build/site'
|
|
109
|
+
|
|
110
|
+
- name: Deploy to GitHub Pages
|
|
111
|
+
id: deployment
|
|
112
|
+
uses: actions/deploy-pages@v4
|
|
113
|
+
|
|
114
|
+
deploy:
|
|
115
|
+
# Run after test and docs, but allow docs to have been skipped (since we will only test deploy then).
|
|
116
|
+
needs: [test, docs]
|
|
117
|
+
if: |
|
|
118
|
+
(always() && !cancelled())
|
|
119
|
+
&& (
|
|
120
|
+
(needs.test.result == 'success')
|
|
121
|
+
&& ((needs.docs.result == 'success') || (needs.docs.result == 'skipped'))
|
|
122
|
+
)
|
|
56
123
|
|
|
57
124
|
strategy:
|
|
58
125
|
matrix:
|
|
59
126
|
python-version: ['3.11']
|
|
60
|
-
os: ['ubuntu-
|
|
127
|
+
os: ['ubuntu-24.04']
|
|
61
128
|
|
|
62
129
|
runs-on: ${{ matrix.os }}
|
|
63
130
|
|
|
@@ -104,10 +104,6 @@ recursive=no
|
|
|
104
104
|
# source root.
|
|
105
105
|
source-roots=
|
|
106
106
|
|
|
107
|
-
# When enabled, pylint would attempt to guess common misconfiguration and emit
|
|
108
|
-
# user-friendly hints instead of false-positive error messages.
|
|
109
|
-
suggestion-mode=yes
|
|
110
|
-
|
|
111
107
|
# Allow loading of arbitrary C extensions. Extensions are imported into the
|
|
112
108
|
# active Python interpreter and may run arbitrary code.
|
|
113
109
|
unsafe-load-any-extension=no
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: edq-utils
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.2
|
|
4
4
|
Summary: Common utilities used by EduLinq Python projects.
|
|
5
5
|
Author-email: Eriq Augustine <eriq@edulinq.org>
|
|
6
6
|
License: MIT License
|
|
@@ -50,6 +50,12 @@ Dynamic: license-file
|
|
|
50
50
|
|
|
51
51
|
Common utilities used by EduLinq Python projects.
|
|
52
52
|
|
|
53
|
+
Links:
|
|
54
|
+
- [API Reference](https://edulinq.github.io/python-utils)
|
|
55
|
+
- [Installation / Requirements](#installation--requirements)
|
|
56
|
+
- [Configuration System](#configuration-system)
|
|
57
|
+
- [Configuration Sources](#configuration-sources)
|
|
58
|
+
|
|
53
59
|
## Installation / Requirements
|
|
54
60
|
|
|
55
61
|
This project requires [Python](https://www.python.org/) >= 3.8.
|
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
Common utilities used by EduLinq Python projects.
|
|
4
4
|
|
|
5
|
+
Links:
|
|
6
|
+
- [API Reference](https://edulinq.github.io/python-utils)
|
|
7
|
+
- [Installation / Requirements](#installation--requirements)
|
|
8
|
+
- [Configuration System](#configuration-system)
|
|
9
|
+
- [Configuration Sources](#configuration-sources)
|
|
10
|
+
|
|
5
11
|
## Installation / Requirements
|
|
6
12
|
|
|
7
13
|
This project requires [Python](https://www.python.org/) >= 3.8.
|
|
@@ -35,6 +35,7 @@ import edq.util.json
|
|
|
35
35
|
import edq.util.pyimport
|
|
36
36
|
|
|
37
37
|
TEST_CASE_SEP: str = '---'
|
|
38
|
+
OUTPUT_SEP: str = '+++'
|
|
38
39
|
DATA_DIR_ID: str = '__DATA_DIR__'
|
|
39
40
|
ABS_DATA_DIR_ID: str = '__ABS_DATA_DIR__'
|
|
40
41
|
TEMP_DIR_ID: str = '__TEMP_DIR__'
|
|
@@ -149,7 +150,7 @@ class CLITestInfo:
|
|
|
149
150
|
"""
|
|
150
151
|
Split stdout and stderr into different strings for testing.
|
|
151
152
|
By default, these two will be combined.
|
|
152
|
-
If both are non-empty, then they will be joined like: f"{stdout}\n{
|
|
153
|
+
If both are non-empty, then they will be joined like: f"{stdout}\n{OUTPUT_SEP}\n{stderr}".
|
|
153
154
|
Otherwise, only the non-empty one will be present with no separator.
|
|
154
155
|
Any stdout assertions will be applied to the combined text.
|
|
155
156
|
"""
|
|
@@ -293,7 +294,7 @@ def _get_test_method(test_name: str, path: str, data_dir: str) -> typing.Callabl
|
|
|
293
294
|
|
|
294
295
|
if (not test_info.split_stdout_stderr):
|
|
295
296
|
if ((len(stdout_text) > 0) and (len(stderr_text) > 0)):
|
|
296
|
-
stdout_text = f"{stdout_text}\n{
|
|
297
|
+
stdout_text = f"{stdout_text}\n{OUTPUT_SEP}\n{stderr_text}"
|
|
297
298
|
elif (len(stderr_text) > 0):
|
|
298
299
|
stdout_text = stderr_text
|
|
299
300
|
|
|
@@ -14,6 +14,20 @@ class BaseTest(unittest.TestCase):
|
|
|
14
14
|
maxDiff = None
|
|
15
15
|
""" Don't limit the size of diffs. """
|
|
16
16
|
|
|
17
|
+
def assertJSONEqual(self, a: typing.Any, b: typing.Any, message: typing.Union[str, None] = None) -> None: # pylint: disable=invalid-name
|
|
18
|
+
"""
|
|
19
|
+
Like unittest.TestCase.assertEqual(),
|
|
20
|
+
but uses a default assertion message containing the full JSON representation of the arguments.
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
a_json = edq.util.json.dumps(a, indent = 4)
|
|
24
|
+
b_json = edq.util.json.dumps(b, indent = 4)
|
|
25
|
+
|
|
26
|
+
if (message is None):
|
|
27
|
+
message = FORMAT_STR % (a_json, b_json)
|
|
28
|
+
|
|
29
|
+
super().assertEqual(a, b, msg = message)
|
|
30
|
+
|
|
17
31
|
def assertJSONDictEqual(self, a: typing.Any, b: typing.Any, message: typing.Union[str, None] = None) -> None: # pylint: disable=invalid-name
|
|
18
32
|
"""
|
|
19
33
|
Like unittest.TestCase.assertDictEqual(),
|
|
@@ -666,6 +666,7 @@ def make_request(method: str, url: str,
|
|
|
666
666
|
params_to_skip: typing.Union[typing.List[str], None] = None,
|
|
667
667
|
http_exchange_extension: str = DEFAULT_HTTP_EXCHANGE_EXTENSION,
|
|
668
668
|
add_http_prefix: bool = True,
|
|
669
|
+
additional_requests_options: typing.Union[typing.Dict[str, typing.Any], None] = None,
|
|
669
670
|
**kwargs: typing.Any) -> typing.Tuple[requests.Response, str]:
|
|
670
671
|
"""
|
|
671
672
|
Make an HTTP request and return the response object and text body.
|
|
@@ -686,6 +687,9 @@ def make_request(method: str, url: str,
|
|
|
686
687
|
if (files is None):
|
|
687
688
|
files = []
|
|
688
689
|
|
|
690
|
+
if (additional_requests_options is None):
|
|
691
|
+
additional_requests_options = {}
|
|
692
|
+
|
|
689
693
|
# Add in the anchor as a header (since it is not traditionally sent in an HTTP request).
|
|
690
694
|
if (send_anchor_header):
|
|
691
695
|
headers = headers.copy()
|
|
@@ -693,11 +697,12 @@ def make_request(method: str, url: str,
|
|
|
693
697
|
parts = urllib.parse.urlparse(url)
|
|
694
698
|
headers[ANCHOR_HEADER_KEY] = parts.fragment.lstrip('#')
|
|
695
699
|
|
|
696
|
-
options =
|
|
700
|
+
options = additional_requests_options.copy()
|
|
701
|
+
options.update({
|
|
697
702
|
'headers': headers,
|
|
698
703
|
'files': files,
|
|
699
704
|
'timeout': timeout_secs,
|
|
700
|
-
}
|
|
705
|
+
})
|
|
701
706
|
|
|
702
707
|
if (method == 'GET'):
|
|
703
708
|
options['params'] = data
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: edq-utils
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.2
|
|
4
4
|
Summary: Common utilities used by EduLinq Python projects.
|
|
5
5
|
Author-email: Eriq Augustine <eriq@edulinq.org>
|
|
6
6
|
License: MIT License
|
|
@@ -50,6 +50,12 @@ Dynamic: license-file
|
|
|
50
50
|
|
|
51
51
|
Common utilities used by EduLinq Python projects.
|
|
52
52
|
|
|
53
|
+
Links:
|
|
54
|
+
- [API Reference](https://edulinq.github.io/python-utils)
|
|
55
|
+
- [Installation / Requirements](#installation--requirements)
|
|
56
|
+
- [Configuration System](#configuration-system)
|
|
57
|
+
- [Configuration Sources](#configuration-sources)
|
|
58
|
+
|
|
53
59
|
## Installation / Requirements
|
|
54
60
|
|
|
55
61
|
This project requires [Python](https://www.python.org/) >= 3.8.
|
|
@@ -40,6 +40,7 @@ edq/testing/testdata/cli/data/configs/empty/edq-config.json
|
|
|
40
40
|
edq/testing/testdata/cli/data/configs/simple-1/edq-config.json
|
|
41
41
|
edq/testing/testdata/cli/data/configs/simple-2/edq-config.json
|
|
42
42
|
edq/testing/testdata/cli/data/configs/value-number/edq-config.json
|
|
43
|
+
edq/testing/testdata/cli/tests/help_base.txt
|
|
43
44
|
edq/testing/testdata/cli/tests/platform_skip.txt
|
|
44
45
|
edq/testing/testdata/cli/tests/version_base.txt
|
|
45
46
|
edq/testing/testdata/cli/tests/config/list/config_list_base.txt
|
|
@@ -85,10 +86,15 @@ edq_utils.egg-info/SOURCES.txt
|
|
|
85
86
|
edq_utils.egg-info/dependency_links.txt
|
|
86
87
|
edq_utils.egg-info/requires.txt
|
|
87
88
|
edq_utils.egg-info/top_level.txt
|
|
89
|
+
scripts/build_site.sh
|
|
88
90
|
scripts/check_all.sh
|
|
89
91
|
scripts/check_lint.sh
|
|
90
92
|
scripts/check_python_version.sh
|
|
91
93
|
scripts/check_strict_types.sh
|
|
92
94
|
scripts/check_types.sh
|
|
93
95
|
scripts/gen_docs.sh
|
|
94
|
-
scripts/run_tests.sh
|
|
96
|
+
scripts/run_tests.sh
|
|
97
|
+
scripts/template/html/favicon.ico
|
|
98
|
+
scripts/template/html/index.html
|
|
99
|
+
scripts/template/html/css/style.css
|
|
100
|
+
scripts/template/html/images/favicon.png
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
# Create a full website including all documentation ready to be deployed.
|
|
4
|
+
# This script should only be done from a clean repo on the main branch.
|
|
5
|
+
# Documentation will be generated from the main branch (latest) as well as each version tag.
|
|
6
|
+
|
|
7
|
+
readonly THIS_DIR="$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd | xargs realpath)"
|
|
8
|
+
readonly ROOT_DIR="${THIS_DIR}/.."
|
|
9
|
+
readonly TEMPLATE_HTML_DIR="${THIS_DIR}/template/html"
|
|
10
|
+
readonly BUILD_DIR="${ROOT_DIR}/build"
|
|
11
|
+
readonly DOCS_BUILD_DIR="${BUILD_DIR}/html"
|
|
12
|
+
readonly SITE_BUILD_DIR="${BUILD_DIR}/site"
|
|
13
|
+
readonly DOCS_DIRNAME='docs'
|
|
14
|
+
readonly DOCS_OUT_DIR="${SITE_BUILD_DIR}/${DOCS_DIRNAME}"
|
|
15
|
+
readonly GEN_DOCS_SCRIPT="${THIS_DIR}/gen_docs.sh"
|
|
16
|
+
|
|
17
|
+
readonly MAIN_BRANCH="main"
|
|
18
|
+
|
|
19
|
+
readonly REPO='edulinq/python-utils'
|
|
20
|
+
readonly REPO_DISPLAY_NAME='EduLinq Python Utils'
|
|
21
|
+
readonly REPO_MAIN_PACKAGE_NAME='edq'
|
|
22
|
+
|
|
23
|
+
readonly INDEX_TITLE_LOCATION='<header class="pdoc">'
|
|
24
|
+
readonly MODULE_TITLE_LOCATION='<section class="module-info">'
|
|
25
|
+
|
|
26
|
+
readonly API_DOC_MARKER='<!-- API-DOC-MARKER -->'
|
|
27
|
+
|
|
28
|
+
# Don't generate any docs for this version or earlier.
|
|
29
|
+
# Because of this specific tag, we can just do a lexicographic comparison.
|
|
30
|
+
readonly ONLY_AFTER_TAG='v0.1.0'
|
|
31
|
+
|
|
32
|
+
function check_git() {
|
|
33
|
+
if [ ! -z "$(git status --porcelain)" ] ; then
|
|
34
|
+
echo "ERROR: Repository is not clean."
|
|
35
|
+
exit 1
|
|
36
|
+
fi
|
|
37
|
+
|
|
38
|
+
if [ $(git branch --show-current) != 'main' ] ; then
|
|
39
|
+
echo "ERROR: Repository is not on the main branch."
|
|
40
|
+
exit 2
|
|
41
|
+
fi
|
|
42
|
+
|
|
43
|
+
return 0
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function gen_docs() {
|
|
47
|
+
local label=$1
|
|
48
|
+
local reference=$2
|
|
49
|
+
local dirname=$3
|
|
50
|
+
|
|
51
|
+
echo "Generating docs for '${label}'."
|
|
52
|
+
|
|
53
|
+
rm -rf "${DOCS_BUILD_DIR}"
|
|
54
|
+
${GEN_DOCS_SCRIPT} "${DOCS_BUILD_DIR}"
|
|
55
|
+
|
|
56
|
+
# Add in the label to the landing pages.
|
|
57
|
+
local git_link="https://github.com/${REPO}/tree/${reference}"
|
|
58
|
+
|
|
59
|
+
local index_title="<h1 style='flex-grow: 1'>${REPO_DISPLAY_NAME} API Reference: <a href='${git_link}'>${label}</a></h1>"
|
|
60
|
+
sed -i "s#${INDEX_TITLE_LOCATION}#${INDEX_TITLE_LOCATION}${index_title}#" "${DOCS_BUILD_DIR}/index.html"
|
|
61
|
+
|
|
62
|
+
local module_title="<h1>${REPO_DISPLAY_NAME} API Reference: <a href='${git_link}'>${label}</a></h1>"
|
|
63
|
+
sed -i "s#${MODULE_TITLE_LOCATION}#${MODULE_TITLE_LOCATION}${module_title}#" "${DOCS_BUILD_DIR}/${REPO_MAIN_PACKAGE_NAME}.html"
|
|
64
|
+
|
|
65
|
+
# Moved the compiled documentation to the main site.
|
|
66
|
+
mkdir -p "${DOCS_OUT_DIR}"
|
|
67
|
+
mv "${DOCS_BUILD_DIR}" "${DOCS_OUT_DIR}/${dirname}"
|
|
68
|
+
|
|
69
|
+
# Add this documentation to the main index page.
|
|
70
|
+
local index_li="<li><a href='${DOCS_DIRNAME}/${dirname}/index.html'>${label}</a></li>"
|
|
71
|
+
sed -i "s#${API_DOC_MARKER}#${index_li}${API_DOC_MARKER}#" "${SITE_BUILD_DIR}/index.html"
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function main() {
|
|
75
|
+
if [[ $# -ne 0 ]]; then
|
|
76
|
+
echo "USAGE: $0"
|
|
77
|
+
exit 1
|
|
78
|
+
fi
|
|
79
|
+
|
|
80
|
+
set -e
|
|
81
|
+
trap exit SIGINT
|
|
82
|
+
|
|
83
|
+
cd "${ROOT_DIR}"
|
|
84
|
+
|
|
85
|
+
# Remove any existing output.
|
|
86
|
+
rm -rf "${SITE_BUILD_DIR}"
|
|
87
|
+
mkdir -p "${SITE_BUILD_DIR}"
|
|
88
|
+
cp -r "${TEMPLATE_HTML_DIR}"/* "${SITE_BUILD_DIR}"/
|
|
89
|
+
|
|
90
|
+
# Ensure that the repo looks good.
|
|
91
|
+
check_git
|
|
92
|
+
|
|
93
|
+
# Generate the latest documentation.
|
|
94
|
+
local git_hash=$(git rev-parse --short HEAD)
|
|
95
|
+
gen_docs "latest (${git_hash})" "${git_hash}" 'latest'
|
|
96
|
+
|
|
97
|
+
# Generate docs for each tagged version.
|
|
98
|
+
for tag in $(git tag -l | grep -P '^v\d+\.\d+\.\d+' | sort -r --version-sort) ; do
|
|
99
|
+
if [[ ! "${tag}" > "${ONLY_AFTER_TAG}" ]] ; then
|
|
100
|
+
continue
|
|
101
|
+
fi
|
|
102
|
+
|
|
103
|
+
git checkout --quiet "${tag}"
|
|
104
|
+
gen_docs "${tag}" "${tag}" "${tag}"
|
|
105
|
+
done
|
|
106
|
+
|
|
107
|
+
# Move back to main.
|
|
108
|
+
git checkout --quiet main
|
|
109
|
+
|
|
110
|
+
return 0
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
[[ "${BASH_SOURCE[0]}" == "${0}" ]] && main "$@"
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
ul {
|
|
2
|
+
margin: 0;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
h1, p {
|
|
6
|
+
margin: 0;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.page {
|
|
10
|
+
width: 100%;
|
|
11
|
+
height: 100%;
|
|
12
|
+
display: flex;
|
|
13
|
+
flex-direction: column;
|
|
14
|
+
flex-wrap: nowrap;
|
|
15
|
+
justify-content: flex-start;
|
|
16
|
+
align-items: center;
|
|
17
|
+
gap: 2em;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset='utf-8'/>
|
|
5
|
+
<meta name='viewport' content='width=device-width, initial-scale=1.0'>
|
|
6
|
+
|
|
7
|
+
<title>EduLinq Python Utils</title>
|
|
8
|
+
|
|
9
|
+
<link rel="icon" href="images/favicon.png">
|
|
10
|
+
|
|
11
|
+
<link rel='stylesheet' type='text/css' href='css/style.css'>
|
|
12
|
+
</head>
|
|
13
|
+
<body>
|
|
14
|
+
<div class='page'>
|
|
15
|
+
<h1>EduLinq Python Utils</h1>
|
|
16
|
+
|
|
17
|
+
<div class='overview'>
|
|
18
|
+
<p>Common Python utilities used by EduLinq.</p>
|
|
19
|
+
<p>You can find the main repository at <a href='https://github.com/edulinq/python-utils'>github.com/edulinq/python-utils</a>.</p>
|
|
20
|
+
<p>Below you can find API references for various different version.</p>
|
|
21
|
+
</p>
|
|
22
|
+
</div>
|
|
23
|
+
|
|
24
|
+
<div class='docs'>
|
|
25
|
+
<span>Versions:</span>
|
|
26
|
+
<ul>
|
|
27
|
+
<!-- API-DOC-MARKER -->
|
|
28
|
+
</ul>
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
</body>
|
|
32
|
+
</html>
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{edq_utils-0.1.0 → edq_utils-0.1.2}/edq/testing/testdata/cli/data/configs/empty/edq-config.json
RENAMED
|
File without changes
|
{edq_utils-0.1.0 → edq_utils-0.1.2}/edq/testing/testdata/cli/data/configs/simple-1/edq-config.json
RENAMED
|
File without changes
|
{edq_utils-0.1.0 → edq_utils-0.1.2}/edq/testing/testdata/cli/data/configs/simple-2/edq-config.json
RENAMED
|
File without changes
|
|
File without changes
|
{edq_utils-0.1.0 → edq_utils-0.1.2}/edq/testing/testdata/cli/tests/config/list/config_list_base.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{edq_utils-0.1.0 → edq_utils-0.1.2}/edq/testing/testdata/http/exchanges/simple_anchor.httpex.json
RENAMED
|
File without changes
|
{edq_utils-0.1.0 → edq_utils-0.1.2}/edq/testing/testdata/http/exchanges/simple_file.httpex.json
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{edq_utils-0.1.0 → edq_utils-0.1.2}/edq/testing/testdata/http/exchanges/simple_file_name.httpex.json
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{edq_utils-0.1.0 → edq_utils-0.1.2}/edq/testing/testdata/http/exchanges/simple_headers.httpex.json
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{edq_utils-0.1.0 → edq_utils-0.1.2}/edq/testing/testdata/http/exchanges/simple_params.httpex.json
RENAMED
|
File without changes
|
{edq_utils-0.1.0 → edq_utils-0.1.2}/edq/testing/testdata/http/exchanges/simple_post.httpex.json
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{edq_utils-0.1.0 → edq_utils-0.1.2}/edq/testing/testdata/http/exchanges/simple_urlparams.httpex.json
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|