Skip to content

Commit

Permalink
Merge pull request #44 from e2nIEE/release/v1.5.0
Browse files Browse the repository at this point in the history
Release/v1.5.0
  • Loading branch information
SteffenMeinecke authored Apr 8, 2024
2 parents 4dc4352 + 5b7c219 commit 9cc5be8
Show file tree
Hide file tree
Showing 31 changed files with 656 additions and 486 deletions.
103 changes: 90 additions & 13 deletions .github/workflows/github_test_action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,40 +14,117 @@ on:
- 'CHANGELOG.rst'

jobs:
build:

build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']

python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v2
#- uses: julia-actions/setup-julia@v1.5
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install pytest
pip install -r requirements.txt
pip install .["all"]
python -m pip install pytest jupyter
python -m pip install $GITHUB_WORKSPACE["test"]
- name: List of installed packages
run: |
pip list
python -m pip list
- name: Test with pytest
if: ${{ matrix.python-version != '3.8' }}
if: ${{ matrix.python-version != '3.9' }}
run: |
pytest
- name: Test with pytest and Codecov
if: ${{ matrix.python-version == '3.8' }}
if: ${{ matrix.python-version == '3.9' }}
run: |
pip install pytest-cov
pytest --cov=./ --cov-report=xml
- name: Upload coverage to Codecov
if: ${{ matrix.python-version == '3.8' }}
if: ${{ matrix.python-version == '3.9' }}
uses: codecov/codecov-action@v1
with:
verbose: true

warnings:

runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install $GITHUB_WORKSPACE["test"]
- name: List of installed packages
run: |
python -m pip list
- name: Test with pytest
run: |
pytest -W error
tutorial_tests:

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install $GITHUB_WORKSPACE["all"]
- name: List of installed packages
run: |
python -m pip list
- name: Test with pytest
run: |
PYTHONPATH=$PYTHONPATH:$GITHUB_WORKSPACE python -m pytest --nbmake -n=auto --nbmake-timeout=900 "./tutorials"
tutorial_warnings_tests:

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install $GITHUB_WORKSPACE["all"]
- name: List of installed packages
run: |
python -m pip list
- name: Test with pytest
run: |
PYTHONPATH=$PYTHONPATH:$GITHUB_WORKSPACE python -m pytest -W error --nbmake -n=auto --nbmake-timeout=900 "./tutorials"
docs_check:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ '3.9' ]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Check docs for Python ${{ matrix.python-version }}
uses: e2nIEE/sphinx-action@master
with:
pre-build-command: "python -m pip install --upgrade pip;
python -m pip install .[docs];"
build-command: "sphinx-build -b html . _build -W"
docs-folder: "doc/"
112 changes: 0 additions & 112 deletions .github/workflows/release.yml

This file was deleted.

58 changes: 58 additions & 0 deletions .github/workflows/test_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# This workflow will create a Python package and upload it to testPyPi or PyPi
# Then, it installs simbench from there and all dependencies and runs tests with different Python versions

name: test

# Controls when the action will run.
on:
# Allows you to run this workflow manually from the Actions tab
push:
branches:
- release/*

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:

build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
os: [ ubuntu-latest, windows-latest ]

steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install simbench & dependencies
run: |
python -m pip install --upgrade pip
python -m pip install pytest-split matplotlib geopandas
python -m pip install .["all"]
- name: Install specific dependencies (Windows)
if: matrix.os == 'windows-latest'
run: |
if ( '${{ matrix.python-version }}' -eq '3.9' ) { python -m pip install pypower }
if ( '${{ matrix.python-version }}' -ne '3.9' ) { python -m pip install numba }
if ( '${{ matrix.python-version }}' -eq '3.8' -or '${{ matrix.python-version }}' -eq '3.10' ) { python -m pip install lightsim2grid }
- name: Install specific dependencies (Ubuntu)
if: matrix.os == 'ubuntu-latest'
run: |
if ${{ matrix.python-version == '3.9' }}; then python -m pip install pypower; fi
if ${{ matrix.python-version != '3.9' }}; then python -m pip install numba; fi
if ${{ matrix.python-version == '3.8' || matrix.python-version == '3.10' }}; then python -m pip install lightsim2grid; fi
- name: List all installed packages
run: |
python -m pip list
- name: Test with pytest
run: |
python -m pytest --pyargs simbench.test
53 changes: 53 additions & 0 deletions .github/workflows/upload_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# This workflow will create a Python package and upload it to testPyPi or PyPi
# Then, it installs simbench from there and all dependencies and runs tests with different Python versions

name: upload

# Controls when the action will run.
on:
# Allows you to run this workflow manually from the Actions tab
push:
tags:
- 'v*'
branches:
- master

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:

upload:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4

# Sets up python3
- uses: actions/setup-python@v5
with:
python-version: '3.10'
# Installs and upgrades pip, installs other dependencies and installs the package from setup.py
- name: Install dependencies
run: |
# Upgrade pip
python3 -m pip install --upgrade pip
# Install twine
python3 -m pip install setuptools wheel twine
# Upload to PyPI
- name: Build and Upload to PyPI
run: |
python3 setup.py sdist --formats=zip
twine check dist/* --strict
python3 -m twine upload dist/*
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI }}
TWINE_REPOSITORY: pypi

- name: Sleep for 150s to make release available
uses: juliangruber/sleep-action@v2
with:
time: 300s
8 changes: 7 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Change Log
=============

[1.5.0] - 2024-04-08
----------------------
- [CHANGED] apply FutureWarnings of pandas 2.2
- [CHANGED] increase visibility of collect_all_simbench_codes()
- [CHANGED] setup.py -> pyproject.toml

[1.4.0] - 2023-05-12
----------------------
- [CHANGED] pandas 2.0 support
Expand All @@ -11,7 +17,7 @@ Change Log
----------------------

- [CHANGED] use GitHub-Ci instead of Travis-CI and update CI to python 3.8 and 3.9
- [CHANGED] adapt to pandas changes of version 1.2.0: deprecate |&^ as set operations for Index
- [CHANGED] adapt to pandas changes of version 1.2.0: deprecate set operations for pandas Index
- [CHANGED] generalize (elm, col) recognizing in profiles dicts
- [CHANGED] output type of get_applied_profiles() and get_available_profiles() from list to set
- [ADDED] filter_unapplied_profiles_pp(), get_unused_profiles()
Expand Down
2 changes: 0 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
:target: https://www.simbench.net
:alt: SimBench logo

|
.. image:: https://badge.fury.io/py/simbench.svg
:target: https://pypi.python.org/pypi/simbench
:alt: PyPI
Expand Down
Loading

0 comments on commit 9cc5be8

Please sign in to comment.