Skip to content
This repository has been archived by the owner on Jan 13, 2024. It is now read-only.

Commit

Permalink
fix string and buildn, try for tkinter
Browse files Browse the repository at this point in the history
  • Loading branch information
sdpython committed Feb 23, 2017
1 parent 3fbf19b commit a9f3138
Show file tree
Hide file tree
Showing 13 changed files with 49 additions and 38 deletions.
5 changes: 3 additions & 2 deletions .local.jenkins.win.yml
Expand Up @@ -21,6 +21,7 @@ virtualenv:
install:
- pip install --no-cache-dir --no-deps --index http://localhost:8067/simple/ jyquickhelper --extra-index-url=https://pypi.python.org/simple/
- pip install -r requirements.txt
- python --version
- pip freeze
- pip freeze > pip_freeze.txt

Expand All @@ -41,8 +42,8 @@ before_script:
# By default, the timeout for the job (only used in Jenkins) is set to 1200 (20 minutes).
# This means the job will be stop if it produces no output for 20 minutes.
script:
- { CMD: "python -u setup.py unittests", NAME: "UT", TIMEOUT: 900 }
- { CMD: "python -u setup.py unittests_SKIP", NAME: "UT_SKIP", TIMEOUT: 900 }
- { CMD: "python -X faulthandler -X showrefcount -u setup.py unittests", NAME: "UT", TIMEOUT: 900 }
- { CMD: "python -X faulthandler -X showrefcount -u setup.py unittests_SKIP", NAME: "UT_SKIP", TIMEOUT: 900 }
- if [ ${VERSION} == "3.5" and ${DIST} == "std" ]
then
--CMD=python -u setup.py build_sphinx;
Expand Down
4 changes: 4 additions & 0 deletions _unittests/ut_funcwin/test_windows.py
Expand Up @@ -25,6 +25,7 @@
import src

from src.pyquickhelper.loghelper.flog import fLOG
from src.pyquickhelper.pycode import fix_tkinter_issues_virtualenv
from src.pyquickhelper.funcwin import open_window_params, open_window_function
from src.pyquickhelper.funcwin.function_helper import get_function_list, has_unknown_parameters, private_get_function

Expand All @@ -46,6 +47,7 @@ def test_open_window_params(self):
__file__,
self._testMethodName,
OutputPrint=__name__ == "__main__")
fix_tkinter_issues_virtualenv(fLOG=fLOG)
params = dict(p1="p1", p2=3)
try:
win = open_window_params(params, do_not_open=True)
Expand All @@ -62,6 +64,7 @@ def test_open_window_function(self):
__file__,
self._testMethodName,
OutputPrint=__name__ == "__main__")
fix_tkinter_issues_virtualenv(fLOG=fLOG)
func = my_tst_function
try:
win = open_window_function(func, do_not_open=True)
Expand All @@ -81,6 +84,7 @@ def test_get_function_list(self):
__file__,
self._testMethodName,
OutputPrint=__name__ == "__main__")
fix_tkinter_issues_virtualenv(fLOG=fLOG)
funcs = get_function_list(src.pyquickhelper)
assert isinstance(funcs, dict)
assert len(funcs) > 0
Expand Down
4 changes: 2 additions & 2 deletions _unittests/ut_helpgen/data/completion.py
Expand Up @@ -454,7 +454,7 @@ def update_stat_dynamic(self, delta=0.8):
must be called after @see me precompute_stat
and computes dynamic mks (see :ref:`Dynamic Minimum Keystroke <def-mks2>`)
@param delta parameter :math:`\delta` in defintion
@param delta parameter :math:`\\delta` in defintion
:ref:`Modified Dynamic KeyStroke <def-mks3>`
@return number of iterations to converge
"""
Expand Down Expand Up @@ -542,7 +542,7 @@ def update_dynamic_minimum_keystroke(self, lw, delta):
update dynamic minimum keystroke for the completions
@param lw prefix length
@param delta parameter :math:`\delta` in defintion
@param delta parameter :math:`\\delta` in defintion
:ref:`Modified Dynamic KeyStroke <def-mks3>`
@return number of updates
"""
Expand Down
2 changes: 1 addition & 1 deletion _unittests/ut_helpgen/test_doxygen2rst.py
Expand Up @@ -95,7 +95,7 @@ def test_process_var_tag(self):
.. math::
\sum_{i=1}^n x^2
\\sum_{i=1}^n x^2
"""
self.assertEqual(rst.strip("\n ").replace(" ", ""),
exp.strip("\n ").replace(" ", ""))
Expand Down
22 changes: 14 additions & 8 deletions _unittests/ut_jenkinshelper/test_yaml.py
Expand Up @@ -175,7 +175,7 @@ def zz_st_jconvert_sequence_into_batch_file(self, platform):
@echo CREATE VIRTUAL ENVIRONMENT in ROOT\\%NAME_JENKINS%\\_venv
if not exist "ROOT\\%NAME_JENKINS%\\_venv" mkdir "ROOT\\%NAME_JENKINS%\\_venv"
set KEEPPATH=%PATH%
set PATH=%PATH%;C:\Python35_x64
set PATH=%PATH%;C:\\Python35_x64
"C:\\Python35_x64\\Scripts\\virtualenv" --system-site-packages "ROOT\\%NAME_JENKINS%\\_venv"
set PATH=%KEEPPATH%
if %errorlevel% neq 0 exit /b %errorlevel%
Expand All @@ -186,6 +186,8 @@ def zz_st_jconvert_sequence_into_batch_file(self, platform):
if %errorlevel% neq 0 exit /b %errorlevel%
pip install -r requirements.txt
if %errorlevel% neq 0 exit /b %errorlevel%
python --version
if %errorlevel% neq 0 exit /b %errorlevel%
pip freeze
if %errorlevel% neq 0 exit /b %errorlevel%
pip freeze > pip_freeze.txt
Expand All @@ -194,14 +196,14 @@ def zz_st_jconvert_sequence_into_batch_file(self, platform):
@echo SCRIPT
set PATH=ROOT\\%NAME_JENKINS%\\_venv\\Scripts;%PATH%
python -u setup.py unittests
python -X faulthandler -X showrefcount -u setup.py unittests
if %errorlevel% neq 0 exit /b %errorlevel%
@echo AFTER_SCRIPT
set PATH=ROOT\%NAME_JENKINS%\_venv\Scripts;%PATH%
set PATH=ROOT\\%NAME_JENKINS%\\_venv\\Scripts;%PATH%
python -u setup.py bdist_wheel
if %errorlevel% neq 0 exit /b %errorlevel%
copy dist\*.whl ..\..\local_pypi\local_pypi_server
copy dist\\*.whl ..\\..\\local_pypi\\local_pypi_server
if %errorlevel% neq 0 exit /b %errorlevel%
@echo DOCUMENTATION
Expand Down Expand Up @@ -236,7 +238,7 @@ def zz_st_jconvert_sequence_into_batch_file(self, platform):
@echo CREATE VIRTUAL ENVIRONMENT in ROOT\\%NAME_JENKINS%\\_venv
if not exist "ROOT\\%NAME_JENKINS%\\_venv" mkdir "ROOT\\%NAME_JENKINS%\\_venv"
set KEEPPATH=%PATH%
set PATH=%PATH%;C:\Python35_x64
set PATH=%PATH%;C:\\Python35_x64
"C:\\Python35_x64\\Scripts\\virtualenv" --system-site-packages "ROOT\\%NAME_JENKINS%\\_venv"
set PATH=%KEEPPATH%
if %errorlevel% neq 0 exit /b %errorlevel%
Expand All @@ -247,6 +249,8 @@ def zz_st_jconvert_sequence_into_batch_file(self, platform):
if %errorlevel% neq 0 exit /b %errorlevel%
pip install -r requirements.txt
if %errorlevel% neq 0 exit /b %errorlevel%
python --version
if %errorlevel% neq 0 exit /b %errorlevel%
pip freeze
if %errorlevel% neq 0 exit /b %errorlevel%
pip freeze > pip_freeze.txt
Expand All @@ -259,7 +263,7 @@ def zz_st_jconvert_sequence_into_batch_file(self, platform):
if %errorlevel% neq 0 exit /b %errorlevel%
@echo AFTER_SCRIPT
set PATH=ROOT\%NAME_JENKINS%\_venv\Scripts;%PATH%
set PATH=ROOT\\%NAME_JENKINS%\\_venv\\Scripts;%PATH%
python -u setup.py bdist_wheel
if %errorlevel% neq 0 exit /b %errorlevel%
""".replace(" ", "").strip("\n \t\r")
Expand Down Expand Up @@ -322,7 +326,7 @@ def test_jconvert_sequence_into_batch_file27(self):
@echo CREATE VIRTUAL ENVIRONMENT in ROOT\\%NAME_JENKINS%\\_venv
if not exist "ROOT\\%NAME_JENKINS%\\_venv" mkdir "ROOT\\%NAME_JENKINS%\\_venv"
set KEEPPATH=%PATH%
set PATH=%PATH%;C:\Python27_x64
set PATH=%PATH%;C:\\Python27_x64
"C:\\Python27_x64\\Scripts\\virtualenv" --system-site-packages "ROOT\\%NAME_JENKINS%\\_venv"
set PATH=%KEEPPATH%
if %errorlevel% neq 0 exit /b %errorlevel%
Expand All @@ -333,6 +337,8 @@ def test_jconvert_sequence_into_batch_file27(self):
if %errorlevel% neq 0 exit /b %errorlevel%
pip install -r requirements.txt
if %errorlevel% neq 0 exit /b %errorlevel%
python --version
if %errorlevel% neq 0 exit /b %errorlevel%
pip freeze
if %errorlevel% neq 0 exit /b %errorlevel%
pip freeze > pip_freeze.txt
Expand All @@ -350,7 +356,7 @@ def test_jconvert_sequence_into_batch_file27(self):
@echo SCRIPT
set PATH=ROOT\\%NAME_JENKINS%\\_venv\\Scripts;%PATH%
python -u setup.py unittests
python -X faulthandler -X showrefcount -u setup.py unittests
if %errorlevel% neq 0 exit /b %errorlevel%
@echo AFTER_SCRIPT
Expand Down
2 changes: 1 addition & 1 deletion src/pyquickhelper/filehelper/ftp_transfer_files.py
Expand Up @@ -92,7 +92,7 @@ class FolderTransferFTP:
password,
fLOG=print)
location = r"local_location\GitHub\%s\dist\html"
location = r"local_location\\GitHub\\%s\\dist\\html"
this = os.path.abspath(os.path.dirname(__file__))
rootw = "/www/htdocs/app/%s/helpsphinx"
Expand Down
24 changes: 12 additions & 12 deletions src/pyquickhelper/helpgen/_my_doxypy.py
Expand Up @@ -142,26 +142,26 @@ def __init__(self,
string_prefixes = "[uU]?[rR]?"

self.start_single_comment_re = re.compile(
"^\s*%s(''')" % string_prefixes)
self.end_single_comment_re = re.compile("(''')\s*$")
"^\\s*%s(''')" % string_prefixes)
self.end_single_comment_re = re.compile("(''')\\s*$")

self.start_double_comment_re = re.compile(
"^\s*%s(\"\"\")" % string_prefixes)
self.end_double_comment_re = re.compile("(\"\"\")\s*$")
"^\\s*%s(\"\"\")" % string_prefixes)
self.end_double_comment_re = re.compile("(\"\"\")\\s*$")

self.single_comment_re = re.compile(
"^\s*%s(''').*(''')\s*$" % string_prefixes)
"^\\s*%s(''').*(''')\\s*$" % string_prefixes)
self.double_comment_re = re.compile(
"^\s*%s(\"\"\").*(\"\"\")\s*$" % string_prefixes)
"^\\s*%s(\"\"\").*(\"\"\")\\s*$" % string_prefixes)

self.defclass_re = re.compile("^(\s*)(def .+:|class .+:)")
self.empty_re = re.compile("^\s*$")
self.hashline_re = re.compile("^\s*#.*$")
self.importline_re = re.compile("^\s*(import |from .+ import)")
self.defclass_re = re.compile("^(\\s*)(def .+:|class .+:)")
self.empty_re = re.compile("^\\s*$")
self.hashline_re = re.compile("^\\s*#.*$")
self.importline_re = re.compile("^\\s*(import |from .+ import)")

self.multiline_defclass_start_re = re.compile(
"^(\s*)(def|class)(\s.*)?$")
self.multiline_defclass_end_re = re.compile(":\s*$")
"^(\\s*)(def|class)(\\s.*)?$")
self.multiline_defclass_end_re = re.compile(":\\s*$")
self.print_output = print_output
self.process_comment = process_comment
self.information = information
Expand Down
4 changes: 2 additions & 2 deletions src/pyquickhelper/helpgen/conf_path_tools.py
Expand Up @@ -28,7 +28,7 @@ def find_graphviz_dot(exc=True):
"""
determines the path to graphviz (on Windows),
the function tests the existence of versions 34 to 45
assuming it was installed in a standard folder: ``C:\Program Files\MiKTeX 2.9\miktex\bin\x64``
assuming it was installed in a standard folder: ``C:\\Program Files\\MiKTeX 2.9\\miktex\\bin\\x64``
@return path to dot
Expand Down Expand Up @@ -63,7 +63,7 @@ def find_graphviz_dot(exc=True):

def find_latex_path(exc=True):
"""
@return ``C:\Program Files\MiKTeX 2.9\miktex\bin\x64``
@return ``C:\\Program Files\\MiKTeX 2.9\\miktex\\bin\\x64``
:raises FileNotFoundError: if latex not found
Expand Down
2 changes: 1 addition & 1 deletion src/pyquickhelper/ipythonhelper/cython_helper.py
Expand Up @@ -30,7 +30,7 @@ def ipython_cython_extension():
answers that question.
One file needs to be modified::
<python>\lib\distutils\msvc9compiler.py
<python>\\lib\\distutils\\msvc9compiler.py
"""
if not sys.platform.startswith("win"):
return True
Expand Down
2 changes: 1 addition & 1 deletion src/pyquickhelper/ipythonhelper/notebook_runner.py
Expand Up @@ -1047,7 +1047,7 @@ def split_header(s, get_header=True):
parts = s.splitlines()
if parts[0].startswith('#'):
if get_header:
header = re.sub('#+\s*', '', parts.pop(0))
header = re.sub('#+\\s*', '', parts.pop(0))
if not parts:
return header, ''
else:
Expand Down
4 changes: 2 additions & 2 deletions src/pyquickhelper/loghelper/flog.py
Expand Up @@ -613,7 +613,7 @@ def _first_more_recent(f1, path):

da = da.groups()[0]
gr = re.compile(
"[\w, ]* ([ \d]{2}) ([\w]{3}) ([\d]{4}) ([\d]{2}):([\d]{2}):([\d]{2})").search(da)
"[\\w, ]* ([ \\d]{2}) ([\\w]{3}) ([\\d]{4}) ([\\d]{2}):([\\d]{2}):([\\d]{2})").search(da)
if gr is None:
return True
gr = gr.groups()
Expand All @@ -622,7 +622,7 @@ def _first_more_recent(f1, path):

p = time.ctime(os.path.getmtime(path))
gr = re.compile(
"[\w, ]* ([\w]{3}) ([ \d]{2}) ([\d]{2}):([\d]{2}):([\d]{2}) ([\d]{4})").search(p)
"[\\w, ]* ([\\w]{3}) ([ \\d]{2}) ([\\d]{2}):([\\d]{2}):([\\d]{2}) ([\\d]{4})").search(p)
if gr is None:
return True
gr = gr.groups()
Expand Down
2 changes: 1 addition & 1 deletion src/pyquickhelper/pycode/utils_tests.py
Expand Up @@ -79,7 +79,7 @@ def main_wrapper_tests(codefile, skip_list=None, processes=False, add_coverage=F
Once Jenkins is installed, the command to schedule is::
set PATH=%PATH%;%USERPOFILE%\AppData\Local\Pandoc
set PATH=%PATH%;%USERPOFILE%\\AppData\\Local\\Pandoc
build_setup_help_on_windows.bat
This works if you installed Jenkins with your credentials.
Expand Down
10 changes: 5 additions & 5 deletions src/pyquickhelper/pycode/windows_scripts.py
Expand Up @@ -88,13 +88,13 @@ def _sversion():
@echo run27: start the loop
rem we are in a virtual environnement
@echo if not exist %pythonexe27%\..\Scripts set pythonexe27=%pythonexe27%\..\..\Scripts
if not exist %pythonexe27%\..\Scripts set pythonexe27=%pythonexe27%\..\..\Scripts
@echo if not exist %pythonexe27%\\..\\Scripts set pythonexe27=%pythonexe27%\\..\\..\\Scripts
if not exist %pythonexe27%\\..\\Scripts set pythonexe27=%pythonexe27%\\..\\..\\Scripts
@echo looking for nosetests.exe in %pythonexe27%
__LOOP_UNITTEST_FOLDERS__
""" + windows_error + "\ncd ..\.."
""" + windows_error + "\ncd ..\\.."

############
#: copy to local pypiserver
Expand Down Expand Up @@ -453,8 +453,8 @@ def _sversion():
:run:
@echo ~LABEL run
@echo ~CALL %pythonexe%\Scripts\pypi-server.exe -u -p %portpy% --disable-fallback ..\\..\\local_pypi\\local_pypi_server
%pythonexe%\Scripts\pypi-server.exe -u -p %portpy% --disable-fallback ..\\..\\local_pypi\\local_pypi_server
@echo ~CALL %pythonexe%\\Scripts\\pypi-server.exe -u -p %portpy% --disable-fallback ..\\..\\local_pypi\\local_pypi_server
%pythonexe%\\Scripts\\pypi-server.exe -u -p %portpy% --disable-fallback ..\\..\\local_pypi\\local_pypi_server
""".replace("PY??", _sversion())

#################
Expand Down

0 comments on commit a9f3138

Please sign in to comment.