Skip to content

Commit 32b962c

Browse files
All projects starts (#1)
first version
1 parent ee692be commit 32b962c

118 files changed

Lines changed: 550574 additions & 1 deletion

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
##
2+
## Copyright (c) 2022-2023 Geosiris.
3+
## SPDX-License-Identifier: Apache-2.0
4+
##
5+
---
6+
7+
name: Prepare Python and Poetry
8+
Description: Install Python, Poetry and dev dependencies, cached for speed
9+
10+
inputs:
11+
python-version:
12+
description: 'Python version to use'
13+
required: true
14+
default: '3.x'
15+
16+
runs:
17+
using: "composite"
18+
steps:
19+
- name: Set up Python
20+
id: setup-python
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version: ${{ inputs.python-version }}
24+
25+
- name: Load cached Poetry installation
26+
uses: actions/cache@v4
27+
with:
28+
path: ~/.local # the path depends on the OS
29+
key: poetry-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-4 # increment to reset cache
30+
31+
- name: Install Poetry
32+
uses: snok/install-poetry@v1
33+
with:
34+
version: 1.5.1
35+
virtualenvs-create: true
36+
virtualenvs-in-project: false
37+
38+
- name: Install Poetry Plugins
39+
run: |
40+
python -m pip install --upgrade pip
41+
pip install poetry-dynamic-versioning
42+
shell: bash
43+
- name: Load cached venv
44+
id: cached-poetry-dependencies
45+
uses: actions/cache@v4
46+
with:
47+
path: .venv
48+
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}-1
49+
50+
- name: Install dependencies and library
51+
# if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
52+
run: poetry install --no-interaction
53+
shell: bash
54+
55+
- name: Install Poetry Plugins
56+
run: poetry self add "poetry-dynamic-versioning[plugin]"
57+
shell: bash
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
##
2+
## Copyright (c) 2023-2024 Geosiris.
3+
## SPDX-License-Identifier: Apache-2.0
4+
##
5+
---
6+
7+
name: Publish (pypiTest)
8+
9+
defaults:
10+
run:
11+
working-directory: energyml-utils
12+
13+
on:
14+
push:
15+
branches:
16+
- main
17+
pull_request:
18+
19+
jobs:
20+
build:
21+
name: Build distribution
22+
runs-on: ubuntu-latest
23+
steps:
24+
25+
- name: Checkout code
26+
uses: actions/checkout@v4
27+
with:
28+
fetch-depth: 0
29+
30+
- name: Install poetry
31+
uses: ./.github/actions/prepare-poetry
32+
with:
33+
python-version: 3.9
34+
35+
- name: Build
36+
run: |
37+
poetry build
38+
39+
- name: Display folder
40+
shell: bash
41+
if: always()
42+
run: |
43+
echo "::debug::listing folder"
44+
ls -R
45+
echo `ls -R`
46+
echo "GITHUB_WORKSPACE ${{ github.workspace }}"
47+
echo `ls GITHUB_WORKSPACE ${{ github.workspace }}`
48+
49+
- name: Save build artifacts
50+
uses: actions/upload-artifact@v4
51+
with:
52+
name: Build-Artifact
53+
if-no-files-found: error
54+
path: ${{ github.workspace }}/energyml-utils/dist
55+
56+
publish:
57+
name: Publish to PyPI
58+
needs: [build]
59+
runs-on: ubuntu-latest
60+
steps:
61+
62+
# Retrieve the code and GIT history so that poetry-dynamic-versioning knows which version to upload
63+
- name: Checkout code
64+
uses: actions/checkout@v4
65+
with:
66+
fetch-depth: 0
67+
68+
- name: Get build artifacts
69+
uses: actions/download-artifact@v4
70+
with:
71+
name: Build-Artifact
72+
path: ${{ github.workspace }}/energyml-utils/dist
73+
74+
- name: Install poetry
75+
uses: ./.github/actions/prepare-poetry
76+
with:
77+
python-version: 3.9
78+
79+
- name: Upload to PyPI TEST
80+
run: |
81+
poetry config repositories.test-pypi https://test.pypi.org/legacy/
82+
poetry config pypi-token.test-pypi ${{ secrets.POETRY_PYPI_TEST_TOKEN_VALUE }}
83+
poetry publish --repository test-pypi
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
##
2+
## Copyright (c) 2023-2024 Geosiris.
3+
## SPDX-License-Identifier: Apache-2.0
4+
##
5+
---
6+
7+
name: Publish release
8+
9+
on:
10+
release:
11+
types: [published]
12+
13+
jobs:
14+
build:
15+
name: Build distribution
16+
runs-on: ubuntu-latest
17+
steps:
18+
19+
- name: Checkout code
20+
uses: actions/checkout@v4
21+
with:
22+
fetch-depth: 0
23+
24+
- name: Install poetry
25+
uses: ./.github/actions/prepare-poetry
26+
with:
27+
python-version: 3.9
28+
29+
- name: Build
30+
run: |
31+
poetry build
32+
33+
- name: Display folder
34+
shell: bash
35+
if: always()
36+
run: |
37+
echo "::debug::listing folder"
38+
ls -R
39+
echo `ls -R`
40+
echo "GITHUB_WORKSPACE ${{ github.workspace }}"
41+
echo `ls GITHUB_WORKSPACE ${{ github.workspace }}`
42+
43+
- name: Save build artifacts
44+
uses: actions/upload-artifact@v4
45+
with:
46+
name: Build-Artifact
47+
if-no-files-found: error
48+
path: ${{ github.workspace }}/energyml-utils/dist
49+
50+
publish:
51+
name: Publish to PyPI
52+
needs: [build]
53+
runs-on: ubuntu-latest
54+
steps:
55+
56+
# Retrieve the code and GIT history so that poetry-dynamic-versioning knows which version to upload
57+
- name: Checkout code
58+
uses: actions/checkout@v4
59+
with:
60+
fetch-depth: 0
61+
62+
- name: Get build artifacts
63+
uses: actions/download-artifact@v4
64+
with:
65+
name: Build-Artifact
66+
path: ${{ github.workspace }}/energyml-utils/dist
67+
68+
- name: Install poetry
69+
uses: ./.github/actions/prepare-poetry
70+
with:
71+
python-version: 3.9
72+
73+
- name: Upload to PyPI
74+
run: |
75+
poetry config pypi-token.pypi ${{ secrets.POETRY_PYPI_TOKEN_PASSWORD }}
76+
poetry publish

.gitignore

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# IDE settings
2+
.idea
3+
.vscode
4+
*.sublime-project
5+
*.sublime-workspace
6+
7+
# Checkpoints
8+
.ipynb_checkpoints
9+
__pycache__/
10+
.pyc
11+
*.pyo
12+
.DS_Store
13+
14+
# Unit tests
15+
pytest.xml
16+
.pytest_cache
17+
.coverage
18+
htmlcov/
19+
20+
# Built Documentation
21+
docs/_build
22+
docs/_autosummary
23+
docs/html
24+
25+
# Build artifacts
26+
build
27+
dist
28+
*.egg-info
29+
venv/
30+
31+
# Poetry
32+
*.lock
33+
*/dist/
34+
35+
# Dask
36+
dask-worker-space
37+
38+
# Example for local test
39+
example-local/
40+
# utils/
41+
42+
# Other files
43+
requirements.txt
44+
#doc/
45+
sample/
46+
gen*/
47+
manip*
48+
zip/
49+
*.epc

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 2023 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.

0 commit comments

Comments
 (0)