Skip to content

Commit 5e4c41b

Browse files
authored
Prototype: EDIFACT↔BO4E Conversion (w/o authentication) (#2)
I already added some of our well tested OAuth2 Client/Credential Flow Code from another project. We just need to use it. Testing the auth will be harder than implementing it.
1 parent 746ac5d commit 5e4c41b

28 files changed

+768
-115
lines changed

.github/workflows/codeql-analysis.yml

+29-29
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ name: "CodeQL"
1313

1414
on:
1515
push:
16-
branches: [ main ]
16+
branches: [main]
1717
pull_request:
1818
# The branches below must be a subset of the branches above
19-
branches: [ main ]
19+
branches: [main]
2020
schedule:
21-
- cron: '29 14 * * 6'
21+
- cron: "29 14 * * 6"
2222

2323
jobs:
2424
analyze:
@@ -32,39 +32,39 @@ jobs:
3232
strategy:
3333
fail-fast: false
3434
matrix:
35-
language: [ 'python' ]
35+
language: ["python"]
3636
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
3737
# Learn more about CodeQL language support at https://git.io/codeql-language-support
3838

3939
steps:
40-
- name: Checkout repository
41-
uses: actions/checkout@v4
40+
- name: Checkout repository
41+
uses: actions/checkout@v4
4242

43-
# Initializes the CodeQL tools for scanning.
44-
- name: Initialize CodeQL
45-
uses: github/codeql-action/init@v3
46-
with:
47-
languages: ${{ matrix.language }}
48-
# If you wish to specify custom queries, you can do so here or in a config file.
49-
# By default, queries listed here will override any specified in a config file.
50-
# Prefix the list here with "+" to use these queries and those in the config file.
51-
# queries: ./path/to/local/query, your-org/your-repo/queries@main
43+
# Initializes the CodeQL tools for scanning.
44+
- name: Initialize CodeQL
45+
uses: github/codeql-action/init@v3
46+
with:
47+
languages: ${{ matrix.language }}
48+
# If you wish to specify custom queries, you can do so here or in a config file.
49+
# By default, queries listed here will override any specified in a config file.
50+
# Prefix the list here with "+" to use these queries and those in the config file.
51+
# queries: ./path/to/local/query, your-org/your-repo/queries@main
5252

53-
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
54-
# If this step fails, then you should remove it and run the build manually (see below)
55-
- name: Autobuild
56-
uses: github/codeql-action/autobuild@v3
53+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
54+
# If this step fails, then you should remove it and run the build manually (see below)
55+
- name: Autobuild
56+
uses: github/codeql-action/autobuild@v3
5757

58-
# ℹ️ Command-line programs to run using the OS shell.
59-
# 📚 https://git.io/JvXDl
58+
# ℹ️ Command-line programs to run using the OS shell.
59+
# 📚 https://git.io/JvXDl
6060

61-
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
62-
# and modify them (or add more) to build your code if your project
63-
# uses a compiled language
61+
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
62+
# and modify them (or add more) to build your code if your project
63+
# uses a compiled language
6464

65-
#- run: |
66-
# make bootstrap
67-
# make release
65+
#- run: |
66+
# make bootstrap
67+
# make release
6868

69-
- name: Perform CodeQL Analysis
70-
uses: github/codeql-action/analyze@v3
69+
- name: Perform CodeQL Analysis
70+
uses: github/codeql-action/analyze@v3

.github/workflows/coverage.yml

+13
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,19 @@ jobs:
1818
run: |
1919
python -m pip install --upgrade pip
2020
pip install tox
21+
- name: Log into registry
22+
# GHCR_PAT is a personal access token for the Github Container Registry; You can create it using the following steps:
23+
# 1) Go to https://github.com/settings/tokens
24+
# 2) Create a new token (classic as of 2025-02-02)
25+
# 3) Select the following scopes: read:packages
26+
# GHCR_USR is the username for the Github Container Registry; it has to match the PAT and is the username of the Github account that created the PAT
27+
# You can update the tokens in the repository settings:
28+
# https://github.com/Hochfrequenz/TransformerBeeClient.py/settings/secrets/actions/GHCR_PAT
29+
# https://github.com/Hochfrequenz/TransformerBeeClient.py/settings/secrets/actions/GHCR_USR
30+
# Tokens will expire 2025-02-01
31+
run: echo "${{ secrets.GHCR_PAT }}" | docker login ghcr.io -u ${{ secrets.GHCR_USR }} --password-stdin
32+
- name: Start containers
33+
run: docker-compose -f "integrationtests/docker-compose.yml" up -d
2134
- name: Run Tests and Record Coverage
2235
run: |
2336
tox -e coverage

.github/workflows/dev_test.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ name: "Test Dev Environment"
22
# Checks that the dev environment (tox -e dev) can be set up.
33
# This might not work, if different linting/testing envs refer to different versions of the same lib (e.g. typing-extensions).
44
# Different versions of the same package might work for isolated specific envs (only linting, only testing...) but the dev environment inherits from all of them.
5-
on: [ push, pull_request ]
5+
on: [push, pull_request]
66
jobs:
77
check:
88
runs-on: ${{ matrix.os }}
99
strategy:
1010
matrix:
11-
python-version: [ "3.11", "3.12" ]
12-
os: [ ubuntu-latest ]
11+
python-version: ["3.11", "3.12"]
12+
os: [ubuntu-latest]
1313
steps:
1414
- uses: actions/checkout@v4
1515
- name: Set up Python ${{ matrix.python-version }}

.github/workflows/python-publish.yml

+3-4
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@ name: Upload Python Package
99

1010
on:
1111
release:
12-
types: [ created, edited ]
12+
types: [created, edited]
1313

1414
jobs:
1515
tests:
1616
if: startsWith(github.ref, 'refs/tags/v')
1717
runs-on: ${{ matrix.os }}
1818
strategy:
1919
matrix:
20-
python-version: [ "3.12" ]
21-
os: [ ubuntu-latest ]
20+
python-version: ["3.12"]
21+
os: [ubuntu-latest]
2222
steps:
2323
- uses: actions/checkout@v4
2424
- name: Set up Python ${{ matrix.python-version }}
@@ -59,4 +59,3 @@ jobs:
5959
- name: Publish distribution 📦 to PyPI
6060
if: startsWith(github.ref, 'refs/tags/v')
6161
uses: pypa/gh-action-pypi-publish@release/v1
62-
+4-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#
2-
# This file is autogenerated by pip-compile with python 3.10
3-
# To update, run:
2+
# This file is autogenerated by pip-compile with Python 3.11
3+
# by the following command:
44
#
5-
# pip-compile requirements-coverage.in
5+
# pip-compile '.\dev_requirements\requirements-coverage.in'
66
#
77
coverage==7.4.1
8-
# via -r dev_requirements/requirements-coverage.in
8+
# via -r .\dev_requirements\requirements-coverage.in

dev_requirements/requirements-formatting.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ isort==5.13.2
1212
# via -r dev_requirements/requirements-formatting.in
1313
mypy-extensions==1.0.0
1414
# via black
15-
packaging==23.0
15+
packaging==23.2
1616
# via black
1717
pathspec==0.11.0
1818
# via black

dev_requirements/requirements-packaging.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ mdurl==0.1.2
3838
# via markdown-it-py
3939
more-itertools==9.1.0
4040
# via jaraco-classes
41-
packaging==23.1
41+
packaging==23.2
4242
# via build
4343
pkginfo==1.9.6
4444
# via twine
+2-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
# specific requirements for the tox tests env
2-
pytest
2+
pytest!=8.0.0
3+
pytest-asyncio
+10-8
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
#
2-
# This file is autogenerated by pip-compile with python 3.10
3-
# To update, run:
2+
# This file is autogenerated by pip-compile with Python 3.11
3+
# by the following command:
44
#
55
# pip-compile requirements-tests.in
66
#
7-
exceptiongroup==1.1.3
7+
colorama==0.4.6
88
# via pytest
99
iniconfig==2.0.0
1010
# via pytest
11-
packaging==23.0
11+
packaging==23.2
1212
# via pytest
1313
pluggy==1.4.0
1414
# via pytest
15-
pytest==8.0.0
16-
# via -r dev_requirements/requirements-tests.in
17-
tomli==2.0.1
18-
# via pytest
15+
pytest==7.4.4
16+
# via
17+
# -r requirements-tests.in
18+
# pytest-asyncio
19+
pytest-asyncio==0.23.3
20+
# via -r requirements-tests.in
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
# specific requirements for the tox type_check environment
22
mypy
3+
mypy[pydantic]
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
#
2-
# This file is autogenerated by pip-compile with python 3.10
3-
# To update, run:
2+
# This file is autogenerated by pip-compile with Python 3.11
3+
# by the following command:
44
#
5-
# pip-compile requirements-type_check.in
5+
# pip-compile '.\dev_requirements\requirements-type_check.in'
66
#
7-
mypy==1.8.0
8-
# via -r dev_requirements/requirements-type_check.in
7+
mypy[pydantic]==1.8.0
8+
# via -r .\dev_requirements\requirements-type_check.in
99
mypy-extensions==1.0.0
1010
# via mypy
11-
tomli==2.0.1
12-
# via mypy
1311
typing-extensions==4.9.0
1412
# via mypy
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
UNA:+,? '
2+
UNB+UNOC:3+9912345789012:500+9909876543210:500+230703:1059+ASDFHGJ'
3+
UNH+11223344556678+UTILMD:D:11A:UN:S1.1'
4+
BGM+E01+918273746512345678901'
5+
DTM+137:202306300558?+00:303'
6+
NAD+MS+9912345789012::293'
7+
NAD+MR+9909876543210::293'
8+
IDE+24+918273746512345678901'
9+
IMD++Z36+Z13'
10+
DTM+92:202212312300?+00:303'
11+
STS+7++E01'
12+
LOC+Z16+78889918283'
13+
LOC+Z17+DE0000111122223333444455556667778'
14+
RFF+Z13:55001'
15+
SEQ+Z01'
16+
CCI+Z30++Z07'
17+
CCI+Z19++11X0-0000-0116-J'
18+
CCI+++Z15'
19+
CCI+++Z88'
20+
CAV+Z74:::Z09'
21+
CAV+Z73:::Z11'
22+
SEQ+Z12'
23+
QTY+Z16:0:P1'
24+
SEQ+Z03'
25+
CCI+++E13'
26+
CAV+Z30:::788811123'
27+
SEQ+Z75'
28+
CCI+Z61++ZG1'
29+
NAD+Z09+++Schaefer:Ulrike:::Frau:Z01'
30+
NAD+Z04+++Schaefer:Ulrike:::Frau:Z01+Flughafenstrasse::64+Vilseck++92247 +DE'
31+
NAD+DP++++Flughafenstrasse::64+Vilseck++92247+DE'
32+
NAD+Z05+++Schaefer:Ulrike:::Frau:Z01+Flughafenstrasse::64+Vilseck++92247 +DE'
33+
UNT+31+11223344556678'
34+
UNZ+1+ASDFHGJ'

0 commit comments

Comments
 (0)