File tree Expand file tree Collapse file tree 4 files changed +65
-0
lines changed Expand file tree Collapse file tree 4 files changed +65
-0
lines changed Original file line number Diff line number Diff line change
1
+ from mplfinance import _version
2
+ import argparse
3
+
4
+ if __name__ == "__main__" :
5
+ parser = argparse .ArgumentParser (description = 'Check versions.' )
6
+ parser .add_argument ('--pr' , type = str , help = 'mplfinance.__version__ for the PR' )
7
+ parser .add_argument ('--in' , type = str , help = 'mplfinance.__version__ for the `master` branch' )
8
+
9
+ args = parser .parse_args ()
10
+ test_tag = 'VersionCheck'
11
+ outcome = _version .compare_versions (v_str1 = args .pr , v_str2 = args .in )
12
+ if outcome != '>' :
13
+ return '0'
14
+
15
+
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ # Run this script test.sh from project root directory containing setup.py
4
+ pr_branch=$1
5
+ if [" ${pr_branch} " == " false" ]:
6
+ exit 0
7
+ pip3 install .
8
+ git checkout ${pr_branch}
9
+ pr_version=$( python3 -c " import mplfinance; print(mplfinance.__version__)" )
10
+ git checkout master
11
+ in_version=$( python3 -c " import mplfinance; print(mplfinance.__version__)" )
12
+ echo " PR: ${pr_version} ; Incumbent: ${in_version} "
13
+ result=$( python3 -m mplfinance.check_version --pr ${pr_version} --in ${in_version} )
14
+ tox
15
+ if [" ${result} " != " VersionCheck:pr>master" ]
16
+ # version in PR doesn't pass the test
17
+ echo " ${result} "
18
+ exit 1
19
+ fi
Original file line number Diff line number Diff line change
1
+ from mplfinance import _version
2
+ import argparse
3
+
4
+ if __name__ == "__main__" :
5
+ parser = argparse .ArgumentParser (description = 'Check versions.' )
6
+ parser .add_argument ('--pr' , type = str , help = 'mplfinance.__version__ for the PR' )
7
+ parser .add_argument ('--in' , type = str , help = 'mplfinance.__version__ for the `master` branch' )
8
+
9
+ args = parser .parse_args ()
10
+ test_tag = 'VersionCheck:{}'
11
+ outcome = _version .compare_versions (v_str1 = args .pr , v_str2 = args .in )
12
+ print (test_tag .format ('pr{}master' .format (outcome )))
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ # Run this script test.sh from project root directory containing setup.py
4
+ pr_branch=$1
5
+ if [" ${pr_branch} " == " false" ]:
6
+ exit 0
7
+ pip3 install .
8
+ git checkout ${pr_branch}
9
+ pr_version=$( python3 -c " import mplfinance; print(mplfinance.__version__)" )
10
+ git checkout master
11
+ in_version=$( python3 -c " import mplfinance; print(mplfinance.__version__)" )
12
+ echo " PR: ${pr_version} ; Incumbent: ${in_version} "
13
+ result=$( python3 -m mplfinance.check_version --pr ${pr_version} --in ${in_version} )
14
+ tox
15
+ if [" ${result} " != " VersionCheck:pr>master" ]
16
+ # version in PR doesn't pass the test
17
+ echo " ${result} "
18
+ exit 1
19
+ fi
You can’t perform that action at this time.
0 commit comments