-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
118 changed files
with
550,574 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
## | ||
## Copyright (c) 2022-2023 Geosiris. | ||
## SPDX-License-Identifier: Apache-2.0 | ||
## | ||
--- | ||
|
||
name: Prepare Python and Poetry | ||
Description: Install Python, Poetry and dev dependencies, cached for speed | ||
|
||
inputs: | ||
python-version: | ||
description: 'Python version to use' | ||
required: true | ||
default: '3.x' | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Set up Python | ||
id: setup-python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ inputs.python-version }} | ||
|
||
- name: Load cached Poetry installation | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/.local # the path depends on the OS | ||
key: poetry-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-4 # increment to reset cache | ||
|
||
- name: Install Poetry | ||
uses: snok/install-poetry@v1 | ||
with: | ||
version: 1.5.1 | ||
virtualenvs-create: true | ||
virtualenvs-in-project: false | ||
|
||
- name: Install Poetry Plugins | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install poetry-dynamic-versioning | ||
shell: bash | ||
- name: Load cached venv | ||
id: cached-poetry-dependencies | ||
uses: actions/cache@v4 | ||
with: | ||
path: .venv | ||
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}-1 | ||
|
||
- name: Install dependencies and library | ||
# if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | ||
run: poetry install --no-interaction | ||
shell: bash | ||
|
||
- name: Install Poetry Plugins | ||
run: poetry self add "poetry-dynamic-versioning[plugin]" | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
## | ||
## Copyright (c) 2023-2024 Geosiris. | ||
## SPDX-License-Identifier: Apache-2.0 | ||
## | ||
--- | ||
|
||
name: Publish (pypiTest) | ||
|
||
defaults: | ||
run: | ||
working-directory: energyml-utils | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
jobs: | ||
build: | ||
name: Build distribution | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Install poetry | ||
uses: ./.github/actions/prepare-poetry | ||
with: | ||
python-version: 3.9 | ||
|
||
- name: Build | ||
run: | | ||
poetry build | ||
- name: Display folder | ||
shell: bash | ||
if: always() | ||
run: | | ||
echo "::debug::listing folder" | ||
ls -R | ||
echo `ls -R` | ||
echo "GITHUB_WORKSPACE ${{ github.workspace }}" | ||
echo `ls GITHUB_WORKSPACE ${{ github.workspace }}` | ||
- name: Save build artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: Build-Artifact | ||
if-no-files-found: error | ||
path: ${{ github.workspace }}/energyml-utils/dist | ||
|
||
publish: | ||
name: Publish to PyPI | ||
needs: [build] | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
# Retrieve the code and GIT history so that poetry-dynamic-versioning knows which version to upload | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Get build artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: Build-Artifact | ||
path: ${{ github.workspace }}/energyml-utils/dist | ||
|
||
- name: Install poetry | ||
uses: ./.github/actions/prepare-poetry | ||
with: | ||
python-version: 3.9 | ||
|
||
- name: Upload to PyPI TEST | ||
run: | | ||
poetry config repositories.test-pypi https://test.pypi.org/legacy/ | ||
poetry config pypi-token.test-pypi ${{ secrets.POETRY_PYPI_TEST_TOKEN_VALUE }} | ||
poetry publish --repository test-pypi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
## | ||
## Copyright (c) 2023-2024 Geosiris. | ||
## SPDX-License-Identifier: Apache-2.0 | ||
## | ||
--- | ||
|
||
name: Publish release | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
build: | ||
name: Build distribution | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Install poetry | ||
uses: ./.github/actions/prepare-poetry | ||
with: | ||
python-version: 3.9 | ||
|
||
- name: Build | ||
run: | | ||
poetry build | ||
- name: Display folder | ||
shell: bash | ||
if: always() | ||
run: | | ||
echo "::debug::listing folder" | ||
ls -R | ||
echo `ls -R` | ||
echo "GITHUB_WORKSPACE ${{ github.workspace }}" | ||
echo `ls GITHUB_WORKSPACE ${{ github.workspace }}` | ||
- name: Save build artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: Build-Artifact | ||
if-no-files-found: error | ||
path: ${{ github.workspace }}/energyml-utils/dist | ||
|
||
publish: | ||
name: Publish to PyPI | ||
needs: [build] | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
# Retrieve the code and GIT history so that poetry-dynamic-versioning knows which version to upload | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Get build artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: Build-Artifact | ||
path: ${{ github.workspace }}/energyml-utils/dist | ||
|
||
- name: Install poetry | ||
uses: ./.github/actions/prepare-poetry | ||
with: | ||
python-version: 3.9 | ||
|
||
- name: Upload to PyPI | ||
run: | | ||
poetry config pypi-token.pypi ${{ secrets.POETRY_PYPI_TOKEN_PASSWORD }} | ||
poetry publish |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# IDE settings | ||
.idea | ||
.vscode | ||
*.sublime-project | ||
*.sublime-workspace | ||
|
||
# Checkpoints | ||
.ipynb_checkpoints | ||
__pycache__/ | ||
.pyc | ||
*.pyo | ||
.DS_Store | ||
|
||
# Unit tests | ||
pytest.xml | ||
.pytest_cache | ||
.coverage | ||
htmlcov/ | ||
|
||
# Built Documentation | ||
docs/_build | ||
docs/_autosummary | ||
docs/html | ||
|
||
# Build artifacts | ||
build | ||
dist | ||
*.egg-info | ||
venv/ | ||
|
||
# Poetry | ||
*.lock | ||
*/dist/ | ||
|
||
# Dask | ||
dask-worker-space | ||
|
||
# Example for local test | ||
example-local/ | ||
# utils/ | ||
|
||
# Other files | ||
requirements.txt | ||
#doc/ | ||
sample/ | ||
gen*/ | ||
manip* | ||
zip/ | ||
*.epc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.