Skip to content

Commit

Permalink
Add CI job for tests (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaslink authored Nov 14, 2023
2 parents 7fb23dd + 08171b4 commit bf3afd7
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 5 deletions.
31 changes: 30 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: main

on:
push:
branches: [main]
branches: [master]
pull_request:

jobs:
Expand All @@ -22,3 +22,32 @@ jobs:

- name: Lint with flake8
run: flake8 --count
tests:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'

- name: Install pacakge
run: |
sudo apt-get install -y ffmpeg
python -m pip install --upgrade pip
pip install -e .
- name: Test with pytest
run: |
pip install -r requirements-test.txt
pytest --cov=frequenpy --cov-report=term-missing
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@

# FrequenPy

![coverage_badge](https://codecov.io/gh/tomaslink/frequenpy/branch/master/graph/badge.svg)

_FrequenPy_ is a high-precision physics engine dedicated to the study of standing waves and visualization of its normal modes.

This package has educational purposes.
Expand Down
5 changes: 4 additions & 1 deletion frequenpy/loaded_string/animation.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import logging
from os import path, makedirs

import matplotlib
from matplotlib import pyplot as plt
from matplotlib import animation

from frequenpy.loaded_string import loaded_string_factory

logger = logging.getLogger(__name__)


LINE_WIDTH = 1
LINE_MARKERTYPE = 'o'
LINE_MARKERSIZE = 8
Expand Down Expand Up @@ -120,7 +122,8 @@ def _build_figure(self):
ax.add_line(self._right_support(support_distance_from_origin))
ax.add_line(self._line)

plt.get_current_fig_manager().window.resizable(False, False)
if matplotlib.get_backend() == 'TkAgg':
plt.get_current_fig_manager().window.resizable(False, False)

return fig

Expand Down
1 change: 1 addition & 0 deletions requirements-test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pytest-cov<5
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
flake8<7
pytest-cov<5
-r requirements-test.txt

-e .
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
},
install_requires=[
'numpy<2',
'matplotlib<4'
'matplotlib<4',
'ffmpeg-python'
]
)
1 change: 0 additions & 1 deletion tests/loaded_string/test_animation.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import os

from matplotlib import pyplot

from frequenpy.loaded_string.animation import LoadedStringAnimation
Expand Down

0 comments on commit bf3afd7

Please sign in to comment.