Skip to content

Commit

Permalink
Merge pull request #13 from SINTEF/main
Browse files Browse the repository at this point in the history
Release v0.10.6
  • Loading branch information
tibnor authored May 7, 2024
2 parents 768693f + 1fb062e commit 4c82e06
Show file tree
Hide file tree
Showing 82 changed files with 24,322 additions and 3,621 deletions.
22 changes: 22 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/python
{
"name": "Python 3",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/python:1-3.10-buster",

// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "pip3 install --user -r requirements_dev.txt"

// Configure tool-specific properties.
// "customizations": {},

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
49 changes: 49 additions & 0 deletions .github/workflows/publish_MachSysS.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Publish Python 🐍 distribution 📦 to PyPI for FEEMS

on:
pull_request:
branches: ["release"]

jobs:
build:
name: Build distribution 📦
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build --user
- name: Build package
run: |
cd machinery-system-structure
python -m build
- name: Store the distribution packages 📦
uses: actions/upload-artifact@v3
with:
name: python-package-distributions-MachSysS
path: machinery-system-structure/dist/

publish-to-pypi:
name: >-
Publish Python 🐍 distribution 📦 to PyPI
needs:
- build
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/MachSysS
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v3
with:
name: python-package-distributions-MachSysS
path: dist/
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
49 changes: 49 additions & 0 deletions .github/workflows/publish_RunFeemsSim.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Publish Python 🐍 distribution 📦 to PyPI for FEEMS

on:
pull_request:
branches: ["release"]

jobs:
build:
name: Build distribution 📦
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build --user
- name: Build package
run: |
cd RunFEEMSSim
python -m build
- name: Store the distribution packages 📦
uses: actions/upload-artifact@v3
with:
name: python-package-distributions-RunFeemsSim
path: RunFEEMSSim/dist/

publish-to-pypi:
name: >-
Publish Python 🐍 distribution 📦 to PyPI
needs:
- build
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/RunFeemsSim
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v3
with:
name: python-package-distributions-RunFeemsSim
path: dist/
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
49 changes: 49 additions & 0 deletions .github/workflows/publish_feems.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Publish Python 🐍 distribution 📦 to PyPI for FEEMS

on:
pull_request:
branches: ["release"]

jobs:
build:
name: Build distribution 📦
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry --user
- name: Build package
run: |
cd feems
poetry build
- name: Store the distribution packages 📦
uses: actions/upload-artifact@v3
with:
name: python-package-distributions-feems
path: feems/dist/

publish-to-pypi:
name: >-
Publish Python 🐍 distribution 📦 to PyPI
needs:
- build
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/feems
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v3
with:
name: python-package-distributions-feems
path: dist/
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
69 changes: 0 additions & 69 deletions .github/workflows/release-please.yml

This file was deleted.

53 changes: 53 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: Python package

on:
push:
branches: ["*"]
pull_request:
branches: ["*"]

jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12"]
project:
- feems
- machinery-system-structure
- RunFEEMSSim

steps:
- name: Checkout repository
uses: actions/checkout@v3

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

- name: Cache dependencies
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip setuptools
pip install -r requirements_dev.txt
- name: Test with pytest if the project is feems else test with nbdev
run: |
cd ${{ matrix.project }}
if [ "${{ matrix.project }}" = "feems" ]; then
pytest
else
nbdev_test --do_print
fi
12 changes: 12 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"python.testing.unittestArgs": [
"-v",
"-s",
"./feems",
"-p",
"test*.py"
],
"python.testing.pytestEnabled": false,
"python.testing.unittestEnabled": true,
"python.testing.pytestArgs": ["feems"]
}
Loading

0 comments on commit 4c82e06

Please sign in to comment.