Skip to content

Commit

Permalink
Merge branch 'release/v0.0.8-alpha1'
Browse files Browse the repository at this point in the history
  • Loading branch information
jh-RLI committed Oct 20, 2022
2 parents 45366d3 + 419ee61 commit 11db494
Show file tree
Hide file tree
Showing 30 changed files with 1,983 additions and 284 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/automated-testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Automated Test

# We run this automated testing job on every commit on master and develop and for every pull request.
on:
push:
branches:
- master
- develop
pull_request:

jobs:
run-tests:
runs-on: ubuntu-latest

strategy:
matrix:
python: ["3.10"]

steps:
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Install tox and any other packages
run: pip install tox
- name: Run tox
# Run tox using the version of Python in `PATH`
run: tox -v
36 changes: 36 additions & 0 deletions .github/workflows/pypi-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Build 📦 and release on pypi

on:
release:
types: [published]

jobs:
build-n-publish:
name: Build and publish Python 🐍 distributions 📦 to PyPI
runs-on: ubuntu-latest
environment: pypi-publish
steps:
- uses: actions/checkout@master
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"

- name: Install pypa/build
run: >-
python -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
- name: Publish distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI }}
38 changes: 38 additions & 0 deletions .github/workflows/test-pypi-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Build and release on pypi tests

on:
push:
branches:
- test-release
- 'release/*'

jobs:
build-n-publish:
name: Build and publish Python 🐍 distributions 📦 to TestPyPI
runs-on: ubuntu-latest
environment: pypi-publish
steps:
- uses: actions/checkout@master
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"

- name: Install pypa/build
run: >-
python -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
- name: Publish distribution 📦 to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_TEST }}
repository_url: https://test.pypi.org/legacy/
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ lib
lib64
venv*/
pyvenv*/
/0_env
/1_env

# Installer logs
pip-log.txt
Expand All @@ -34,6 +36,10 @@ nosetests.xml
coverage.xml
htmlcov

# Test results and reports
/1_test_results
/0_local_test

# Translations
*.mo

Expand All @@ -44,6 +50,7 @@ htmlcov
.idea
*.iml
*.komodoproject
.vscode

# Complexity
output/*.html
Expand Down
1 change: 1 addition & 0 deletions AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ Authors
=======

* Martin Glauer - openenergy-platform.org
* Jonas Huber - openenergy-platform.org
12 changes: 12 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@
Changelog
=========

current (2022-XX-XX)
--------------------

* Add conversion to translate oemetadata from v1.4 to v1.5
* Add conversion option to OMIs CLI application
* Add conversion additional script that converts oemetadata from v1.4 to v1.5 without using OMI. thanks to @chrwm

* Fix oeo related isAbout and valueReference field names (PR#65)
* Introduce github actions: Add automation worfklows for pypi publish for test and official (PR#67)
* Introduce new directory and provide some use cases and example implementation for omi usage and improve general code quality (PR#61)
* Reintroduce automated testing (CI) that icludes omi unit test (parser, compiler) and more (PR#69)

0.0.7 (2022-06-02)
------------------

Expand Down
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ graft docs
graft src
graft ci
graft tests
graft examples
graft scripts

include .bumpversion.cfg
include .coveragerc
Expand Down
25 changes: 22 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,20 @@ https://omi.readthedocs.io/
Usage
=====

**Parse, Compile, Render, Convert and Validate**
Omi can read(parse), compile, Render(json compilant), convert(convert metadata from v1.4 to v1.5 structure) and validate - a json
file or object that is compliant with the oemetadata spec. This is usefull to do various operations that help to integrate with - as
well as in interact with the oemetadata. Some parts of this tool might still be volatile but the code quality is conventionsly improved
as this module is a core component of the oeplatfroms metadata integration system.

Check if omi is able to read a oemetadata file (for version 1.4 and 1.5)
CLI - oemetadata version 1.5::

omi translate -f oep-v1.5
omi translate -f oep-v1.5 examples/data/metadata_v15.json

CLI - oemetadata version 1.4::

omi translate -f oep-v1.4 -t oep-v1.4
omi translate -f oep-v1.4 -t oep-v1.4 examples/data/metadata_v14.json

omi is able to read a JSON file and parse it into one of the internal Python structures (depending on the oemetadata version).
The OEPMetadata Python object can then be compiled and converted back to JSON. You can manipulate a successfully parsed
Expand All @@ -100,10 +107,22 @@ Module usage::
dialect1_5 = OEP_V_1_5_Dialect()
parsed = dialect1_5.parse(input)
print(parsed)
parsed.identifier = "anotehr_unique_id"
parsed.identifier = "another_unique_id"
compiled = dialect1_5.compile(parsed)
print(compiled)


**Conversion**

To ease the conversion of oemetadata from the outdated version 1.4 to the latest version, we provide
conversion functionality. The following example shows how to convert the oemetadata from v1.4 to v1.5
by using a CLI command.

CLI - oemetadata conversion from v1.4 to v1.5::

omi convert -i {input/path} -o {output/path}


Development
===========

Expand Down
Loading

0 comments on commit 11db494

Please sign in to comment.