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

BUG: Fix bug with logger call #39

Merged
merged 14 commits into from
Aug 24, 2023
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
12 changes: 12 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[run]
branch = True
source = snirf
omit =
*/setup.py

[report]
exclude_lines =
pragma: no cover
if __name__ == .__main__.:
@abstractmethod
@abstractclassmethod
27 changes: 18 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
name: test
concurrency:
group: ${{ github.workflow }}-${{ github.event.number }}-${{ github.event.ref }}
cancel-in-progress: true
on:
push:
branches:
Expand All @@ -10,18 +13,24 @@ on:
jobs:
build-linux:
runs-on: ubuntu-latest
continue-on-error: true
strategy:
max-parallel: 5

matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
defaults:
run:
shell: bash -el {0}
steps:
- uses: actions/checkout@v2
- name: Install Python 3
uses: actions/setup-python@v1
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.8.17
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run test.py
run: python -m unittest discover -s ./tests
python -m pip install --upgrade pip setuptools wheel
pip install -r requirements.txt pytest pytest-cov
pip install --no-build-isolation -ve .
- run: pytest tests/test.py
- uses: codecov/codecov-action@v3
if: success()
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
**/venv
**/__pycache__
.idea
*.log
*.log
*.egg-info
junit-results.xml
tests/wd
8 changes: 7 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,10 @@ requires = [
"setuptools>=42",
"wheel"
]
build-backend = "setuptools.build_meta"
build-backend = "setuptools.build_meta"

[tool.pytest.ini_options]
addopts = """-ra --cov-report= --tb=short \
--junit-xml=junit-results.xml \
--color=yes --capture=sys"""
junit_family = "xunit2"
12 changes: 6 additions & 6 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
h5py==3.1.0
numpy==1.19.5
setuptools==40.8.0
pip==21.3.1
termcolor==1.1.0
colorama==0.4.4
h5py
numpy
setuptools
pip
termcolor
colorama
6 changes: 5 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,16 @@

import io
import os
from pathlib import Path
import sys
from shutil import rmtree

from setuptools import find_packages, setup, Command

from snirf.__version__ import __version__ as VERSION
# Do not "import snirf" here because that requires h5py to be installed
with open(Path(__file__).parent / "snirf" / "__version__.py") as f:
VERSION = f.readline().split("=")[1].strip().strip('()')
VERSION = ".".join(VERSION.replace(' ', '').replace(',', '.').split(','))

NAME = 'snirf'

Expand Down
2 changes: 1 addition & 1 deletion snirf/pysnirf2.py
Original file line number Diff line number Diff line change
Expand Up @@ -1278,7 +1278,7 @@ def _order_names(self, h=None):
h.move(e.location,
'/'.join(e.location.split('/')[:-1]) + '/' + self._name)
self._cfg.logger.info(
e.location, '--->',
e.location + '--->' +
'/'.join(e.location.split('/')[:-1]) + '/' + self._name)
elif all([
len(e.location.split('/' + self._name)[-1]) > 0
Expand Down
Loading