Skip to content

Commit 703663f

Browse files
Ci (#22)
* ci + bugfix
1 parent ddfcd80 commit 703663f

25 files changed

Lines changed: 1964 additions & 614 deletions

.flake8

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[flake8]
2+
max-line-length = 88
3+
show_source = True
4+
docstring-convention = google
5+
exclude = .svn, CVS, .bzr, .hg, .git, __pycache__, .tox, venv, .venv, .eggs, build
6+
ignore = E203, E266, E501, W503, F403, F401, F405, C901, E722
7+
max-complexity = 26
8+
select = B, C, E, F, W, T4, B9
9+
per-file-ignores =
10+
# Do not check docstrings for the tests or docs directories
11+
tests/*: D
12+
docs/*: D
13+
manip/*: D
14+
demos/*: D

.github/actions/prepare-poetry/action.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
##
2+
## Copyright (c) 2022-2023 Geosiris.
3+
## SPDX-License-Identifier: Apache-2.0
4+
##
15
---
26

37
name: Prepare Python and Poetry
@@ -27,7 +31,7 @@ runs:
2731
- name: Install Poetry
2832
uses: snok/install-poetry@v1
2933
with:
30-
version: 1.1.13
34+
version: 1.5.1
3135
virtualenvs-create: true
3236
virtualenvs-in-project: true
3337

.github/codecov.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
##
2+
## Copyright (c) 2022-2023 Geosiris.
3+
## SPDX-License-Identifier: Apache-2.0
4+
##
15
---
26
# Configuration for CodeCov
37
# See https://docs.codecov.io/docs/codecov-yaml

.github/dependabot.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
1+
##
2+
## Copyright (c) 2022-2023 Geosiris.
3+
## SPDX-License-Identifier: Apache-2.0
4+
##
25
version: 2
36

47
updates:

.github/workflows/ci-publish-test-repo.yml

Lines changed: 41 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
##
2+
## Copyright (c) 2022-2023 Geosiris.
3+
## SPDX-License-Identifier: Apache-2.0
4+
##
15
---
26

37
on:
@@ -36,45 +40,46 @@ jobs:
3640
name: dist-artifact
3741
path: dist/
3842

39-
test:
40-
name: Test
41-
needs: build
42-
runs-on: ubuntu-latest
43-
steps:
44-
45-
- name: Set up Python
46-
uses: actions/setup-python@v4
47-
with:
48-
python-version: '3.9'
49-
50-
- name: Checkout code
51-
uses: actions/checkout@v3
52-
with:
53-
fetch-depth: 0
54-
55-
- name: Get build artifacts
56-
uses: actions/download-artifact@v3
57-
with:
58-
name: dist-artifact
59-
path: dist/
60-
61-
- name: Install from build
62-
run: |
63-
python -m pip install --upgrade pip
64-
pip install pytest-mock
65-
pip install etpproto --pre --target=dist --find-links=dist/
66-
67-
- name: Copy tests and example data to dist folder for testing against artifacts
68-
run: |
69-
cp -R tests dist/
70-
# cp -R example_data dist/
71-
72-
- name: Run tests
73-
run: pytest dist/tests
43+
# test:
44+
# name: Test
45+
# needs: build
46+
# runs-on: ubuntu-latest
47+
# steps:
48+
49+
# - name: Set up Python
50+
# uses: actions/setup-python@v2
51+
# with:
52+
# python-version: '3.9'
53+
54+
# - name: Checkout code
55+
# uses: actions/checkout@v3
56+
# with:
57+
# fetch-depth: 0
58+
59+
# - name: Get build artifacts
60+
# uses: actions/download-artifact@v2
61+
# with:
62+
# name: dist-artifact
63+
# path: dist/
64+
65+
# - name: Install from build
66+
# run: |
67+
# python -m pip install --upgrade pip
68+
# pip install pytest-mock
69+
# pip install etpproto --pre --target=dist --find-links=dist/
70+
71+
# - name: Copy tests and example data to dist folder for testing against artifacts
72+
# run: |
73+
# cp -R tests dist/
74+
# # cp -R example_data dist/
75+
76+
# - name: Run tests
77+
# run: pytest dist/tests
7478

7579
publish:
7680
name: Publish to PyPI
77-
needs: [build, test]
81+
needs: [build]
82+
# needs: [build, test]
7883
runs-on: ubuntu-latest
7984
steps:
8085

.github/workflows/ci-publish.yml

Lines changed: 41 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
##
2+
## Copyright (c) 2022-2023 Geosiris.
3+
## SPDX-License-Identifier: Apache-2.0
4+
##
15
---
26

37
name: Publish release
@@ -38,45 +42,46 @@ jobs:
3842
name: dist-artifact
3943
path: dist/
4044

41-
test:
42-
name: Test
43-
needs: build
44-
runs-on: ubuntu-latest
45-
steps:
46-
47-
- name: Set up Python
48-
uses: actions/setup-python@v4
49-
with:
50-
python-version: '3.9'
51-
52-
- name: Checkout code
53-
uses: actions/checkout@v3
54-
with:
55-
fetch-depth: 0
56-
57-
- name: Get build artifacts
58-
uses: actions/download-artifact@v3
59-
with:
60-
name: dist-artifact
61-
path: dist/
62-
63-
- name: Install from build
64-
run: |
65-
python -m pip install --upgrade pip
66-
pip install pytest-mock
67-
pip install etpproto --pre --target=dist --find-links=dist/
68-
69-
- name: Copy tests and example data to dist folder for testing against artifacts
70-
run: |
71-
cp -R tests dist/
72-
# cp -R example_data dist/
73-
74-
- name: Run tests
75-
run: pytest dist/tests
45+
# test:
46+
# name: Test
47+
# needs: build
48+
# runs-on: ubuntu-latest
49+
# steps:
50+
51+
# - name: Set up Python
52+
# uses: actions/setup-python@v4
53+
# with:
54+
# python-version: '3.9'
55+
56+
# - name: Checkout code
57+
# uses: actions/checkout@v3
58+
# with:
59+
# fetch-depth: 0
60+
61+
# - name: Get build artifacts
62+
# uses: actions/download-artifact@v3
63+
# with:
64+
# name: dist-artifact
65+
# path: dist/
66+
67+
# - name: Install from build
68+
# run: |
69+
# python -m pip install --upgrade pip
70+
# pip install pytest-mock
71+
# pip install etpproto --pre --target=dist --find-links=dist/
72+
73+
# - name: Copy tests and example data to dist folder for testing against artifacts
74+
# run: |
75+
# cp -R tests dist/
76+
# # cp -R example_data dist/
77+
78+
# - name: Run tests
79+
# run: pytest dist/tests
7680

7781
publish:
7882
name: Publish to PyPI
79-
needs: [build, test]
83+
needs: [build]
84+
# needs: [build, test]
8085
runs-on: ubuntu-latest
8186
steps:
8287

.github/workflows/ci-tests.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
##
2+
## Copyright (c) 2022-2023 Geosiris.
3+
## SPDX-License-Identifier: Apache-2.0
4+
##
15
name: Tests
26

37
on:

.github/workflows/codeql-analysis.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
##
2+
## Copyright (c) 2022-2023 Geosiris.
3+
## SPDX-License-Identifier: Apache-2.0
4+
##
15
---
26

37
name: CodeQL

.gitignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,9 @@ venv/
2121
manip
2222
test-data/
2323
manip.txt
24-
24+
demos/
25+
*.epc
26+
*.h5
27+
*.xml
28+
*.txt
29+
output*

README.md

Lines changed: 64 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
etpclient
1+
<!--
2+
Copyright (c) 2022-2023 Geosiris.
3+
SPDX-License-Identifier: Apache-2.0
4+
-->
5+
# Etpclient
26
==========
37

48

@@ -11,9 +15,65 @@ etpclient
1115
[![codecov](https://codecov.io/gh/geosiris-technologies/etpclient-python/branch/main/graph/badge.svg)](https://codecov.io/gh/geosiris-technologies/etpclient-python)
1216

1317

18+
## Installation :
1419

15-
poetry run python .\src\etpclient\main.py --host MY_HOST --port 80 --sub-path etp -t https://rddms.centralus.cloudapp.azure.com/rest/Reservoir/v1/auth/token
20+
Poetry is required to use the client. [Poetry documentation](https://python-poetry.org/docs/)
1621

17-
poetry run python .\src\etpclient\main.py --host 127.0.0.1 --port 17000 --sub-path etp --username login --password passwordTest
22+
```bash
23+
poetry update
24+
poetry install
25+
```
1826

19-
poetry run python .\src\etpclient\main.py --host 127.0.0.1 --port 5432 --username testerlogin --password passwordtester
27+
## Sample commands :
28+
29+
```bash
30+
poetry run python client --host RDDMS_HOST --port 9002 -t MY_TOKEN
31+
32+
poetry run python client --host MY_HOST --port 80 --sub-path etp -t MY_TOKEN
33+
34+
poetry run python client --host 127.0.0.1 --port 17000 --sub-path etp --username login --password passwordTest
35+
36+
poetry run python client --host 127.0.0.1 --port 5432 --username testerlogin --password passwordtester
37+
```
38+
39+
40+
## ETP supported commands :
41+
42+
When the client is connected you can send your request.
43+
44+
This is the help menu :
45+
```bash
46+
[XXX] : replace XXX with your value
47+
[XXX=Y] : replace XXX with your value, default is Y
48+
[[XXX]] : optional parameter
49+
50+
Help : show this menu
51+
52+
Quit : hard quit (no CloseSession sent)
53+
CloseSession : close this session
54+
55+
GetDataArrayMetadata [URI] [PATH_IN_RESOURCE]
56+
GetDataArray [URI] [PATH_IN_RESOURCE]
57+
GetDataSubArray [URI] [PATH_IN_RESOURCE] [START] [COUNT]
58+
PutDataArray [[UUIDS]]* [DATASPACE_NAME] [EPC_FILE_PATH] [H5_FILE_PATH]
59+
60+
GetDataObject [URI_1] [...] [URI_N]
61+
PutDataObject [FILE_PATH] [[DATASPACE_NAME]]
62+
GetResources [[uri=eml:/// or notUri=DataspaceName]] [[depth=1]] [[SCOPE]]
63+
64+
GetDataspaces
65+
PutDataspace [NAME]
66+
DeleteDataspace [NAME]
67+
```
68+
69+
## Configuration
70+
71+
It is possible to change the "capabilities" of your client in the prefilled RequestSession object in [etpclient/etp/requester.py](https://github.com/geosiris-technologies/etpclient-python/blob/main/etpclient/etp/requester.py#L180)
72+
73+
To add/remove supported protocols and request, modify the file [etpclient/etp/serverprotocols.py](https://github.com/geosiris-technologies/etpclient-python/blob/main/etpclient/etp/serverprotocols.py#L166). Do not forget to decorate your protocols to allow the class ETPConnection to use your protocol.
74+
Example :
75+
```python
76+
@ETPConnection.on(CommunicationProtocol.CORE)
77+
class myCoreProtocol(CoreHandler):
78+
...
79+
```

0 commit comments

Comments
 (0)