Skip to content

Commit

Permalink
Merge branch 'main' into calib_prod_id
Browse files Browse the repository at this point in the history
  • Loading branch information
morcuended committed Oct 10, 2023
2 parents ff686d5 + b8b0c67 commit 04e9548
Show file tree
Hide file tree
Showing 90 changed files with 244 additions and 793 deletions.
52 changes: 35 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,33 +13,48 @@ env:
PYTEST_ADDOPTS: --color=yes

jobs:
pyflakes:
static-code-checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: 3.11

- name: pyflakes
run: |
pip install pyflakes
pyflakes osa
- name: Run Ruff
uses: chartboost/ruff-action@v1

tests:
needs: pyflakes
needs: static-code-checks
strategy:
matrix:
include:
- python-version: "3.9"

- python-version: "3.10"

- python-version: "3.11"
extra-args: ['codecov']

runs-on: ubuntu-latest

defaults:
run:
shell: bash -leo pipefail {0}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Prepare environment file for Mamba installation
env:
PYTHON_VERSION: ${{ matrix.python-version }}
run: |
# setup correct python version
sed -i -e "s/- python=.*/- python=$PYTHON_VERSION/g" environment.yml
- name: Setup Mamba
uses: mamba-org/setup-micromamba@v1
Expand All @@ -48,17 +63,19 @@ jobs:
cache-environment: true
post-cleanup: 'all'

- name: Install dependencies
env:
PYTHON_VERSION: 3.11

- name: Build the package
run: |
python --version
echo "Installing additional pip packages"
echo "pip install .[test]"
pip install .[test]
pip install build
python -m build
- name: Install the package
run: pip install .[test]

- name: Install the package in editable mode
run: pip install --editable .[test]

- name: Tests
- name: Tests with pytest
env:
COVERAGE_PROCESS_START: .coveragerc
PYTHONPATH: .
Expand All @@ -69,8 +86,9 @@ jobs:
# to initialize the coverage start up.
echo "create sitecustomize.py"
echo "import coverage; coverage.process_startup()" > $PYTHONPATH/sitecustomize.py
pytest --basetemp=test_osa -v --cov --cov-report=xml osa
pytest --basetemp=test_osa -vv --cov --cov-report=xml src
cat coverage.xml
- name: Codecov
uses: codecov/codecov-action@v3
if: contains(matrix.extra-args, 'codecov')
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Publish package to PyPI
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ prov.log
docs/prov.log
*.log


# Compiled files
*.py[co]
*.a
Expand All @@ -22,8 +23,7 @@ __pycache__
# Other generated files
*/cython_version.py
htmlcov
.coverage
.coverage.*
*coverage*
MANIFEST

# Sphinx
Expand Down
Loading

0 comments on commit 04e9548

Please sign in to comment.