Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update project structure #85

Merged
merged 39 commits into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
a2cff02
updated to habapp dev
nobbi1991 Sep 24, 2024
890a0f8
added python 3.12 to tests
nobbi1991 Sep 24, 2024
323ccd0
fixed nox
nobbi1991 Sep 24, 2024
2d741ac
switch docker to py3.12
nobbi1991 Sep 26, 2024
b77ad65
fixed unittests
nobbi1991 Sep 26, 2024
1d0ed9d
updated to latest dev HABApp + py3.13
nobbi1991 Nov 16, 2024
26088ac
Merge remote-tracking branch 'refs/remotes/origin/main' into test_hab…
nobbi1991 Nov 16, 2024
e369fab
updated to latest dev HABApp + py3.13
nobbi1991 Nov 16, 2024
da8477e
changelog
nobbi1991 Nov 16, 2024
6e8c8c8
bumped nose_helper to 1.7.0
nobbi1991 Nov 16, 2024
18b5687
started with hatch and pre-commit
nobbi1991 Nov 16, 2024
f23a26b
ups
nobbi1991 Nov 16, 2024
02eb112
fixed ruff
nobbi1991 Nov 16, 2024
dec2018
removed coveragerc
nobbi1991 Nov 17, 2024
c267cb4
ruff format
nobbi1991 Nov 18, 2024
464f30e
fixed ruff + unittests
nobbi1991 Nov 20, 2024
66f64e7
ruff format
nobbi1991 Nov 20, 2024
2b850b0
refactored state charts
nobbi1991 Nov 20, 2024
b43e2fa
ruff format
nobbi1991 Nov 20, 2024
2e1af0c
added github action for tests
nobbi1991 Nov 21, 2024
80a3537
added fail-fast: false
nobbi1991 Nov 21, 2024
9f2f501
ruff format
nobbi1991 Nov 21, 2024
5ee2e3d
fixed py3.10
nobbi1991 Nov 21, 2024
0037970
some fixes
nobbi1991 Nov 21, 2024
1c33b71
fixes for py3.10
nobbi1991 Nov 21, 2024
14d82b9
updated actions to latest version
nobbi1991 Nov 21, 2024
074c4d5
added unit-tests to workflow
nobbi1991 Nov 21, 2024
9d11a27
added coverage artifact
nobbi1991 Nov 21, 2024
1895582
always upload coverage report
nobbi1991 Nov 21, 2024
000ad51
py3.10 support
nobbi1991 Nov 21, 2024
d646139
removed untested function
nobbi1991 Nov 21, 2024
1806e0e
updated versions of docker build
nobbi1991 Nov 21, 2024
6d3217e
updated versions of docker build 2
nobbi1991 Nov 21, 2024
eaa610c
added environment for publish actions
nobbi1991 Nov 21, 2024
a755db7
docstrings
nobbi1991 Nov 21, 2024
43454bf
more ruff
nobbi1991 Nov 21, 2024
ac59ef1
prepare release
nobbi1991 Nov 22, 2024
c301bfb
format
nobbi1991 Nov 22, 2024
ab65dfe
added version_check
nobbi1991 Nov 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 30 additions & 29 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,39 @@ name: Create Docker Image

on:
release:
types: [published]
types: [published]
workflow_dispatch:

jobs:
buildx:
runs-on: ubuntu-latest
environment: dockerhub
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: main
- name: Get latest release
id: latest_version
uses: abatilo/[email protected].1
with:
owner: nobbi1991
repo: HABAppRules
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
push: true
tags: |
${{ secrets.DOCKER_HUB_USERNAME }}/habapp_rules:latest
${{ secrets.DOCKER_HUB_USERNAME }}/habapp_rules:${{ steps.latest_version.outputs.latest_tag }}
- name: Checkout
uses: actions/checkout@v4
with:
ref: main

- name: Get latest release
id: latest_version
uses: abatilo/[email protected].3
with:
owner: nobbi1991
repo: HABAppRules

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
push: true
tags: |
${{ secrets.DOCKER_HUB_USERNAME }}/habapp_rules:latest
${{ secrets.DOCKER_HUB_USERNAME }}/habapp_rules:${{ steps.latest_version.outputs.latest_tag }}
45 changes: 22 additions & 23 deletions .github/workflows/publish_pypi.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,31 @@
name: Publish Python distributions to PyPI
name: Publish Python Package

on:
release:
types: [published]
workflow_dispatch:

jobs:
build-n-publish:
name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
publish:
runs-on: ubuntu-latest

environment: pypi
steps:
- uses: actions/checkout@v4
with:
ref: main
- name: Set up Python 3.10
uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: Check out code
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"

- name: Install Hatch
run: pip install hatch

- name: Build the package
run: hatch build

- name: Install setuptools
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade setuptools wheel twine
- name: Build a binary wheel and a source tarball
run: |
python setup.py sdist bdist_wheel
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.pypi_api_key }}
- name: Publish to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.pypi_api_key }}
run: pip install twine && twine upload dist/*
25 changes: 0 additions & 25 deletions .github/workflows/run_nox.yml

This file was deleted.

64 changes: 64 additions & 0 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Run Tests

on:
pull_request:
workflow_dispatch:

jobs:
lint:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]

steps:
- name: Checkout Code
uses: actions/checkout@v4

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

- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install pre-commit

- name: Run Pre-Commit Hooks
run: |
pre-commit install
pre-commit run --all-files

unit-tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]

steps:
- name: Checkout Code
uses: actions/checkout@v4

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

- name: Install Hatch
run: |
python -m pip install --upgrade pip
pip install hatch

- name: Run Hatch Tests
run: |
hatch run tests:local

- name: Upload Coverage Report on Failure
if: always()
uses: actions/upload-artifact@v4
with:
name: coverage-report-${{ matrix.python-version }}
path: htmlcov
7 changes: 6 additions & 1 deletion .idea/HABAppRules.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/codeStyles/codeStyleConfig.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/inspectionProfiles/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

55 changes: 55 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
default_install_hook_types: [pre-push]
repos:
# - repo: https://github.com/pre-commit/mirrors-mypy
# rev: v1.13.0
# hooks:
# - id: mypy
# args: [--install-types, --non-interactive]
# exclude: ^tests/
# additional_dependencies:
# - pydantic
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-added-large-files
- id: check-ast
- id: check-case-conflict
- id: check-executables-have-shebangs
- id: check-json
- id: check-toml
- id: check-yaml
- id: end-of-file-fixer
- id: fix-byte-order-marker
- id: trailing-whitespace
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.7.0
hooks:
- id: ruff
args: [--fix]
- id: ruff-format
- repo: https://github.com/google/yamlfmt
rev: v0.13.0
hooks:
- id: yamlfmt
args: [-conf, .yamlfmt.yaml]
- repo: https://github.com/scop/pre-commit-shfmt
rev: v3.10.0-1
hooks:
- id: shfmt
- repo: https://github.com/executablebooks/mdformat
rev: 0.7.18
hooks:
- id: mdformat

- repo: local
hooks:
- id: version-check
name: Check versions
entry: python version_check.py
language: python
pass_filenames: false
additional_dependencies:
- requests
- pytz
5 changes: 5 additions & 0 deletions .yamlfmt.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
formatter:
type: basic
eof_newline: true
max_line_length: 120
retain_line_breaks_single: true
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.11 as buildimage
FROM python:3.13 as buildimage

COPY . /tmp/app_install

Expand All @@ -7,7 +7,7 @@ RUN set -eux; \
cd /tmp/app_install; \
pip wheel --wheel-dir=/root/wheels .

FROM python:3.11
FROM python:3.13

COPY --from=buildimage /root/wheels /root/wheels
COPY container/entrypoint.sh /entrypoint.sh
Expand Down
Loading