Skip to content

Commit 6a6b0a9

Browse files
Ci (#1)
ci
1 parent b7633cd commit 6a6b0a9

6 files changed

Lines changed: 347 additions & 1 deletion

File tree

.github/workflows/pypi-test.yml

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
name: Build-and-Push-TEST
2+
3+
on: [push,pull_request]
4+
5+
jobs:
6+
generate:
7+
name: Generate etptypes code
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- uses: actions/checkout@v3
12+
13+
- name: Set up Python ${{ matrix.python-version }}
14+
uses: actions/setup-python@v4
15+
with:
16+
python-version: 3.9
17+
18+
- name: Download ETP file
19+
run : wget http://geosiris.com/wp-content/uploads/2022/09/etp/${{ secrets.ETP_FILE_NAME}} -P ${{ github.workspace }}
20+
21+
- name: Install dependencies
22+
run: |
23+
python -m pip install --upgrade pip
24+
pip install pydantic typingx avro-to-python-etp
25+
26+
- name: Translate avpr to avsc
27+
run: |
28+
avpr-to-avsc ${{ secrets.ETP_FILE_NAME}}
29+
30+
- name: Generate classes
31+
run: |
32+
avro-to-python-etp output/Energistics tmp --pip etptypes --package_version ${{ secrets.PACKAGE_VERSION }}
33+
34+
- name: Archive production artifacts
35+
uses: actions/upload-artifact@v3
36+
with:
37+
name: etptypes-generated-artifact
38+
retention-days: 1
39+
path: |
40+
${{ github.workspace }}/tmp/etptypes/*
41+
42+
build:
43+
needs: generate
44+
45+
name: Building generated code
46+
runs-on: ubuntu-latest
47+
48+
steps:
49+
- uses: actions/checkout@v3
50+
51+
- name: Set up Python ${{ matrix.python-version }}
52+
uses: actions/setup-python@v4
53+
with:
54+
python-version: 3.9
55+
56+
- name: Get build artifacts
57+
uses: actions/download-artifact@v3
58+
with:
59+
name: etptypes-generated-artifact
60+
path: etptypes/
61+
62+
- name: Installation
63+
run: |
64+
python -m pip install --upgrade pip
65+
pip install poetry
66+
pip install poetry-dynamic-versioning
67+
pip install black
68+
69+
- name: Python Black
70+
run: |
71+
cd ${{ github.workspace }}/etptypes
72+
black -t py39 etptypes
73+
74+
- name: Build Etptypes-python
75+
run: |
76+
cd etptypes
77+
rm pyproject.toml
78+
cp ${{ github.workspace }}/pyproject.toml .
79+
cp ${{ github.workspace }}/LICENSE .
80+
cp ${{ github.workspace }}/README.md .
81+
poetry build
82+
83+
- name: Archive production artifacts
84+
uses: actions/upload-artifact@v3
85+
with:
86+
name: dist-artifact
87+
retention-days: 1
88+
path: |
89+
${{ github.workspace }}/etptypes/dist
90+
${{ github.workspace }}/etptypes/pyproject.toml
91+
${{ github.workspace }}/etptypes/LICENSE
92+
${{ github.workspace }}/etptypes/README.md
93+
94+
publish:
95+
needs: build
96+
97+
name: Publish to PyPI-test
98+
runs-on: ubuntu-latest
99+
100+
steps:
101+
- uses: actions/checkout@v3
102+
103+
- name: Set up Python ${{ matrix.python-version }}
104+
uses: actions/setup-python@v4
105+
with:
106+
python-version: 3.9
107+
108+
- name: Get build artifacts
109+
uses: actions/download-artifact@v3
110+
with:
111+
name: dist-artifact
112+
path: etptypes/
113+
114+
- name: Install Poetry
115+
run: |
116+
ls etptypes
117+
python -m pip install --upgrade pip
118+
pip install poetry
119+
pip install poetry-dynamic-versioning
120+
121+
- name: Upload to PyPI TEST
122+
run: |
123+
cd etptypes
124+
poetry config repositories.test https://test.pypi.org/legacy/
125+
poetry config http-basic.test ${{ secrets.POETRY_PYPI_TOKEN_USERNAME}} ${{ secrets.POETRY_TEST_PYPI_TOKEN_PASSWORD}}
126+
poetry publish --repository test

.github/workflows/release.yml

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
name: Build-and-Push
2+
3+
on:
4+
push:
5+
tags:
6+
# Run when a tag is pushed with a valid semantic version number
7+
- 'v[0-9]+.[0-9]+.[0-9]+'
8+
9+
jobs:
10+
generate:
11+
name: Generate etptypes code
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v3
16+
17+
- name: Set up Python ${{ matrix.python-version }}
18+
uses: actions/setup-python@v4
19+
with:
20+
python-version: 3.9
21+
22+
- name: Download ETP file
23+
run : wget http://geosiris.com/wp-content/uploads/2022/09/etp/${{ secrets.ETP_FILE_NAME}} -P ${{ github.workspace }}
24+
25+
- name: Install dependencies
26+
run: |
27+
python -m pip install --upgrade pip
28+
pip install pydantic typingx avro-to-python-etp
29+
30+
- name: Translate avpr to avsc
31+
run: |
32+
avpr-to-avsc ${{ secrets.ETP_FILE_NAME}}
33+
34+
- name: Generate classes
35+
run: |
36+
avro-to-python-etp output/Energistics tmp --pip etptypes --package_version ${{ secrets.PACKAGE_VERSION }}
37+
38+
- name: Archive production artifacts
39+
uses: actions/upload-artifact@v3
40+
with:
41+
name: etptypes-generated-artifact
42+
retention-days: 1
43+
path: |
44+
${{ github.workspace }}/tmp/etptypes/*
45+
46+
build:
47+
needs: generate
48+
49+
name: Building generated code
50+
runs-on: ubuntu-latest
51+
52+
steps:
53+
- uses: actions/checkout@v3
54+
55+
- name: Set up Python ${{ matrix.python-version }}
56+
uses: actions/setup-python@v4
57+
with:
58+
python-version: 3.9
59+
60+
- name: Get build artifacts
61+
uses: actions/download-artifact@v3
62+
with:
63+
name: etptypes-generated-artifact
64+
path: etptypes/
65+
66+
- name: Installation
67+
run: |
68+
python -m pip install --upgrade pip
69+
pip install poetry
70+
pip install poetry-dynamic-versioning
71+
pip install black
72+
73+
- name: Python Black
74+
run: |
75+
cd ${{ github.workspace }}/etptypes
76+
black -t py39 etptypes
77+
78+
- name: Build Etptypes-python
79+
run: |
80+
cd etptypes
81+
rm pyproject.toml
82+
cp ${{ github.workspace }}/pyproject.toml .
83+
cp ${{ github.workspace }}/LICENSE .
84+
cp ${{ github.workspace }}/README.md .
85+
poetry build
86+
87+
- name: Archive production artifacts
88+
uses: actions/upload-artifact@v3
89+
with:
90+
name: dist-artifact
91+
retention-days: 1
92+
path: |
93+
${{ github.workspace }}/etptypes/dist
94+
${{ github.workspace }}/etptypes/pyproject.toml
95+
${{ github.workspace }}/etptypes/LICENSE
96+
${{ github.workspace }}/etptypes/README.md
97+
98+
publish:
99+
needs: build
100+
101+
name: Publish to PyPI
102+
runs-on: ubuntu-latest
103+
104+
steps:
105+
- uses: actions/checkout@v3
106+
107+
- name: Set up Python ${{ matrix.python-version }}
108+
uses: actions/setup-python@v4
109+
with:
110+
python-version: 3.9
111+
112+
- name: Get build artifacts
113+
uses: actions/download-artifact@v3
114+
with:
115+
name: dist-artifact
116+
path: etptypes/
117+
118+
- name: Install Poetry
119+
run: |
120+
python -m pip install --upgrade pip
121+
pip install poetry
122+
pip install poetry-dynamic-versioning
123+
124+
- name: Upload to PyPI
125+
run: |
126+
cd etptypes
127+
poetry publish --username ${{ secrets.POETRY_PYPI_TOKEN_USERNAME}} --password ${{ secrets.POETRY_PYPI_TOKEN_PASSWORD}}

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
dist/
2+
*.sublime*
3+
*.lock
4+
5+
output/
6+
dist/
7+
tmp/

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186
same "printed page" as the copyright notice for easier
187187
identification within third-party archives.
188188

189-
Copyright [yyyy] [name of copyright owner]
189+
Copyright 2020 GEOSIRIS
190190

191191
Licensed under the Apache License, Version 2.0 (the "License");
192192
you may not use this file except in compliance with the License.

README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Etptypes
2+
3+
[![License](https://img.shields.io/pypi/l/etptypes)](https://github.com/geosiris-technologies/etptypes-python/blob/main/LICENSE)
4+
![Python version](https://img.shields.io/pypi/pyversions/etptypes)
5+
[![PyPI](https://img.shields.io/pypi/v/etptypes)](https://badge.fury.io/py/etptypes)
6+
7+
8+
## Introduction
9+
10+
ETP python dev kit
11+
12+
## Requirements
13+
14+
- python ^3.8
15+
- pydantic ~1
16+
- typingx ^0.6.0
17+
18+
## Version History
19+
20+
- 1.0.1:
21+
- Initial Release
22+
- 1.0.2:
23+
- Bug fix for ETP array deserialisation
24+
25+
## License
26+
27+
This project is licensed under the Apache 2.0 License - see the `LICENSE` file for details
28+
29+
## Support
30+
31+
Please enter an issue in the repo for any questions or problems.

pyproject.toml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
[tool.poetry]
2+
name = "etptypes"
3+
version = "0.0.0"
4+
description = "ETP python dev kit"
5+
authors = [
6+
"Lionel Untereiner <lionel.untereiner@geosiris.com>",
7+
"Valentin Gauthier <valentin.gauthier@geosiris.com>"
8+
]
9+
license = "Apache-2.0"
10+
readme = "README.md"
11+
repository = "https://github.com/geosiris-technologies/etptypes-python"
12+
homepage = "http://www.geosiris.com"
13+
classifiers = [
14+
"Intended Audience :: Information Technology",
15+
"Intended Audience :: System Administrators",
16+
"Operating System :: OS Independent",
17+
"Programming Language :: Python :: 3",
18+
"Programming Language :: Python",
19+
"Topic :: Internet",
20+
"Topic :: Software Development :: Libraries :: Application Frameworks",
21+
"Topic :: Software Development :: Libraries :: Python Modules",
22+
"Topic :: Software Development :: Libraries",
23+
"Topic :: Software Development",
24+
"Typing :: Typed",
25+
"Development Status :: 4 - Beta",
26+
"Environment :: Web Environment",
27+
"Intended Audience :: Developers",
28+
"License :: OSI Approved :: Apache Software License",
29+
"Programming Language :: Python :: 3 :: Only",
30+
"Programming Language :: Python :: 3.7",
31+
"Programming Language :: Python :: 3.8",
32+
"Programming Language :: Python :: 3.9",
33+
"Programming Language :: Python :: 3.10",
34+
"Topic :: Internet :: WWW/HTTP",
35+
]
36+
keywords = ["ETP"]
37+
38+
[tool.poetry.dependencies]
39+
python = "^3.8"
40+
pydantic = "~1"
41+
typingx = "^0.6.0"
42+
43+
[tool.poetry-dynamic-versioning]
44+
enable = true
45+
vcs = "git"
46+
style = "pep440"
47+
format-jinja = """
48+
{%- if distance == 0 -%}
49+
{{ serialize_pep440(base, stage, revision) }}
50+
{%- elif revision is not none -%}
51+
{{ serialize_pep440(base, stage, revision + 1, dev=distance) }}
52+
{%- else -%}
53+
{{ serialize_pep440(bump_version(base), stage, revision, dev=distance) }}
54+
{%- endif -%}
55+
"""

0 commit comments

Comments
 (0)