%global _empty_manifest_terminate_build 0 Name: python-nowledgeable Version: 0.1.12 Release: 1 Summary: Auto checker License: GNU Affero General Public License v3 URL: https://www.python.org/sigs/distutils-sig/ Source0: https://mirrors.nju.edu.cn/pypi/web/packages/b6/4f/dfdac2410b7ba9dd35ebd9114cf56c6f9492be688b90d4bab68650a9ad56/nowledgeable-0.1.12.tar.gz BuildArch: noarch Requires: python3-pandas Requires: python3-pyyaml Requires: python3-matplotlib Requires: python3-werkzeug Requires: python3-numpy Requires: python3-requests Requires: python3-scipy Requires: python3-watchdog %description # Nowledgeable exercice check This module let student check their answers outside nowledgeable, anywhere. Allows exercices to be run outside the nowledgeable application. Allow also testing complex applications Contain also the python exercice unit framework ## installation ```bash pip3 install nowledgeable ``` ## usage ### Exercice checking Run the following in an exercice containing an exercice with the exercice.yaml specification ```bash nowledgeable run-checks ``` or ```bash nowledgeable run-checks /path/to/exercice.yaml ``` Watching for file update and reruning files automatically ```bash nowledgeable watch ``` ### using the unit testing library ```python from python_utils.utils import AnswerTester tester = AnswerTester() #singleton pattern ## add assertions tester.print_test_output() ``` #### Exemples imagine you have the following wording : "Code the function multiply_by_two(x) return 2 * x for each x" You can use `compare_function`. for that you need to : 1. code the proper function 2. specify a test_inputs variables which will be fed to the student function and the good one. ```python def solution(x): return 2 * x tester = AnswerTester() test_inputs = [ [3], # la fonction sera testée avec l'argument x=3 [-2],# la fonction sera testée avec l'argument x=-2 [random.randint(-3, 3)] #la fonction sera testée avec un x aléatoire entre -3 et 3 ] tester.compare_functions("nom test", multiply_by_two, solution, test_inputs, "message") result_status = tester.get_test_output() result = tester.get_test_output() #A la fin on demande de générer le json ``` %package -n python3-nowledgeable Summary: Auto checker Provides: python-nowledgeable BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-pip %description -n python3-nowledgeable # Nowledgeable exercice check This module let student check their answers outside nowledgeable, anywhere. Allows exercices to be run outside the nowledgeable application. Allow also testing complex applications Contain also the python exercice unit framework ## installation ```bash pip3 install nowledgeable ``` ## usage ### Exercice checking Run the following in an exercice containing an exercice with the exercice.yaml specification ```bash nowledgeable run-checks ``` or ```bash nowledgeable run-checks /path/to/exercice.yaml ``` Watching for file update and reruning files automatically ```bash nowledgeable watch ``` ### using the unit testing library ```python from python_utils.utils import AnswerTester tester = AnswerTester() #singleton pattern ## add assertions tester.print_test_output() ``` #### Exemples imagine you have the following wording : "Code the function multiply_by_two(x) return 2 * x for each x" You can use `compare_function`. for that you need to : 1. code the proper function 2. specify a test_inputs variables which will be fed to the student function and the good one. ```python def solution(x): return 2 * x tester = AnswerTester() test_inputs = [ [3], # la fonction sera testée avec l'argument x=3 [-2],# la fonction sera testée avec l'argument x=-2 [random.randint(-3, 3)] #la fonction sera testée avec un x aléatoire entre -3 et 3 ] tester.compare_functions("nom test", multiply_by_two, solution, test_inputs, "message") result_status = tester.get_test_output() result = tester.get_test_output() #A la fin on demande de générer le json ``` %package help Summary: Development documents and examples for nowledgeable Provides: python3-nowledgeable-doc %description help # Nowledgeable exercice check This module let student check their answers outside nowledgeable, anywhere. Allows exercices to be run outside the nowledgeable application. Allow also testing complex applications Contain also the python exercice unit framework ## installation ```bash pip3 install nowledgeable ``` ## usage ### Exercice checking Run the following in an exercice containing an exercice with the exercice.yaml specification ```bash nowledgeable run-checks ``` or ```bash nowledgeable run-checks /path/to/exercice.yaml ``` Watching for file update and reruning files automatically ```bash nowledgeable watch ``` ### using the unit testing library ```python from python_utils.utils import AnswerTester tester = AnswerTester() #singleton pattern ## add assertions tester.print_test_output() ``` #### Exemples imagine you have the following wording : "Code the function multiply_by_two(x) return 2 * x for each x" You can use `compare_function`. for that you need to : 1. code the proper function 2. specify a test_inputs variables which will be fed to the student function and the good one. ```python def solution(x): return 2 * x tester = AnswerTester() test_inputs = [ [3], # la fonction sera testée avec l'argument x=3 [-2],# la fonction sera testée avec l'argument x=-2 [random.randint(-3, 3)] #la fonction sera testée avec un x aléatoire entre -3 et 3 ] tester.compare_functions("nom test", multiply_by_two, solution, test_inputs, "message") result_status = tester.get_test_output() result = tester.get_test_output() #A la fin on demande de générer le json ``` %prep %autosetup -n nowledgeable-0.1.12 %build %py3_build %install %py3_install install -d -m755 %{buildroot}/%{_pkgdocdir} if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi pushd %{buildroot} if [ -d usr/lib ]; then find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/lib64 ]; then find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/bin ]; then find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/sbin ]; then find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst fi touch doclist.lst if [ -d usr/share/man ]; then find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst fi popd mv %{buildroot}/filelist.lst . mv %{buildroot}/doclist.lst . %files -n python3-nowledgeable -f filelist.lst %dir %{python3_sitelib}/* %files help -f doclist.lst %{_docdir}/* %changelog * Wed May 10 2023 Python_Bot - 0.1.12-1 - Package Spec generated