Skip to content

Commit

Permalink
Squashed commits of GitHub Action development and testing
Browse files Browse the repository at this point in the history
  • Loading branch information
lcorcodilos committed Oct 12, 2020
1 parent d683f43 commit c9851b8
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 19 deletions.
34 changes: 19 additions & 15 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,32 @@ jobs:
runs-on: ubuntu-18.04
strategy:
matrix:
python-version: [2.7, 3.5, 3.6, 3.7, 3.8]
python-version: [2.7,3.6] #3.6.9,

steps:
- uses: actions/checkout@v2
- name: Hack to get setup-python to work on act
run: |
if [ ! -f "/etc/lsb-release" ] ; then
echo "DISTRIB_RELEASE=18.04" > /etc/lsb-release
fi
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
- name: Setup environment
run: |
python -m pip install --upgrade pip
pip install pytest flake8
wget http://rig.lucascorcodilos.com/root_v6-22-00_build.tgz
tar -xzvf root_v6-22-00_build.tgz
source root_v6.22.00.build/bin/thisroot.sh
source setup.sh
# - name: Lint with flake8
# run: |
# # stop the build if there are Python syntax errors or undefined names
# flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics --exclude build/ --e
# # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
pip install virtualenv
python -m virtualenv timber-env
source timber-env/bin/activate
pip install pytest gdown
gdown https://drive.google.com/uc?id=11dXffndcD3OkHqJ3x2iaVZj5C8HVLeg_ -O root_v6-22-00_build.tgz
tar -xzf root_v6-22-00_build.tgz
- name: Pytest
run: |
pytest
source timber-env/bin/activate
source setup.sh
source root_v6.22.00.build/bin/thisroot.sh
export TIMBERPATH=$TIMBERPATH
pytest test/
2 changes: 1 addition & 1 deletion TIMBER/Analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import pprint, time, json, copy, os, sys, subprocess
from collections import OrderedDict
pp = pprint.PrettyPrinter(indent=4)
from Tools.Common import GetHistBinningTuple, CompileCpp
from TIMBER.Tools.Common import GetHistBinningTuple, CompileCpp
from clang import cindex

# For parsing c++ modules
Expand Down
4 changes: 2 additions & 2 deletions TIMBER/Tools/Common.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def dictToLatexTable(dict2convert,outfilename,roworder=[],columnorder=[]):
column_string = ' &'
for c in columns:
column_string += str(c)+'\t& '
column_string = column_string[:-2]+'\\\ \n'
column_string = column_string[:-2]+'\\\\ \n'
latexout.write(column_string)

latexout.write('\\hline \n')
Expand All @@ -192,7 +192,7 @@ def dictToLatexTable(dict2convert,outfilename,roworder=[],columnorder=[]):
row_string += str(dict2convert[r][c])+'\t& '
else:
row_string += '- \t& '
row_string = row_string[:-2]+'\\\ \n'
row_string = row_string[:-2]+'\\\\ \n'
latexout.write(row_string)

latexout.write('\\hline \n')
Expand Down
2 changes: 1 addition & 1 deletion test/test_Analyzer.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import ROOT
ROOT.gROOT.SetBatch(True)
from TIMBER.Analyzer import *
from TIMBER.Analyzer import analyzer, CutGroup, VarGroup
from TIMBER.Tools.Common import CompileCpp

class TestAnalyzer():
Expand Down

0 comments on commit c9851b8

Please sign in to comment.