Skip to content

Commit

Permalink
Update testing environments
Browse files Browse the repository at this point in the history
  • Loading branch information
fwitte committed Jun 30, 2024
1 parent 49e5a81 commit d4b04e1
Show file tree
Hide file tree
Showing 6 changed files with 133 additions and 10 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/packaging.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: packaging

on:
# Make sure packaging process is not broken
push:
branches: [main, dev]
pull_request:
# Make a package for release
release:
types: [published]

jobs:
build:

runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: ["3.11"]

steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip twine build flit
- name: Create packages
run: python -m build .
- name: Run twine check
run: twine check dist/*
- uses: actions/upload-artifact@v2
with:
name: tox-gh-actions-dist
path: dist
50 changes: 50 additions & 0 deletions .github/workflows/tox_checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# NB: this name is used in the status badge
name: tox checks

on:
push:
branches:
- main
- dev
pull_request:
branches:
- main
- dev
workflow_dispatch:
schedule:
- cron: "0 5 * * 6" # 5:00 UTC every Saturday

jobs:
lint:
name: ${{ matrix.toxenv }}
runs-on: ubuntu-latest

strategy:
matrix:
toxenv:
- check
- docs

steps:
- name: Git clone
uses: actions/checkout@v2

- name: Set up Python ${{ env.default_python || '3.11' }}
uses: actions/setup-python@v2
with:
python-version: "${{ env.default_python || '3.11' }}"

- name: Pip cache
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ matrix.toxenv }}-${{ hashFiles('tox.ini', 'pyproject.toml') }}
restore-keys: |
${{ runner.os }}-pip-${{ matrix.toxenv }}-
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install -U pip
python -m pip install -U tox
- name: Run ${{ matrix.toxenv }}
run: python -m tox -e ${{ matrix.toxenv }}
43 changes: 43 additions & 0 deletions .github/workflows/tox_pytest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: tox pytests

on:
push:
branches:
- main
- dev
pull_request:
branches:
- main
- dev
workflow_dispatch:
schedule:
- cron: "0 5 * * 6" # 5:00 UTC every Saturday

jobs:
pytest:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox tox-gh-actions coverage coveralls
- name: Test with tox
run: tox

- name: Check test coverage
run: coverage report -m --fail-under=${{ matrix.vcs == 'bzr' && 84 || 85 }}

- name: Report to coveralls
run: coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_SERVICE_NAME: github
7 changes: 0 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,6 @@ dev = [
]

[tool.pytest.ini_options]
python_files = [
"test_*.py",
"*_test.py",
"tests.py",
]
addopts = """
-ra
--strict-markers
Expand All @@ -81,7 +76,6 @@ addopts = """
"""
testpaths = [
"src/",
"tests/",
"docs/",
]

Expand All @@ -91,4 +85,3 @@ line_length = 120
known_first_party = "fluprodia"
default_section = "THIRDPARTY"
forced_separate = "test_fluprodia"
skip = "migrations"
2 changes: 1 addition & 1 deletion src/fluprodia/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8
"""Create beautiful fluid property diagrams using CoolProp and matplotlib"""

__version__ = '3.1'
__version__ = '3.2'

from .fluid_property_diagram import FluidPropertyDiagram # noqa: F401
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ python =
basepython =
{check,docs}: {env:TOXPYTHON:python3.11}
setenv =
PYTHONPATH={toxinidir}/tests
PYTHONPATH={toxinidir}
PYTHONUNBUFFERED=yes
passenv =
*
Expand All @@ -32,7 +32,7 @@ deps =
skip_install = true
commands =
check-manifest {toxinidir}
isort --verbose --check-only --diff src tests
isort --verbose --check-only --diff src

[testenv:docs]
usedevelop = true
Expand Down

0 comments on commit d4b04e1

Please sign in to comment.