Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 6 additions & 2 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Set up Python 3.10
- name: Set up Python 3.13
uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: '3.13'

- name: Gets the tag version
id: context
Expand All @@ -23,6 +23,10 @@ jobs:
- name: Setup the Python Environment by installing Poetry
uses: ./.github/actions/setup-python-build-env

- name: Bind Poetry to the selected interpreter
shell: bash
run: poetry env use "$(which python)"

- name: Code Quality Check
shell: bash
run: make install && make tests
Expand Down
43 changes: 38 additions & 5 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,35 @@ on:
- master

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.13"

- name: Setup the Python Environment by installing Poetry
uses: ./.github/actions/setup-python-build-env

- name: Bind Poetry to the selected interpreter
shell: bash
run: poetry env use "$(which python)"

- name: Install dependencies
shell: bash
run: make install

- name: Lint
shell: bash
run: make lint

tests:
runs-on: ubuntu-latest
strategy:
matrix:
version:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
- "3.13"
Expand All @@ -27,7 +48,19 @@ jobs:
- name: Setup the Python Environment by installing Poetry
uses: ./.github/actions/setup-python-build-env

- name: Code Quality Check
- name: Bind Poetry to Python ${{ matrix.version }}
shell: bash
run: poetry env use "$(which python)"

- name: Install dependencies
shell: bash
run: make install

- name: Verify tests run on Python ${{ matrix.version }}
shell: bash
run: |
make install && make tests
poetry run python -c 'import sys; expected = tuple(int(p) for p in "${{ matrix.version }}".split(".")); assert sys.version_info[:2] == expected, f"expected Python {expected}, got {sys.version}"; print(sys.version)'

- name: Run tests
shell: bash
run: make unit-tests
10 changes: 8 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: help .check-pypi-envs .install-poetry update install docs tests build deploy
.PHONY: help .check-pypi-envs .install-poetry update install docs lint unit-tests tests build deploy

.DEFAULT_GOAL := help

Expand All @@ -18,6 +18,8 @@ help:
@echo " release version=<sem. version> bumps the project version to <sem. version>, using poetry;"
@echo " Updates also docs/source/conf.py version;"
@echo " If no version is provided, poetry outputs the current project version"
@echo " lint run the linting checks (black, isort, flake8)"
@echo " unit-tests run the test suite"
@echo " tests run all the tests and linting"
@echo " update updates the dependencies in poetry.lock"
@echo ""
Expand All @@ -39,12 +41,16 @@ docs: .install-poetry
format: .install-poetry
poetry run isort ocpp tests && poetry run black ocpp tests

tests: .install-poetry
lint: .install-poetry
poetry run black --check --diff ocpp tests
poetry run isort --check-only ocpp tests
poetry run flake8 ocpp tests

unit-tests: .install-poetry
poetry run py.test -vvv --cov=ocpp --cov-report=term-missing tests/

tests: lint unit-tests

build: .install-poetry
poetry build

Expand Down
Loading