diff --git a/HISTORY.rst b/HISTORY.rst index 87df86b4..0ae90548 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -5,309 +5,303 @@ History ======= -current - 2021-08-15 - 0.00Mb +current - 2021-10-02 - 0.00Mb ============================= -* `345`: Improves file comparison, add magic command codediff (2021-08-15) -* `344`: Update myexample2.py due a failure in astroid (astroid.exceptions.TooManyLevelsError) (2021-07-25) -* `343`: Update for Sphinx 4.1.0 (2021-07-12) +* #347: Adds pseudo recursive getstate (2021-09-02) +* #346: Adds functions to shorten big constant in unit tests (2021-08-18) + +1.10.3626 - 2021-08-15 - 1.98Mb +=============================== + +* #345: Improves file comparison, add magic command codediff (2021-08-15) +* #344: Update myexample2.py due a failure in astroid (astroid.exceptions.TooManyLevelsError) (2021-07-25) +* #343: Update for Sphinx 4.1.0 (2021-07-12) 1.10.3616 - 2021-06-04 - 2.19Mb =============================== -* `342`: Fixes azure-pipelines.yml pipeline (2021-06-03) -* `341`: Only log args if they are iterable (2021-06-02) -* `340`: pyq-sync cli breaks when args is not iterable (2021-06-02) -* `339`: Enables support for Sphinx 4.0 (2021-05-10) -* `338`: Adds a command in the setup to check url in the code or documentation (2021-05-10) -* `337`: Adds function to easily store and retrieve dataframe through a REST API (2021-04-17) +* #342: Fixes azure-pipelines.yml pipeline (2021-06-03) +* #341: Only log args if they are iterable (2021-06-02) +* #340: pyq-sync cli breaks when args is not iterable (2021-06-02) +* #339: Enables support for Sphinx 4.0 (2021-05-10) +* #338: Adds a command in the setup to check url in the code or documentation (2021-05-10) +* #337: Adds function to easily store and retrieve dataframe through a REST API (2021-04-17) 1.10.3585 - 2021-04-11 - 2.18Mb =============================== -* `336`: Refactors setup.py, moves setup command to pyquicksetup (2021-04-10) -* `335`: Adds class to store files with sqlite3, access with FastAPI (2021-04-06) -* `334`: Renames serverdoc into server (2021-04-04) -* `332`: Javascript for examples galleries is not working (2021-03-31) -* `333`: Fixes issue #332, fix style in gallery of examples (2021-03-29) -* `331`: Add option process to gdot sphinx extension (2021-03-09) -* `330`: Fixes for sphinx 3.5 (2021-02-15) -* `329`: Fixes #328, improves links in notebooks (2021-02-13) -* `328`: Github link for notebooks is broken (2021-02-13) -* `326`: Add option CRB to put \r back in a file (2021-02-09) +* #336: Refactors setup.py, moves setup command to pyquicksetup (2021-04-10) +* #335: Adds class to store files with sqlite3, access with FastAPI (2021-04-06) +* #334: Renames serverdoc into server (2021-04-04) +* #332: Javascript for examples galleries is not working (2021-03-31) +* #333: Fixes issue #332, fix style in gallery of examples (2021-03-29) +* #331: Add option process to gdot sphinx extension (2021-03-09) +* #330: Fixes for sphinx 3.5 (2021-02-15) +* #329: Fixes #328, improves links in notebooks (2021-02-13) +* #328: Github link for notebooks is broken (2021-02-13) +* #326: Add option CRB to put \r back in a file (2021-02-09) 1.10.3519 - 2021-01-13 - 2.10Mb =============================== -* `325`: Implements a scenario with keyrings.cryptfile for get_password, set_password (2021-01-10) +* #325: Implements a scenario with keyrings.cryptfile for get_password, set_password (2021-01-10) 1.10.3508 - 2021-01-08 - 2.10Mb =============================== -* `324`: Fixes issue with jupyter-client-6.1.10 on Windows (2021-01-08) +* #324: Fixes issue with jupyter-client-6.1.10 on Windows (2021-01-08) 1.10.3495 - 2020-12-31 - 2.10Mb =============================== -* `314`: fixes function _process_notebooks_in_private for newer version of nbconvert + missing file rst.tpl (2020-12-31) -* `323`: Add function assert_almost_equal_detailed with more feedback (2020-12-10) -* `322`: Implements function testlog to log information around a test function (2020-11-14) -* `321`: svg2png fails after cairosvg update (2020-11-11) -* `320`: Fix notebook links on github when inserted into the documentation (2020-11-11) -* `318`: Add function to download url content in a folder and a local link from it (2020-10-11) -* `312`: use twine to publish a package (2020-10-11) -* `310`: Add common interface to retrieve password with keyring (2020-10-11) -* `317`: fLOG shoud return the first object sent as argument (2020-09-30) -* `316`: Fix issue when image name for .. image:: is a pattern (2020-09-22) -* `315`: Small fix for nbconvert 6.0.3 (2020-09-14) -* `313`: Update reveal.js (2020-09-05) -* `311`: Bump node-sass from 3.13.1 to 4.14.1 in /src/pyquickhelper/sphinxext/revealjs/templates/revealjs/static (2020-09-05) -* `309`: Add option linenos to extension runpython (2020-07-17) +* #314: fixes function _process_notebooks_in_private for newer version of nbconvert + missing file rst.tpl (2020-12-31) +* #323: Add function assert_almost_equal_detailed with more feedback (2020-12-10) +* #322: Implements function testlog to log information around a test function (2020-11-14) +* #321: svg2png fails after cairosvg update (2020-11-11) +* #320: Fix notebook links on github when inserted into the documentation (2020-11-11) +* #318: Add function to download url content in a folder and a local link from it (2020-10-11) +* #312: use twine to publish a package (2020-10-11) +* #310: Add common interface to retrieve password with keyring (2020-10-11) +* #317: fLOG shoud return the first object sent as argument (2020-09-30) +* #316: Fix issue when image name for .. image:: is a pattern (2020-09-22) +* #315: Small fix for nbconvert 6.0.3 (2020-09-14) +* #313: Update reveal.js (2020-09-05) +* #311: Bump node-sass from 3.13.1 to 4.14.1 in /src/pyquickhelper/sphinxext/revealjs/templates/revealjs/static (2020-09-05) +* #309: Add option linenos to extension runpython (2020-07-17) 1.9.3418 - 2020-07-09 - 2.06Mb ============================== -* `307`: Add a function to plot a graph on a matplotlib (2020-07-07) -* `306`: Remove numpydoc added by default, it fails with other extensions (2020-06-28) -* `305`: docassert does not work on numpydoc (2020-06-23) +* #307: Add a function to plot a graph on a matplotlib (2020-07-07) +* #306: Remove numpydoc added by default, it fails with other extensions (2020-06-28) +* #305: docassert does not work on numpydoc (2020-06-23) 1.9.3396 - 2020-06-08 - 2.06Mb ============================== -* `304`: Implements a simpler version of ignore_warnings (2020-06-07) +* #304: Implements a simpler version of ignore_warnings (2020-06-07) 1.9.3393 - 2020-06-03 - 2.06Mb ============================== -* `303`: Add parameter squeeze to assertEqualArray (2020-06-03) -* `302`: Implements method assertLogging in ExtTestCase (2020-05-10) -* `301`: Implements method assertWarning in ExtTestCase (2020-05-10) -* `300`: Use fire instead of docutils to parse function documentation in cli (2020-05-02) -* `298`: SingleFileHTMLBuilder is deprecated in Sphinx (2020-04-07) +* #303: Add parameter squeeze to assertEqualArray (2020-06-03) +* #302: Implements method assertLogging in ExtTestCase (2020-05-10) +* #301: Implements method assertWarning in ExtTestCase (2020-05-10) +* #300: Use fire instead of docutils to parse function documentation in cli (2020-05-02) +* #298: SingleFileHTMLBuilder is deprecated in Sphinx (2020-04-07) 1.9.3359 - 2020-04-06 - 2.06Mb ============================== -* `297`: Fix import issue with sphinx==3.0.0 (2020-04-05) +* #297: Fix import issue with sphinx==3.0.0 (2020-04-05) 1.9.3350 - 2020-03-16 - 2.06Mb ============================== -* `296`: Automatically modifies __init__.py with git number version (2020-03-12) -* `295`: Speed up import time of ExtTestCase (2020-02-28) -* `294`: Rename command line process_notebook into convert_notebook (2020-02-20) -* `293`: Fix notebook format after execution (function run_notebook) (2020-02-20) -* `292`: Add command line to run notebook (2020-02-19) +* #296: Automatically modifies __init__.py with git number version (2020-03-12) +* #295: Speed up import time of ExtTestCase (2020-02-28) +* #294: Rename command line process_notebook into convert_notebook (2020-02-20) +* #293: Fix notebook format after execution (function run_notebook) (2020-02-20) +* #292: Add command line to run notebook (2020-02-19) 1.9.3325 - 2020-02-12 - 2.06Mb ============================== -* `291`: Sphinx extension bigger fails with sphinx 2.4.1 (2020-02-12) -* `290`: Issue raised with pandas.set_option in class BenchMark (2020-02-02) -* `289`: Fix notebook conversion after nbconvert update (minor_version=0, ...) (2020-01-14) +* #291: Sphinx extension bigger fails with sphinx 2.4.1 (2020-02-12) +* #290: Issue raised with pandas.set_option in class BenchMark (2020-02-02) +* #289: Fix notebook conversion after nbconvert update (minor_version=0, ...) (2020-01-14) 1.9.3299 - 2020-01-02 - 2.06Mb ============================== -* `288`: Fix build for python 3.8 (2020-01-02) +* #288: Fix build for python 3.8 (2020-01-02) 1.9.3289 - 2019-12-16 - 2.06Mb ============================== -* `287`: Fix pyquickhelper for coverage 5.0 (2019-12-16) -* `286`: Fix pyquickhelper for sphinx 2.3.0 (2019-12-16) +* #287: Fix pyquickhelper for coverage 5.0 (2019-12-16) +* #286: Fix pyquickhelper for sphinx 2.3.0 (2019-12-16) 1.9.3280 - 2019-12-13 - 2.06Mb ============================== -* `285`: Make ftp command line work with keyring (2019-12-08) -* `284`: Implements untar_files for .tar.gz extensions (2019-11-25) -* `283`: Add a command line to publish a file through ftp and ftps (2019-11-25) -* `282`: Write a function to run a function every n seconds (2019-11-22) -* `281`: Removes use of specific versions of nbconvert and pylzma. (2019-11-11) -* `280`: Removes conversion from notebook to nbpresent (2019-11-10) +* #285: Make ftp command line work with keyring (2019-12-08) +* #284: Implements untar_files for .tar.gz extensions (2019-11-25) +* #283: Add a command line to publish a file through ftp and ftps (2019-11-25) +* #282: Write a function to run a function every n seconds (2019-11-22) +* #281: Removes use of specific versions of nbconvert and pylzma. (2019-11-11) +* #280: Removes conversion from notebook to nbpresent (2019-11-10) 1.9.3248 - 2019-11-06 - 2.05Mb ============================== -* `279`: Add method assertEqualSparseArray (2019-11-06) -* `277`: Grammar and spelling fixes. (2019-11-06) -* `278`: Add simple command line to merge multiple images into one PDF (2019-11-04) -* `276`: Add function to make white transparent in an image. (2019-10-28) +* #279: Add method assertEqualSparseArray (2019-11-06) +* #277: Grammar and spelling fixes. (2019-11-06) +* #278: Add simple command line to merge multiple images into one PDF (2019-11-04) +* #276: Add function to make white transparent in an image. (2019-10-28) 1.9.3240 - 2019-10-21 - 2.05Mb ============================== -* `275`: Add six to the module to ignore in _filter_out_warning (2019-10-21) -* `255`: Moves blog generation inside sphinx (2019-10-09) - -1.9.3227 - 2019-09-22 - 2.05Mb -============================== - -* `274`: Add parameter min_size to check wrong downloads in function read_content_ufs (2019-09-22) - -1.9.3221 - 2019-09-20 - 2.05Mb -============================== - -* `273`: Extend FTP functionalities to SFTP (2019-09-19) -* `272`: Improves df2rst by splitting into columns to have smaller dataframes to display (2019-09-05) -* `271`: Add parameter split to function df2rst to introduce section in the output (2019-09-05) -* `270`: Adds a function to zoom in, zoom out images + command line (2019-09-01) -* `269`: Fix github links if the sources are not inside a subfolder src (2019-09-01) -* `268`: Fix bool parsing in create_cli_parser (2019-08-27) - -1.9.3192 - 2019-08-26 - 2.05Mb -============================== - -* `267`: Skips a given list of issues when producing the history (2019-08-26) -* `266`: add option to local_jenkins to specify a different jenkins server (2019-08-25) -* `264`: Implements function unittest_require_at_least to skip a unit test requiring a more recent version of a package (2019-08-02) -* `263`: Skip type cells of type 'vnd.plotly.v1+json' when extracting snippets of a notebook (2019-07-30) -* `262`: Issue with jupyter_sphinx 0.2.0 (sphinx extension) (2019-07-17) -* `261`: add option :store_in_file: to runpython extension (to be able to use inspect.getsource) (2019-07-09) -* `260`: Allow the use of pyinstrument when profiling a function (2019-07-05) -* `259`: implement capture in ExtTestCase to capture stdout, stderr (2019-06-28) -* `258`: force positional arguments in create_cli_parser (2019-06-27) -* `254`: Implements gdot to skip graphviz and render dot file with viz.js (2019-06-18) -* `253`: fix links in exreflist (2019-06-15) -* `252`: expose parameter fxeclude to avoid including them in the documentation (2019-06-15) -* `251`: Switch to Sphinx 2.1, remove specific code for older versions (2019-06-03) -* `250`: fix errors introduced by installing sphinx 2.1 (2019-06-03) -* `238`: add simple function to profile and command line, implements a graph as well (2019-05-27) -* `248`: add option numpy_precision in runpython (2019-05-05) -* `247`: Use of command in setup.py (2019-04-25) -* `246`: Supports projects without src folder (2019-04-25) -* `245`: make test pass for sphinx 2.0.0 (2019-03-30) -* `244`: remove need of __init__.py in folder src, do not import conf.py in the same process while generating the documentation (2019-03-25) -* `243`: refactor unit tests (2019-03-20) -* `242`: add command line sphinx_rst to convert rst document (2019-03-16) -* `239`: add sphinx directive to add date of the latest commit (2019-03-16) -* `240`: replaces separator ; by ;; in yaml files when dealing with conditional instructions (2019-03-04) -* `236`: command line is slow (2019-03-01) -* `237`: add parameter number_format to df2rst (2019-02-28) -* `235`: removes FutureWarning when using ExtTestClass (2019-02-24) -* `234`: fix RSS stream (2019-02-21) -* `233`: add a function to run all test function in a file (2019-02-14) -* `232`: Missing blog posts between two pages (2019-01-28) -* `230`: autosignature does not work for C++ function in cpyquickhelper (2019-01-19) -* `229`: remove specific code for python2 (2019-01-12) -* `228`: fix missing jpg images in documentation (2019-01-09) -* `227`: makes more functions available from command line (2019-01-08) -* `226`: fix command line name when created from a function (2019-01-08) -* `225`: add class BufferedPrint to retrieve logging through fLOG (2019-01-07) -* `224`: add process_notebooks in the list of function available through the command line (2019-01-06) -* `223`: jenkins script: distringuish between script and linux instruction if (2019-01-04) -* `222`: update jenkins job cleanup options (2019-01-03) -* `221`: ignore errors when combining reports (2019-01-02) -* `220`: creates a GUI for the command line window (2018-12-31) -* `219`: Add default negative pattern when cleaning files in a folder (2018-12-31) -* `217`: remove unnecessary logging when generating sphinx documentation (2018-12-20) -* `216`: conversion of notebook including svg fails (2018-12-18) -* `215`: add quote_node for quotations (sphinx) (2018-12-18) -* `214`: fix issue with neg_pattern in explore_folder_iterfile (2018-12-11) -* `213`: removes cmdref from documentation when creating a parser for a function (2018-12-10) -* `212`: issue when the default value is None when building the parser for a specific function (2018-12-09) -* `211`: automatically git tag when publishing (2018-12-05) -* `210`: add __main__ command line (2018-11-29) -* `209`: implements function retrieve_notebooks_in_folder (2018-11-25) -* `208`: update to azure CI (2018-11-25) -* `205`: Slides conversion are missing from the documentation (2018-11-09) -* `204`: Fix missing snippet for notebook when it fails finding one (2018-11-06) -* `203`: make epkg links anonymous to avoid warning about duplicated target (2018-11-05) -* `202`: make runpython keep context from one execution to the next one (2018-11-01) -* `201`: handle language options in runpython and rst builder (2018-11-01) -* `200`: ignore issue E402 when applying autopep8 (move import at the top of the file) (2018-10-28) -* `199`: better logging in synchronisation_folder (2018-10-14) -* `198`: broken links in the documentation (magic command ,example) (2018-10-14) -* `197`: do not raise exception if latex is not found when using rst2html (2018-10-06) -* `196`: add function add_rst_links to automatically add links into one string (2018-10-04) -* `195`: implement a doctree outputter (2018-09-19) -* `194`: check why call an extension from the setup is different from adding it to the list of extensions (2018-09-19) -* `193`: fix an issue when converting a werzeug object into string (2018-09-17) -* `192`: resolve issues with image and sphinx (2018-09-16) -* `191`: implement latex custom builder for rst2html (2018-09-16) -* `190`: Take dependency on Sphinx >= 1.8 (2018-09-13) -* `189`: fix import issue with update to Sphinx 1.8.0 (2018-09-13) -* `188`: add supports for images in rst and md writers (2018-09-12) -* `187`: fix bug in doxypy when class definition is followed by a commentary (2018-09-12) -* `186`: remove for role ref when converting a string rst into html or rst (2018-09-08) -* `185`: add markdown rst converter (2018-09-08) -* `184`: add tag :orphan: to additional files (2018-09-08) -* `183`: use svg image for formula in HTML and png in latex (2018-08-27) -* `182`: implementation of a backup plan if downloading require.js fails (2018-08-27) -* `181`: fix an issue when combining coverage_report after the unit tests passed (2018-08-24) -* `180`: add parameter persistent to get_temp_folder (2018-08-24) -* `179`: put a default value for neg_pattern if it is none to avoid known folders (function check_pep8) (2018-08-23) -* `178`: add parameter delay to wait between two files being transferred through FTP (2018-08-23) -* `177`: remove ping helper (2018-08-20) -* `163`: fix automation for Jenkins on linux (2018-08-20) -* `32`: add command local_jenkins for setup.py (2018-08-20) -* `176`: add margin around toggle button (sphinx) (2018-08-19) -* `175`: removes output title if toggle option is used (2018-08-19) -* `174`: changes runpython titles into <<< and >>> (2018-08-19) -* `173`: add option current to runpython to run a script in the folder of the source file which contains it (2018-08-19) -* `172`: rst2html: parameters directives allows single directive with no new nodes (2018-08-19) -* `171`: allow a class to modify the script to run in runpython sphinx directive (2018-08-18) -* `170`: add option syspath for autosignature (2018-08-05) -* `169`: add option debug to autosignature (2018-08-05) -* `168`: documentation does not produce a page for a compiled module in pure C++ (not with pybind11) (2018-08-05) -* `166`: fix github link when link points to a compile module (2018-08-05) -* `167`: autosignature fails for function implemented in pure C++ (not with pybind11) (2018-08-04) -* `165`: documentation does not automatically generate .rst for module written in C (2018-08-04) -* `164`: improve autosignature for builtin function (2018-08-03) -* `162`: reduce the impact of RuntimeError: Kernel died before replying to kernel_info (2018-07-29) -* `161`: fix unit test test_build_script on appveyor (2018-07-28) -* `160`: notebook server remains open if an exception happens during the execution (2018-07-25) -* `159`: fix a bug with pylint version (2018-07-23) -* `158`: replaces clock by perf_counter (2018-07-22) -* `156`: fix issue with update to python-jenkins 1.1.0 (2018-07-22) -* `155`: fix issue with pylint 2.0 (2018-07-22) -* `154`: notebook coverage add color (2018-05-27) -* `153`: fix message "do not understand why t1 >= t2 for file %s" % full (2018-05-27) -* `151`: bug in autosignature, shorten path does not work for static method (2018-05-24) -* `150`: hide warnings produced by add_missing_development_version (2018-05-23) -* `149`: modifies autosignature to display the shortest import way (2018-05-19) -* `148`: fix unit test test_changes_graph (pandas update) (2018-05-17) -* `146`: remove raise ... (...) from e in setup.py (2018-05-17) -* `145`: add a script to launch scite on windows with the right path (2018-05-13) -* `144`: disable sphinx gallery extension if no example (2018-05-11) -* `143`: add setup option to run pylint (2018-05-11) -* `142`: look for the files which makes pylint crash on Windows (2018-05-11) -* `141`: check_pep8 does not detect line too long and unused variables (use of pylint) (2018-05-11) -* `140`: modify assertEqualArray to allow small different (assert_almost_equal) (2018-05-07) -* `138`: retrieve past issues in history.rst (2018-05-06) -* `139`: update to python-jenkins 1.0.0 (2018-05-05) -* `137`: fix bug in bug HTML output (aggregated pages) (2018-04-29) -* `136`: add parameter create_dest to synchronize_folder (2018-04-29) -* `135`: fix for sphinx 1.7.3 (circular reference) (2018-04-22) -* `134`: allow url in video sphinx extension (2018-04-22) -* `133`: add a collapsible container, adapt it for runpython (2018-04-22) -* `132`: catch warning in run_python_script output, use redirect_stdout (2018-04-21) -* `131`: remove warning in runpython (2018-04-21) -* `130`: add plot output for runpython (2018-04-21) -* `129`: implement an easy way to profile a function in unit test (2018-04-19) -* `128`: fix issue in enumerate_pypi_versions_date (2018-04-14) -* `127`: update to pip 10 (many API changes) (2018-04-14) -* `126`: remove dependency on flake8, use pycodestyle (2018-04-13) -* `125`: fix sharenet for rst format (2018-04-05) -* `124`: add CodeNode in rst builder (2018-04-05) -* `123`: fix style for blogpostagg, remove inserted admonition (2018-04-05) -* `122`: fix notebook name when converting into rst (collision with html) (2018-04-05) -* `121`: extend list of functions in ExtTestCase (NotEqual, Greater(strict=True), NotEmpty (2018-04-01) -* `120`: add _fieldlist_row_index if missing in HTMLTranslatorWithCustomDirectives (2018-04-01) -* `119`: collision with image names in notebooks converted into rst (2018-03-29) -* `117`: bug with nbneg_pattern, check unit test failing due to that (2018-03-26) -* `116`: add tag .. raw:: html in notebook converted into rst (2018-03-26) -* `114`: automatically builds history with release and issues + add command history in setup (2018-03-24) -* `111`: enable manual snippet for notebook, repace add_notebook_menu by toctree in sphinx (2018-03-20) -* `113`: propose a fix for a bug introduced by pip 9.0.2 (2018-03-19) -* `112`: allow to set custom snippets for notebooks (2018-03-15) -* `109`: run javascript producing svg and convert it into png (2018-03-15) -* `107`: convert svg into png for notebook snippets (2018-03-12) -* `108`: add command lab, creates a script to start jupyter lab on notebook folder (2018-03-10) -* `106`: replace pdflatex by xelatex to handle utf-8 (2018-03-03) -* `104`: implement visit, depart for pending_xref and rst translator (2018-03-01) -* `103`: fix import issue for Sphinx 1.7.1 (2018-03-01) -* `102`: fix sphinx command line (2018-02-24) -* `100`: fix indentation when copying the sources in documentation repository (2018-02-04) -* `99`: bug with galleries of examples with multiple subfolders (2018-01-30) +* #275: Add six to the module to ignore in _filter_out_warning (2019-10-21) +* #255: Moves blog generation inside sphinx (2019-10-09) +* #274: Add parameter min_size to check wrong downloads in function read_content_ufs (2019-09-22) +* #273: Extend FTP functionalities to SFTP (2019-09-19) +* #272: Improves df2rst by splitting into columns to have smaller dataframes to display (2019-09-05) +* #271: Add parameter split to function df2rst to introduce section in the output (2019-09-05) +* #270: Adds a function to zoom in, zoom out images + command line (2019-09-01) +* #269: Fix github links if the sources are not inside a subfolder src (2019-09-01) +* #268: Fix bool parsing in create_cli_parser (2019-08-27) +* #267: Skips a given list of issues when producing the history (2019-08-26) +* #266: add option to local_jenkins to specify a different jenkins server (2019-08-25) +* #264: Implements function unittest_require_at_least to skip a unit test requiring a more recent version of a package (2019-08-02) +* #263: Skip type cells of type 'vnd.plotly.v1+json' when extracting snippets of a notebook (2019-07-30) +* #262: Issue with jupyter_sphinx 0.2.0 (sphinx extension) (2019-07-17) +* #261: add option :store_in_file: to runpython extension (to be able to use inspect.getsource) (2019-07-09) +* #260: Allow the use of pyinstrument when profiling a function (2019-07-05) +* #259: implement capture in ExtTestCase to capture stdout, stderr (2019-06-28) +* #258: force positional arguments in create_cli_parser (2019-06-27) +* #254: Implements gdot to skip graphviz and render dot file with viz.js (2019-06-18) +* #253: fix links in exreflist (2019-06-15) +* #252: expose parameter fxeclude to avoid including them in the documentation (2019-06-15) +* #251: Switch to Sphinx 2.1, remove specific code for older versions (2019-06-03) +* #250: fix errors introduced by installing sphinx 2.1 (2019-06-03) +* #238: add simple function to profile and command line, implements a graph as well (2019-05-27) +* #248: add option numpy_precision in runpython (2019-05-05) +* #247: Use of command in setup.py (2019-04-25) +* #246: Supports projects without src folder (2019-04-25) +* #245: make test pass for sphinx 2.0.0 (2019-03-30) +* #244: remove need of __init__.py in folder src, do not import conf.py in the same process while generating the documentation (2019-03-25) +* #243: refactor unit tests (2019-03-20) +* #242: add command line sphinx_rst to convert rst document (2019-03-16) +* #239: add sphinx directive to add date of the latest commit (2019-03-16) +* #240: replaces separator ; by ;; in yaml files when dealing with conditional instructions (2019-03-04) +* #236: command line is slow (2019-03-01) +* #237: add parameter number_format to df2rst (2019-02-28) +* #235: removes FutureWarning when using ExtTestClass (2019-02-24) +* #234: fix RSS stream (2019-02-21) +* #233: add a function to run all test function in a file (2019-02-14) +* #232: Missing blog posts between two pages (2019-01-28) +* #230: autosignature does not work for C++ function in cpyquickhelper (2019-01-19) +* #229: remove specific code for python2 (2019-01-12) +* #228: fix missing jpg images in documentation (2019-01-09) +* #227: makes more functions available from command line (2019-01-08) +* #226: fix command line name when created from a function (2019-01-08) +* #225: add class BufferedPrint to retrieve logging through fLOG (2019-01-07) +* #224: add process_notebooks in the list of function available through the command line (2019-01-06) +* #223: jenkins script: distringuish between script and linux instruction if (2019-01-04) +* #222: update jenkins job cleanup options (2019-01-03) +* #221: ignore errors when combining reports (2019-01-02) +* #220: creates a GUI for the command line window (2018-12-31) +* #219: Add default negative pattern when cleaning files in a folder (2018-12-31) +* #217: remove unnecessary logging when generating sphinx documentation (2018-12-20) +* #216: conversion of notebook including svg fails (2018-12-18) +* #215: add quote_node for quotations (sphinx) (2018-12-18) +* #214: fix issue with neg_pattern in explore_folder_iterfile (2018-12-11) +* #213: removes cmdref from documentation when creating a parser for a function (2018-12-10) +* #212: issue when the default value is None when building the parser for a specific function (2018-12-09) +* #211: automatically git tag when publishing (2018-12-05) +* #210: add __main__ command line (2018-11-29) +* #209: implements function retrieve_notebooks_in_folder (2018-11-25) +* #208: update to azure CI (2018-11-25) +* #205: Slides conversion are missing from the documentation (2018-11-09) +* #204: Fix missing snippet for notebook when it fails finding one (2018-11-06) +* #203: make epkg links anonymous to avoid warning about duplicated target (2018-11-05) +* #202: make runpython keep context from one execution to the next one (2018-11-01) +* #201: handle language options in runpython and rst builder (2018-11-01) +* #200: ignore issue E402 when applying autopep8 (move import at the top of the file) (2018-10-28) +* #199: better logging in synchronisation_folder (2018-10-14) +* #198: broken links in the documentation (magic command ,example) (2018-10-14) +* #197: do not raise exception if latex is not found when using rst2html (2018-10-06) +* #196: add function add_rst_links to automatically add links into one string (2018-10-04) +* #195: implement a doctree outputter (2018-09-19) +* #194: check why call an extension from the setup is different from adding it to the list of extensions (2018-09-19) +* #193: fix an issue when converting a werzeug object into string (2018-09-17) +* #192: resolve issues with image and sphinx (2018-09-16) +* #191: implement latex custom builder for rst2html (2018-09-16) +* #190: Take dependency on Sphinx >= 1.8 (2018-09-13) +* #189: fix import issue with update to Sphinx 1.8.0 (2018-09-13) +* #188: add supports for images in rst and md writers (2018-09-12) +* #187: fix bug in doxypy when class definition is followed by a commentary (2018-09-12) +* #186: remove for role ref when converting a string rst into html or rst (2018-09-08) +* #185: add markdown rst converter (2018-09-08) +* #184: add tag :orphan: to additional files (2018-09-08) +* #183: use svg image for formula in HTML and png in latex (2018-08-27) +* #182: implementation of a backup plan if downloading require.js fails (2018-08-27) +* #181: fix an issue when combining coverage_report after the unit tests passed (2018-08-24) +* #180: add parameter persistent to get_temp_folder (2018-08-24) +* #179: put a default value for neg_pattern if it is none to avoid known folders (function check_pep8) (2018-08-23) +* #178: add parameter delay to wait between two files being transferred through FTP (2018-08-23) +* #177: remove ping helper (2018-08-20) +* #163: fix automation for Jenkins on linux (2018-08-20) +* #32: add command local_jenkins for setup.py (2018-08-20) +* #176: add margin around toggle button (sphinx) (2018-08-19) +* #175: removes output title if toggle option is used (2018-08-19) +* #174: changes runpython titles into <<< and >>> (2018-08-19) +* #173: add option current to runpython to run a script in the folder of the source file which contains it (2018-08-19) +* #172: rst2html: parameters directives allows single directive with no new nodes (2018-08-19) +* #171: allow a class to modify the script to run in runpython sphinx directive (2018-08-18) +* #170: add option syspath for autosignature (2018-08-05) +* #169: add option debug to autosignature (2018-08-05) +* #168: documentation does not produce a page for a compiled module in pure C++ (not with pybind11) (2018-08-05) +* #166: fix github link when link points to a compile module (2018-08-05) +* #167: autosignature fails for function implemented in pure C++ (not with pybind11) (2018-08-04) +* #165: documentation does not automatically generate .rst for module written in C (2018-08-04) +* #164: improve autosignature for builtin function (2018-08-03) +* #162: reduce the impact of RuntimeError: Kernel died before replying to kernel_info (2018-07-29) +* #161: fix unit test test_build_script on appveyor (2018-07-28) +* #160: notebook server remains open if an exception happens during the execution (2018-07-25) +* #159: fix a bug with pylint version (2018-07-23) +* #158: replaces clock by perf_counter (2018-07-22) +* #156: fix issue with update to python-jenkins 1.1.0 (2018-07-22) +* #155: fix issue with pylint 2.0 (2018-07-22) +* #154: notebook coverage add color (2018-05-27) +* #153: fix message "do not understand why t1 >= t2 for file %s" % full (2018-05-27) +* #151: bug in autosignature, shorten path does not work for static method (2018-05-24) +* #150: hide warnings produced by add_missing_development_version (2018-05-23) +* #149: modifies autosignature to display the shortest import way (2018-05-19) +* #148: fix unit test test_changes_graph (pandas update) (2018-05-17) +* #146: remove raise ... (...) from e in setup.py (2018-05-17) +* #145: add a script to launch scite on windows with the right path (2018-05-13) +* #144: disable sphinx gallery extension if no example (2018-05-11) +* #143: add setup option to run pylint (2018-05-11) +* #142: look for the files which makes pylint crash on Windows (2018-05-11) +* #141: check_pep8 does not detect line too long and unused variables (use of pylint) (2018-05-11) +* #140: modify assertEqualArray to allow small different (assert_almost_equal) (2018-05-07) +* #138: retrieve past issues in history.rst (2018-05-06) +* #139: update to python-jenkins 1.0.0 (2018-05-05) +* #137: fix bug in bug HTML output (aggregated pages) (2018-04-29) +* #136: add parameter create_dest to synchronize_folder (2018-04-29) +* #135: fix for sphinx 1.7.3 (circular reference) (2018-04-22) +* #134: allow url in video sphinx extension (2018-04-22) +* #133: add a collapsible container, adapt it for runpython (2018-04-22) +* #132: catch warning in run_python_script output, use redirect_stdout (2018-04-21) +* #131: remove warning in runpython (2018-04-21) +* #130: add plot output for runpython (2018-04-21) +* #129: implement an easy way to profile a function in unit test (2018-04-19) +* #128: fix issue in enumerate_pypi_versions_date (2018-04-14) +* #127: update to pip 10 (many API changes) (2018-04-14) +* #126: remove dependency on flake8, use pycodestyle (2018-04-13) +* #125: fix sharenet for rst format (2018-04-05) +* #124: add CodeNode in rst builder (2018-04-05) +* #123: fix style for blogpostagg, remove inserted admonition (2018-04-05) +* #122: fix notebook name when converting into rst (collision with html) (2018-04-05) +* #121: extend list of functions in ExtTestCase (NotEqual, Greater(strict=True), NotEmpty (2018-04-01) +* #120: add _fieldlist_row_index if missing in HTMLTranslatorWithCustomDirectives (2018-04-01) +* #119: collision with image names in notebooks converted into rst (2018-03-29) +* #117: bug with nbneg_pattern, check unit test failing due to that (2018-03-26) +* #116: add tag .. raw:: html in notebook converted into rst (2018-03-26) +* #114: automatically builds history with release and issues + add command history in setup (2018-03-24) +* #111: enable manual snippet for notebook, repace add_notebook_menu by toctree in sphinx (2018-03-20) +* #113: propose a fix for a bug introduced by pip 9.0.2 (2018-03-19) +* #112: allow to set custom snippets for notebooks (2018-03-15) +* #109: run javascript producing svg and convert it into png (2018-03-15) +* #107: convert svg into png for notebook snippets (2018-03-12) +* #108: add command lab, creates a script to start jupyter lab on notebook folder (2018-03-10) +* #106: replace pdflatex by xelatex to handle utf-8 (2018-03-03) +* #104: implement visit, depart for pending_xref and rst translator (2018-03-01) +* #103: fix import issue for Sphinx 1.7.1 (2018-03-01) +* #102: fix sphinx command line (2018-02-24) +* #100: fix indentation when copying the sources in documentation repository (2018-02-04) +* #99: bug with galleries of examples with multiple subfolders (2018-01-30) diff --git a/_unittests/ut_helpgen/test_history.py b/_unittests/ut_helpgen/test_history.py index dcdce54d..ca601c18 100644 --- a/_unittests/ut_helpgen/test_history.py +++ b/_unittests/ut_helpgen/test_history.py @@ -33,7 +33,7 @@ def test_format_history_release(self): **Bugfix** * `46`: update to Sphinx 1.6 - * `54`: fix searchbox for `sphinx_rtd_theme `_ + * #54: fix searchbox for `sphinx_rtd_theme `_ **Features** @@ -68,7 +68,7 @@ def test_format_history_release(self): * :release:`1.4.2 <2016-09-18>` """.replace(" ", "") - self.assertEqual(content.strip(" \r\n\t"), expect.strip(" \r\n\t")) + self.assertEqual(expect.strip(" \r\n\t"), content.strip(" \r\n\t")) def test_format_history_basic(self): fLOG( @@ -175,4 +175,5 @@ def test_format_history_long(self): if __name__ == "__main__": + TestPaths().test_format_history_release() unittest.main() diff --git a/_unittests/ut_loghelper/test_history_helper.py b/_unittests/ut_loghelper/test_history_helper.py index fc696b37..beb1f9b5 100644 --- a/_unittests/ut_loghelper/test_history_helper.py +++ b/_unittests/ut_loghelper/test_history_helper.py @@ -102,7 +102,7 @@ def test_history_existing(self): self.assertGreater(nb, 1) output = compile_history(history) - self.assertIn('* `139`:', output) + self.assertIn('* #139:', output) nb = 0 for h in history: rel = h['release'] diff --git a/_unittests/ut_sphinxext/test_template_extension.py b/_unittests/ut_sphinxext/test_template_extension.py index 1c4afaae..522917a5 100644 --- a/_unittests/ut_sphinxext/test_template_extension.py +++ b/_unittests/ut_sphinxext/test_template_extension.py @@ -16,6 +16,16 @@ class TestTemplateExtension(unittest.TestCase): + def test_python_link_doc(self): + link = python_link_doc("os") + self.assertEqual( + link, + "`os `_") + link = python_link_doc("os", "getcwd") + self.assertEqual( + link, + "`os.getcwd `_") + def test_tpl_inline(self): fLOG( __file__, diff --git a/src/pyquickhelper/benchhelper/grid_benchmark.py b/src/pyquickhelper/benchhelper/grid_benchmark.py index a88202a6..319abee5 100644 --- a/src/pyquickhelper/benchhelper/grid_benchmark.py +++ b/src/pyquickhelper/benchhelper/grid_benchmark.py @@ -177,7 +177,7 @@ def bench(self, **params): appe["_btry"] = metrics["_btry"] if "_i" in metrics: - del metrics["_i"] + del metrics["_i"] # pragma: no cover results.append((metrics, appe)) return results diff --git a/src/pyquickhelper/cli/cli_helper.py b/src/pyquickhelper/cli/cli_helper.py index e67a6f23..52a8f23e 100644 --- a/src/pyquickhelper/cli/cli_helper.py +++ b/src/pyquickhelper/cli/cli_helper.py @@ -464,4 +464,4 @@ def call_gui_function(dfct, fLOG=print, utest=False): win = main_loop_functions(dfct, title="{0} command line".format(modname), mainloop=not utest) return win - return None + return None # pragma: no cover diff --git a/src/pyquickhelper/cli/simplified_fct.py b/src/pyquickhelper/cli/simplified_fct.py index 885e7c24..034e6107 100644 --- a/src/pyquickhelper/cli/simplified_fct.py +++ b/src/pyquickhelper/cli/simplified_fct.py @@ -105,7 +105,7 @@ def sphinx_rst(input="", writer="html", keep_warnings=False, os.path.exists(input)): content = read_content_ufs(input) else: - content = input + content = input # pragma: no cover if directives: raise NotImplementedError( "Cannot specify directives yet.") # pragma: no cover diff --git a/src/pyquickhelper/filehelper/download_urls_helper.py b/src/pyquickhelper/filehelper/download_urls_helper.py index 4c3d8fe6..7d36bca2 100644 --- a/src/pyquickhelper/filehelper/download_urls_helper.py +++ b/src/pyquickhelper/filehelper/download_urls_helper.py @@ -51,7 +51,8 @@ def download_urls_in_folder_content(folder, pattern=".+[.]((py)|(ipynb))", neg_p if len(fall) == 0: continue if fLOG is not None: - fLOG("[download_urls_in_folder_content] explore '{}'".format(obj)) + fLOG( # pragma: no cover + "[download_urls_in_folder_content] explore '{}'".format(obj)) urls = [f[0] for f in fall] r = get_urls_content_timeout(urls, folder=folder_dest, timeout=timeout, raise_exception=raise_exception, chunk=chunk, diff --git a/src/pyquickhelper/filehelper/file_info.py b/src/pyquickhelper/filehelper/file_info.py index 6c036003..7ae7a71b 100644 --- a/src/pyquickhelper/filehelper/file_info.py +++ b/src/pyquickhelper/filehelper/file_info.py @@ -19,7 +19,8 @@ def convert_st_date_to_datetime(t): if isinstance(t, str): if "." in t: return datetime.datetime.strptime(t, "%Y-%m-%d %H:%M:%S.%f") - return datetime.datetime.strptime(t, "%Y-%m-%d %H:%M:%S") + return datetime.datetime.strptime( # pragma: no cover + t, "%Y-%m-%d %H:%M:%S") return datetime.datetime.fromtimestamp(t) diff --git a/src/pyquickhelper/filehelper/ftp_mock.py b/src/pyquickhelper/filehelper/ftp_mock.py index 917abcd5..69f782cf 100644 --- a/src/pyquickhelper/filehelper/ftp_mock.py +++ b/src/pyquickhelper/filehelper/ftp_mock.py @@ -25,28 +25,28 @@ def run_command(self, command, *args, **kwargs): """ if command == self._ftp.mlsd and args == ('.',): return [('setup.py', {'name': 'setup.py'})] - elif command == self._ftp.cwd and args == ('.',): + if command == self._ftp.cwd and args == ('.',): return None - elif command == self._ftp.pwd and len(args) == 0: + if command == self._ftp.pwd and len(args) == 0: return "." - elif command == self._ftp.cwd and args == ('..',): + if command == self._ftp.cwd and args == ('..',): return None - elif command == self._ftp.storbinary and args[0] == 'STOR test_transfer_ftp.py': + if command == self._ftp.storbinary and args[0] == 'STOR test_transfer_ftp.py': self._store[args[0]] = args return None - elif command == self._ftp.retrbinary and args[0] == 'RETR test_transfer_ftp.py': + if command == self._ftp.retrbinary and args[0] == 'RETR test_transfer_ftp.py': b = self._store[args[0].replace("RETR", "STOR")][1] return b'ee' - elif command == self._ftp.cwd and args == ('backup',): + if command == self._ftp.cwd and args == ('backup',): self._store[args[0]] = args return None - elif command == self._ftp.storbinary and args[0] == 'STOR setup.py': + if command == self._ftp.storbinary and args[0] == 'STOR setup.py': self._store[args[0]] = args return None - elif command == self._ftp.retrbinary and args[0] == 'RETR setup.py': + if command == self._ftp.retrbinary and args[0] == 'RETR setup.py': b = self._store[args[0].replace("RETR", "STOR")][1] s = b.getbuffer() args[1](s) return len(s) - else: - raise Exception("command='{0}'\nargs={1}".format(command, args)) + raise RuntimeError( # pragma: no cover + "command='{0}'\nargs={1}".format(command, args)) diff --git a/src/pyquickhelper/filehelper/transfer_api.py b/src/pyquickhelper/filehelper/transfer_api.py index 13e5a586..d85b23e8 100644 --- a/src/pyquickhelper/filehelper/transfer_api.py +++ b/src/pyquickhelper/filehelper/transfer_api.py @@ -79,7 +79,7 @@ def transfer(self, path, data): @param path path to remove location @return boolean """ - raise NotImplementedError() + raise NotImplementedError() # pragma: no cover def retrieve(self, path, exc=True): """ @@ -89,7 +89,7 @@ def retrieve(self, path, exc=True): @param exc keep exception @return data """ - raise NotImplementedError() + raise NotImplementedError() # pragma: no cover def retrieve_mapping(self, decrypt): """ @@ -101,8 +101,7 @@ def retrieve_mapping(self, decrypt): m = self.retrieve("__mapping__", exc=False) if m is None: return {} - else: - return TransferAPI.bytes2mapping(m) + return TransferAPI.bytes2mapping(m) def transfer_mapping(self, mapping, encrypt, filename=None): """ diff --git a/src/pyquickhelper/filehelper/transfer_api_file.py b/src/pyquickhelper/filehelper/transfer_api_file.py index 096879d2..f905bbc5 100644 --- a/src/pyquickhelper/filehelper/transfer_api_file.py +++ b/src/pyquickhelper/filehelper/transfer_api_file.py @@ -49,7 +49,6 @@ def retrieve(self, path, exc=True): if os.path.exists(src): with open(src, "rb") as f: return f.read() - elif exc: - raise FileNotFoundError(path) - else: - return None + if exc: + raise FileNotFoundError(path) # pragma: no cover + return None diff --git a/src/pyquickhelper/filehelper/visual_sync.py b/src/pyquickhelper/filehelper/visual_sync.py index 04fab939..a2a2862d 100644 --- a/src/pyquickhelper/filehelper/visual_sync.py +++ b/src/pyquickhelper/filehelper/visual_sync.py @@ -296,7 +296,7 @@ def create_visual_diff_through_html_files(file1, file2, encoding="utf8", page=No if page is not None: with open(page, "w", encoding="utf8") as f: f.write(diff) - if browser: + if browser: # pragma: no cover if page is None: raise AttributeError("browser is True, page must be True") import webbrowser diff --git a/src/pyquickhelper/helpgen/conf_path_tools.py b/src/pyquickhelper/helpgen/conf_path_tools.py index 7503a459..720b7337 100644 --- a/src/pyquickhelper/helpgen/conf_path_tools.py +++ b/src/pyquickhelper/helpgen/conf_path_tools.py @@ -20,7 +20,7 @@ def find_in_PATH(prog): for p in path.split(sep): f = os.path.join(p, prog) if os.path.exists(f): - return p + return p # pragma: no cover return None @@ -143,7 +143,7 @@ def custom_ensuredir(path): # 0 for Jython/Win32 EEXIST = getattr(errno, 'EEXIST', 0) if err.errno not in [0, EEXIST]: - raise + raise # pragma: no cover def find_dvipng_path(exc=True): diff --git a/src/pyquickhelper/helpgen/help_usage.py b/src/pyquickhelper/helpgen/help_usage.py index 618a78d2..074528a2 100644 --- a/src/pyquickhelper/helpgen/help_usage.py +++ b/src/pyquickhelper/helpgen/help_usage.py @@ -8,7 +8,8 @@ def get_help_usage(): """ Returns the usage ``python setup.py build_sphinx``. """ - return """ + return ( # pragma: no cover + """ This command will build the documentation form the source. It will not work from the installed package. This is a custom build, the regular options with build_sphinx will not work. @@ -17,4 +18,4 @@ def get_help_usage(): Usage: python setup.py build_sphinx - """.replace(" ", "") + """.replace(" ", "")) diff --git a/src/pyquickhelper/helpgen/markdown_helper.py b/src/pyquickhelper/helpgen/markdown_helper.py index 46109a3c..66810413 100644 --- a/src/pyquickhelper/helpgen/markdown_helper.py +++ b/src/pyquickhelper/helpgen/markdown_helper.py @@ -61,9 +61,10 @@ def clean_line(line): try: for (regex, sub) in regex_subs: line = regex.sub(sub, line) - except Exception as ex: - raise Exception("[sphinxerror]-A %s, (line(%s)" % - (regex, sub)) from ex + except Exception as ex: # pragma: no cover + raise RuntimeError( + "[sphinxerror]-A %s, (line(%s)" % ( + regex, sub)) from ex return line diff --git a/src/pyquickhelper/helpgen/notebook_exporter.py b/src/pyquickhelper/helpgen/notebook_exporter.py index 317c6392..96a87486 100644 --- a/src/pyquickhelper/helpgen/notebook_exporter.py +++ b/src/pyquickhelper/helpgen/notebook_exporter.py @@ -40,7 +40,7 @@ def process_raw_html(source, extra_args=None): :local: """ if source is None: - return source + return source # pragma: no cover if 'var update_menu = function() {' in source: return "\n\n.. contents::\n :local:\n\n" return "\n\n.. raw:: html\n\n" + indent(source, prefix=' ') diff --git a/src/pyquickhelper/helpgen/pandoc_helper.py b/src/pyquickhelper/helpgen/pandoc_helper.py index 3fc1a5e5..b0f3d955 100644 --- a/src/pyquickhelper/helpgen/pandoc_helper.py +++ b/src/pyquickhelper/helpgen/pandoc_helper.py @@ -19,7 +19,7 @@ def call_pandoc(params, fLOG=noLOG): cmd = '"{0}" {1}'.format(pandoc, params) out, err = run_cmd(cmd, wait=True, fLOG=fLOG) if err is not None and "Cannot decode byte" in err: - raise RuntimeError( + raise RuntimeError( # pragma: no cover "Issue with pandoc:\n{0}\n" "--OUT--\n{1}\n--ERR--\n{2}".format( cmd, out, err)) diff --git a/src/pyquickhelper/helpgen/post_process.py b/src/pyquickhelper/helpgen/post_process.py index 5a00ab00..2ddd6a63 100644 --- a/src/pyquickhelper/helpgen/post_process.py +++ b/src/pyquickhelper/helpgen/post_process.py @@ -104,7 +104,7 @@ def repipy(le): for k, v in sorted(nblinks.items())) extension = "You should add this link into the documentation " \ "configuration file in variable 'nblinks'." - raise HelpGenException( + raise HelpGenException( # pragma: no cover "A reference was not found: '{0}' - '{1}' " "format={2}, nblinks=\n{3}\n{4}".format( anc, url, format, mes, extension)) @@ -360,7 +360,8 @@ def startss(line): code = "".join( (_[4:] if _.startswith(" ") else _) for _ in lines[memopos + 1:pos]) if len(code) == 0: - fLOG("[post_process_rst_output] EMPTY-SECTION in ", file) + fLOG( # pragma: no cover + "[post_process_rst_output] EMPTY-SECTION in ", file) else: try: cmp = compile(code, "", "exec") diff --git a/src/pyquickhelper/helpgen/post_process_custom.py b/src/pyquickhelper/helpgen/post_process_custom.py index 8d1d5393..e47db925 100644 --- a/src/pyquickhelper/helpgen/post_process_custom.py +++ b/src/pyquickhelper/helpgen/post_process_custom.py @@ -10,5 +10,6 @@ def find_custom_latex_processing(name): Determines the corresponding post processing function associated to name. """ - raise ValueError( - "Unable to find any post processing function associated to '{0}'".format(name)) + raise ValueError( # pragma: no cover + "Unable to find any post processing function associated " + "to '{0}'".format(name)) diff --git a/src/pyquickhelper/helpgen/process_notebook_api.py b/src/pyquickhelper/helpgen/process_notebook_api.py index 1db814fb..cb5d23cf 100644 --- a/src/pyquickhelper/helpgen/process_notebook_api.py +++ b/src/pyquickhelper/helpgen/process_notebook_api.py @@ -47,7 +47,7 @@ def get_exporter(format, add_writer=False): exp = LatexExporter else: form = "slides, pdf, latex, markdown, html, rst, python, notebook, template" - raise ValueError( + raise ValueError( # pragma: no cover "unexpected format: {0}, it should be in:\n{1}".format(format, form)) if add_writer: @@ -172,7 +172,8 @@ def nb2rst(nb_file, outfile, exc=True, post_process=True): name, ext = os.path.splitext(outfile) if ext != '.rst': - raise ValueError("'{0}' should have extension '.rst'".format(outfile)) + raise ValueError( # pragma: no cover + "'{0}' should have extension '.rst'".format(outfile)) writer.build_directory = os.path.dirname(outfile) writer.write(source, meta, notebook_name=name) diff --git a/src/pyquickhelper/helpgen/sphinx_main_helper.py b/src/pyquickhelper/helpgen/sphinx_main_helper.py index 8fd7bf22..9381dd22 100644 --- a/src/pyquickhelper/helpgen/sphinx_main_helper.py +++ b/src/pyquickhelper/helpgen/sphinx_main_helper.py @@ -445,7 +445,6 @@ def format_history(src, dest, format="basic"): new_lines = [] if format == "release": - tag = None for i in range(0, len(lines)): line = lines[i].rstrip("\r\t\n ") @@ -482,17 +481,33 @@ def format_history(src, dest, format="basic"): if new_lines[-1].startswith("==="): new_lines.append("") new_lines.append(res) + elif nline.startswith("#"): + if tag is None: + tag = 'issue' + spl = nline.split(':') + nb, doc = spl[0], ':'.join(spl[1:]) + res = "* :{0}:`{1}`: {2}".format(tag, nb.strip("#"), doc.strip(' ')) + if new_lines[-1].startswith("==="): + new_lines.append("") + new_lines.append(res) else: new_lines.append(line) if line.startswith(".. _"): new_lines.append("") elif format == "basic": - reg = re.compile("(.*?)`([0-9]+)`:(.*?)[(]([-0-9]{10})[)]") + reg = re.compile( + "(.*?)((`([0-9]+)`:)|([#]([0-9]+):))(.*?)[(]([-0-9]{10})[)]") for line in lines: match = reg.search(line) if match: gr = match.groups() - new_line = "{0}:issue:`{1}`:{2}({3})".format(*gr) + issue = gr[3] + if issue is None or len(issue) == 0: + issue = gr[5] + desc = gr[6].strip() + date = gr[7].strip() + new_line = "{0}:issue:`{1}`: {2} ({3})".format( + gr[0], issue, desc, date) new_lines.append(new_line) else: new_lines.append(line.strip("\n\r")) diff --git a/src/pyquickhelper/helpgen/utils_sphinx_doc.py b/src/pyquickhelper/helpgen/utils_sphinx_doc.py index 5215e2b5..1971af92 100644 --- a/src/pyquickhelper/helpgen/utils_sphinx_doc.py +++ b/src/pyquickhelper/helpgen/utils_sphinx_doc.py @@ -26,7 +26,7 @@ def validate_file_for_help(filename, fexclude=lambda f: False): @return boolean """ if fexclude is not None and fexclude(filename): - return False + return False # pragma: no cover if filename.endswith(".pyd") or filename.endswith(".so"): return True diff --git a/src/pyquickhelper/ipythonhelper/magic_class_compress.py b/src/pyquickhelper/ipythonhelper/magic_class_compress.py index ee3588a3..9aab75f2 100644 --- a/src/pyquickhelper/ipythonhelper/magic_class_compress.py +++ b/src/pyquickhelper/ipythonhelper/magic_class_compress.py @@ -67,9 +67,9 @@ def compress(self, line): return zip_files(dest, files) if format == "gzip": return gzip_files(dest, files) - if format == "7z": + if format == "7z": # pragma: no cover return zip7_files(dest, files) - raise ValueError( + raise ValueError( # pragma: no cover "Unexpected format: '{0}' from file '{1}'?".format( format, dest)) return None diff --git a/src/pyquickhelper/ipythonhelper/magic_class_crypt.py b/src/pyquickhelper/ipythonhelper/magic_class_crypt.py index 08f360e5..f8719e5a 100644 --- a/src/pyquickhelper/ipythonhelper/magic_class_crypt.py +++ b/src/pyquickhelper/ipythonhelper/magic_class_crypt.py @@ -92,7 +92,7 @@ def encrypt_file(self, line): return encrypt_stream(key=password, filename=source, out_filename=dest, chunksize=os.stat(source).st_size * 2 + 1) - return None + return None # pragma: no cover @line_magic def decrypt_file(self, line): @@ -128,7 +128,7 @@ def decrypt_file(self, line): return decrypt_stream(key=password, filename=source, out_filename=dest, chunksize=os.stat(source).st_size * 2 + 1) - return None + return None # pragma: no cover def register_file_magics(ip=None): # pragma: no cover diff --git a/src/pyquickhelper/ipythonhelper/magic_class_diff.py b/src/pyquickhelper/ipythonhelper/magic_class_diff.py index c0049dfd..7e994cbe 100644 --- a/src/pyquickhelper/ipythonhelper/magic_class_diff.py +++ b/src/pyquickhelper/ipythonhelper/magic_class_diff.py @@ -86,7 +86,7 @@ def textdiff(self, line): inline_view=args.inline) display_html(html) return js - return None + return None # pragma: no cover @staticmethod def strdiff_parser(): @@ -121,7 +121,7 @@ def strdiff(self, line): if args is not None: html = html_diffs(args.s1, args.s2) return HTML(html) - return None + return None # pragma: no cover @line_magic def difftext(self, line): @@ -183,7 +183,7 @@ def codediff(self, line): ht = diff2html(args.c1, args.c2, aligned, final, two_columns=args.two) return HTML(ht) - return None + return None # pragma: no cover def register_file_magics(ip=None): # pragma: no cover diff --git a/src/pyquickhelper/ipythonhelper/magic_class_example.py b/src/pyquickhelper/ipythonhelper/magic_class_example.py index 1b3cdb10..d7e1ff1c 100644 --- a/src/pyquickhelper/ipythonhelper/magic_class_example.py +++ b/src/pyquickhelper/ipythonhelper/magic_class_example.py @@ -88,7 +88,7 @@ def htmlhelp(self, line): if nop or format == "html": return docstring2html(obj, format=format) print(docstring2html(obj, format=format)) - return None + return None # pragma: no cover def register_file_magics(ip=None): # pragma: no cover diff --git a/src/pyquickhelper/ipythonhelper/unittest_notebook.py b/src/pyquickhelper/ipythonhelper/unittest_notebook.py index ecd3e7dc..018d7f20 100644 --- a/src/pyquickhelper/ipythonhelper/unittest_notebook.py +++ b/src/pyquickhelper/ipythonhelper/unittest_notebook.py @@ -79,7 +79,7 @@ def test_notebook_example_pyquickhelper(self): dest = os.path.join(temp, name_) dest_dir = os.path.dirname(dest) if not os.path.exists(dest_dir): - os.mkdir(dest_dir) + os.mkdir(dest_dir) # pragma: no cover src_file = os.path.join(doc, name_) fLOG("[a_test_notebook_runner] copy '{0}' to '{1}'.".format( src_file, dest_dir)) @@ -102,7 +102,7 @@ def test_notebook_example_pyquickhelper(self): base = [jyquickhelper, pyquickhelper, thismodule] if modules: - base.extend(modules) + base.extend(modules) # pragma: no cover add_path = pyq_get_additional_paths(base) if filter_name: keepnote = [_ for _ in keepnote if filter_name(_)] diff --git a/src/pyquickhelper/jenkinshelper/jenkins_helper.py b/src/pyquickhelper/jenkinshelper/jenkins_helper.py index 6db67c9b..0bbb0e46 100644 --- a/src/pyquickhelper/jenkinshelper/jenkins_helper.py +++ b/src/pyquickhelper/jenkinshelper/jenkins_helper.py @@ -153,9 +153,9 @@ def setup_jenkins_server_yml(js, github="sdpython", modules=None, The platform is stored in *srv*. """ if modules is None: - modules = default_jenkins_jobs(js.platform) + modules = default_jenkins_jobs(js.platform) # pragma: no cover if delete_first: - js.delete_all_jobs() + js.delete_all_jobs() # pragma: no cover r = js.setup_jenkins_server( github=github, modules=modules, overwrite=overwrite, location=location, prefix=prefix, disable_schedule=disable_schedule, diff --git a/src/pyquickhelper/jenkinshelper/yaml_helper_yaml.py b/src/pyquickhelper/jenkinshelper/yaml_helper_yaml.py index 3ec0455c..a42e5afc 100644 --- a/src/pyquickhelper/jenkinshelper/yaml_helper_yaml.py +++ b/src/pyquickhelper/jenkinshelper/yaml_helper_yaml.py @@ -17,5 +17,5 @@ def yaml_load(content): @return structured data """ if Loader is None: - return yaml.load(content) + return yaml.load(content) # pragma: no cover return yaml.load(content, Loader=Loader) diff --git a/src/pyquickhelper/loghelper/flog.py b/src/pyquickhelper/loghelper/flog.py index 018a40bd..4c0ffead 100644 --- a/src/pyquickhelper/loghelper/flog.py +++ b/src/pyquickhelper/loghelper/flog.py @@ -52,7 +52,7 @@ def init(path=None, filename=None, create=True, path_add=None): This function is also called when LogPath is specified while calling function fLOG. """ if path_add is None: - path_add = [] + path_add = [] # pragma: no cover if path is None: path = flog_static.store_log_values["__log_path"] @@ -94,9 +94,9 @@ def init(path=None, filename=None, create=True, path_add=None): def GetSepLine(): """ - return always ``\\n`` + Always returns ``\\n`` """ - return "\n" # previous value: flog_static.store_log_values ["__log_file_sep"] + return "\n" # pragma: no cover def GetPath(): @@ -221,7 +221,7 @@ def myprint(s): if outstream is not None: outstream.write(s + '\n') else: - print(s) + print(s) # pragma: no cover if "OutputPrint" in kwargs: Print(kwargs["OutputPrint"]) @@ -787,7 +787,7 @@ def get_prefix(): def removedirs(folder, silent=False, use_command_line=False): """ - remove all files and folder in folder + Removes all files and folders in *folder*. @param folder folder @param silent silent mode or not @@ -808,52 +808,53 @@ def removedirs(folder, silent=False, use_command_line=False): if len(err) > 0: # pragma: no cover raise Exception("Unable to remove '{0}'\n{1}".format(folder, err)) return out - else: - file, rep = [], [] - for r, d, f in os.walk(folder): - for a in d: - rep.append(os.path.join(r, a)) - for a in f: - file.append(os.path.join(r, a)) - impos = [] - file.sort() - rep.sort(reverse=True) - for f in file: - try: - if os.path.exists(f): - os.remove(f) - except Exception as e: # pragma: no cover - typstr = str - fLOG( - "Unable to remove file '{0}' --- {1}".format(f, typstr(e).replace("\n", " "))) - if silent: - impos.append(f) - else: - raise - for f in rep: - try: - if os.path.exists(f): - os.removedirs(f) - except Exception as e: # pragma: no cover - typstr = str - fLOG( - "Unable to remove folder '{0}' --- {1}".format(f, typstr(e).replace("\n", " "))) - if silent: - impos.append(f) - else: - raise - if os.path.exists(folder): - try: - os.rmdir(folder) - except Exception as e: # pragma: no cover - impos.append(folder) - return impos + file, rep = [], [] + for r, d, f in os.walk(folder): + for a in d: + rep.append(os.path.join(r, a)) + for a in f: + file.append(os.path.join(r, a)) + impos = [] + file.sort() + rep.sort(reverse=True) + for f in file: + try: + if os.path.exists(f): + os.remove(f) + except Exception as e: # pragma: no cover + typstr = str + fLOG( + "Unable to remove file '{0}' --- {1}".format(f, typstr(e).replace("\n", " "))) + if silent: + impos.append(f) + else: + raise + for f in rep: + try: + if os.path.exists(f): + os.removedirs(f) + except Exception as e: # pragma: no cover + typstr = str + fLOG( + "Unable to remove folder '{0}' --- {1}".format(f, typstr(e).replace("\n", " "))) + if silent: + impos.append(f) + else: + raise + + if os.path.exists(folder): + try: + os.rmdir(folder) + except Exception as e: # pragma: no cover + impos.append(folder) + return impos def guess_type_value(x, none=None): """ - guess the type of a value + Guessees the type of a value. + @param x type @param none if True and all values are empty, return None @return type @@ -864,25 +865,22 @@ def guess_type_value(x, none=None): int(x) if x[0] == '0' and len(x) > 1: return str - else: - return int if len(x) < 9 else str + return int if len(x) < 9 else str except ValueError: try: x = float(x) - return float + return float # pragma: no cover except ValueError: if none: if x is None: - return None + return None # pragma: no cover try: if len(x) > 0: - return str - else: - return None + return str # pragma: no cover + return None except Exception: # pragma: no cover return None - else: - return str + return str def guess_type_value_type(none=True): diff --git a/src/pyquickhelper/loghelper/flog_fake_classes.py b/src/pyquickhelper/loghelper/flog_fake_classes.py index 948c570f..dc3350d9 100644 --- a/src/pyquickhelper/loghelper/flog_fake_classes.py +++ b/src/pyquickhelper/loghelper/flog_fake_classes.py @@ -84,7 +84,7 @@ def __init__(self, filename): creates a logger """ if filename is None: - filename = "temp_log.txt" + filename = "temp_log.txt" # pragma: no cover self.pqlogger = logging.getLogger('logger.pyquickhelper') self.pqlogger.setLevel(logging.INFO) handler = logging.handlers.RotatingFileHandler(filename) diff --git a/src/pyquickhelper/loghelper/github_api.py b/src/pyquickhelper/loghelper/github_api.py index 82198d2c..08b3d009 100644 --- a/src/pyquickhelper/loghelper/github_api.py +++ b/src/pyquickhelper/loghelper/github_api.py @@ -17,9 +17,10 @@ def __init__(self, response, url, **kwargs): msg = ['%s=%r' % (k, v) for k, v in sorted(kwargs.items())] if msg: msg = "\n" + "\n".join(msg) - Exception.__init__(self, - "response={0}\nurl={1}\ntext={2}\nstatus={3}{4}".format( - response, url, response.text, response.status_code, msg)) + Exception.__init__( + self, + "response={0}\nurl='{1}'\ntext='{2}'\nstatus={3}{4}".format( + response, url, response.text, response.status_code, msg)) def call_github_api(owner, repo, ask, auth=None, headers=None): @@ -53,6 +54,10 @@ def call_github_api(owner, repo, ask, auth=None, headers=None): """ url = 'https://api.github.com/repos/{0}/{1}/{2}'.format( owner, repo, ask.strip('/')) + if '...' in url: + raise ValueError( + "Unexpected url=%r, owner=%r, auth=%r, repo=%r." % ( + url, owner, auth, repo)) response = requests.get(url, auth=auth, headers=headers) if response.status_code != 200: raise GitHubApiException(response, url, owner=owner, repo=repo, diff --git a/src/pyquickhelper/loghelper/history_helper.py b/src/pyquickhelper/loghelper/history_helper.py index ae1a451d..9532816e 100644 --- a/src/pyquickhelper/loghelper/history_helper.py +++ b/src/pyquickhelper/loghelper/history_helper.py @@ -168,7 +168,7 @@ def build_history(owner, repo, name=None, since=None, issues=None, url=None, {{ release['release'] }} - {{ release['date'].strftime("%Y-%m-%d") }} - {{ '%1.2fMb' % (release['size'] * 2**(-20)) }} {{ '=' * (len(release['release']) + 22) }} {% for issue in release['issues'] %} -* `{{issue['number']}}`: {{issue['title']}} ({{issue['date'].strftime("%Y-%m-%d")}}){% endfor %} +* #{{issue['number']}}: {{issue['title']}} ({{issue['date'].strftime("%Y-%m-%d")}}){% endfor %} {% endfor %} """ @@ -291,19 +291,25 @@ def extract_issue_from_history(filename_or_stream): * `133`: add a collapsible container, adapt it for runpython (2018-04-22) + or + + * #133: add a collapsible container, adapt it for runpython (2018-04-22) + @param filename stream or filename @return ancient history, dictionary *{issue: (date, description)}* """ with open_stream_file(filename_or_stream, mode='r', encoding='utf-8') as f: lines = f.readlines() - reg = re.compile('`([0-9]+)`:(.*?)[(]([-0-9]{10})') + reg = re.compile('((`([0-9]+)`:)|([#]([0-9]+):))(.*?)[(]([-0-9]{10})') res = {} for line in lines: match = reg.search(line) if match: gr = match.groups() - issue = gr[0] - desc = gr[1].strip() - date = datetime.strptime(gr[2], '%Y-%m-%d') + issue = gr[2] + if issue is None or len(issue) == 0: + issue = gr[4] + desc = gr[5].strip() + date = datetime.strptime(gr[6], '%Y-%m-%d') res[int(issue)] = (date, desc) return res diff --git a/src/pyquickhelper/loghelper/os_helper.py b/src/pyquickhelper/loghelper/os_helper.py index b70734ce..d28c35d3 100644 --- a/src/pyquickhelper/loghelper/os_helper.py +++ b/src/pyquickhelper/loghelper/os_helper.py @@ -37,6 +37,7 @@ def get_user(): name = os.environ.get("USERNAME", os.environ.get( "USER", os.environ.get("CIRCLE_USERNAME", None))) if name is None: - raise ValueError("Unable to find user name in {0}".format( - ",".join(sorted(os.environ.keys())))) + raise ValueError( # pragma: no cover + "Unable to find user name in {0}".format( + ",".join(sorted(os.environ.keys())))) return name diff --git a/src/pyquickhelper/loghelper/process_script.py b/src/pyquickhelper/loghelper/process_script.py index 3bd36460..ecacd812 100644 --- a/src/pyquickhelper/loghelper/process_script.py +++ b/src/pyquickhelper/loghelper/process_script.py @@ -50,7 +50,7 @@ def execute_script(code, folder=None, filename="_temp_custom_run_script_.py", ch raise RuntimeError("data cannot be empty.\\n{}".format(pprint.pformat(loc))) """) else: - checkc = "" + checkc = "" # pragma: no cover addition = addition.replace("__CHECK__", checkc) new_code = "\n".join([code, "", addition]) if folder is None: @@ -92,7 +92,7 @@ def execute_script(code, folder=None, filename="_temp_custom_run_script_.py", ch line for line in lines if "Warning" not in line and line and line[0] != ' '] errs2 = "\n".join(lines).strip("\r\n ") if errs2: - return {'ERROR': errs} + return {'ERROR': errs} # pragma: no cover with open(data, "rb") as f: loc = pickle.load(f) return loc @@ -122,7 +122,7 @@ def execute_script_get_local_variables(script, folder=None, with Pool(1, None, None, None) as p: res = p.map(execute_script, [content]) if len(res) != 1: - raise RuntimeError( + raise RuntimeError( # pragma: no cover "Something went wrong with content\n{}".format(content)) return res[0] return execute_script(content, folder, filename, check=check) @@ -140,7 +140,8 @@ class dummy_class: def __init__(self, dico): for k, v in dico.items(): if not isinstance(k, str): - raise TypeError("Key '{}' must be a string.".format(k)) + raise TypeError( # pragma: no cover + "Key '{}' must be a string.".format(k)) setattr(self, k, v) def __str__(self): diff --git a/src/pyquickhelper/loghelper/time_helper.py b/src/pyquickhelper/loghelper/time_helper.py index 771bb091..d35bb45b 100644 --- a/src/pyquickhelper/loghelper/time_helper.py +++ b/src/pyquickhelper/loghelper/time_helper.py @@ -79,7 +79,8 @@ def repeat_script_execution(script, every_second=1, stop_after_second=5, *stop_after_second* is not None """ if not os.path.exists(script): - raise FileNotFoundError("Unable to find '{}'.".format(script)) + raise FileNotFoundError( # pragma: no cover + "Unable to find '{}'.".format(script)) iter = [0] @@ -90,7 +91,7 @@ def fct_(): f.write('[repeat_script_execution] iter={}\n'.format(iter[0])) f.write(out) if err and errfile: - with open(errfile, "a", encoding="utf-8") as f: + with open(errfile, "a", encoding="utf-8") as f: # pragma: no cover f.write('[repeat_script_execution] iter={}\n'.format(iter[0])) f.write(err) iter[0] += 1 diff --git a/src/pyquickhelper/loghelper/url_helper.py b/src/pyquickhelper/loghelper/url_helper.py index 1f42d943..ddfb2b55 100644 --- a/src/pyquickhelper/loghelper/url_helper.py +++ b/src/pyquickhelper/loghelper/url_helper.py @@ -7,7 +7,7 @@ try: import urllib.request as urllib_request from urllib.error import HTTPError -except ImportError: +except ImportError: # pragma: no cover import urllib2 as urllib_request from urllib2 import HTTPError @@ -32,20 +32,20 @@ def get_url_content(url, use_mozilla=False): req = urllib_request.Request( url, headers={'User-agent': 'Mozilla/5.0 (Windows NT 6.1; Win64; x64)' if sys.platform.startswith("win") else 'Mozilla/5.0'}) u = urllib_request.urlopen(req) - except HTTPError as e: - raise CannotDownloadException( - "Unable to download from url '{0}'".format(url)) from e - text = u.read() - u.close() - text = text.decode("utf8") - return text - else: - try: - u = urllib_request.urlopen(url) - except HTTPError as e: + except HTTPError as e: # pragma: no cover raise CannotDownloadException( "Unable to download from url '{0}'".format(url)) from e text = u.read() u.close() text = text.decode("utf8") return text + + try: + u = urllib_request.urlopen(url) + except HTTPError as e: # pragma: no cover + raise CannotDownloadException( + "Unable to download from url '{0}'".format(url)) from e + text = u.read() + u.close() + text = text.decode("utf8") + return text diff --git a/src/pyquickhelper/pycode/doc_helper.py b/src/pyquickhelper/pycode/doc_helper.py index 5ea29cb1..dd71e69b 100644 --- a/src/pyquickhelper/pycode/doc_helper.py +++ b/src/pyquickhelper/pycode/doc_helper.py @@ -36,7 +36,7 @@ def validate_urls(urls): with urlopen(u, timeout=10) as f: content = f.read(10) if len(content) != 10: - issue.append((u, "Cannot download")) + issue.append((u, "Cannot download")) # pragma: no cover except Exception as e: issue.append((u, e)) return issue diff --git a/src/pyquickhelper/pycode/setup_helper.py b/src/pyquickhelper/pycode/setup_helper.py index 7665aa0b..8e50c983 100644 --- a/src/pyquickhelper/pycode/setup_helper.py +++ b/src/pyquickhelper/pycode/setup_helper.py @@ -339,9 +339,10 @@ def dump_coverage_fct(full=True): if existing_history is not None: print('[history] existing ', existing_history) print('[history] ', dest) - build_history_from_setup(dest, owner=github_owner, module=project_var_name, - existing_history=existing_history, - skip_issues=skip_issues, fLOG=fLOG) + build_history_from_setup( + dest, owner=github_owner, module=project_var_name, + existing_history=existing_history, + skip_issues=skip_issues, fLOG=fLOG) return True elif "write_version" in argv: diff --git a/src/pyquickhelper/pycode/unittest_assert.py b/src/pyquickhelper/pycode/unittest_assert.py index 7f0eaa1e..e8ea5f29 100644 --- a/src/pyquickhelper/pycode/unittest_assert.py +++ b/src/pyquickhelper/pycode/unittest_assert.py @@ -29,7 +29,7 @@ def getstate(obj, recursive=True, type_stop=None, type_stack=None, done=None): if numpy.isscalar(obj): return obj if isinstance(obj, type_stop): - return obj + return obj # pragma: no cover if type_stack is None: type_stack = [type(obj)] @@ -67,11 +67,11 @@ def getstate(obj, recursive=True, type_stop=None, type_stack=None, done=None): except AttributeError as e: try: state = obj.__dict__.copy() - except AttributeError as e: + except AttributeError as e: # pragma: no cover raise NotImplementedError( "Unable to retrieve state of object %r, type_stack=%r." "" % (type(obj), ", ".join(map(str, type_stack)))) from e - except Exception as e: + except Exception as e: # pragma: no cover raise NotImplementedError( "Unable to retrieve state of object %r, type_stack=%r." "" % (type(obj), ", ".join(map(str, type_stack)))) from e @@ -81,6 +81,6 @@ def getstate(obj, recursive=True, type_stop=None, type_stack=None, done=None): "" % (type(obj), ", ".join(map(str, type_stack)))) from e if not recursive: - return state + return state # pragma: no cover return getstate(state, recursive=True, type_stop=type_stop, type_stack=type_stack, done=done) diff --git a/src/pyquickhelper/pycode/unittest_cst.py b/src/pyquickhelper/pycode/unittest_cst.py index 97d3f808..660b6eca 100644 --- a/src/pyquickhelper/pycode/unittest_cst.py +++ b/src/pyquickhelper/pycode/unittest_cst.py @@ -39,7 +39,7 @@ def compress_cst(data, length=70, as_text=False): bufs.append(data64[pos:]) pos = len(data64) if as_text: - return pprint.pformat(bufs) + return pprint.pformat(bufs) # pragma: no cover return bufs diff --git a/src/pyquickhelper/pycode/unittestclass.py b/src/pyquickhelper/pycode/unittestclass.py index 8c582bd7..19428ffc 100644 --- a/src/pyquickhelper/pycode/unittestclass.py +++ b/src/pyquickhelper/pycode/unittestclass.py @@ -101,7 +101,8 @@ def assertNotExists(self, name): Checks that *name* does not exist. """ if os.path.exists(name): - raise FileNotFoundError("Able to find '{0}'.".format(name)) + raise FileNotFoundError( # pragma: no cover + "Able to find '{0}'.".format(name)) def assertEqualDataFrame(self, d1, d2, **kwargs): """ @@ -719,7 +720,7 @@ def assert_almost_equal_detailed(expected, value, **kwargs): assert_almost_equal(expected, value, **kwargs) except AssertionError as e: if expected.shape[0] != value.shape[0]: - raise e + raise e # pragma: no cover rows = ['INNER EXCEPTION:', str(e), '------', 'ROWS BY ROWS'] for i, (r1, r2) in enumerate(zip(expected, value)): try: @@ -729,5 +730,5 @@ def assert_almost_equal_detailed(expected, value, **kwargs): rows.append("ISSUE WITH ROW {}/{}:0 {}".format( i, expected.shape[0], str(e))) if len(rows) > 10: - break + break # pragma: no cover raise AssertionError("\n".join(rows)) diff --git a/src/pyquickhelper/pycode/utils_tests_helper.py b/src/pyquickhelper/pycode/utils_tests_helper.py index 0d2ffd6f..c728d732 100644 --- a/src/pyquickhelper/pycode/utils_tests_helper.py +++ b/src/pyquickhelper/pycode/utils_tests_helper.py @@ -141,7 +141,8 @@ def check_pep8(folder, ignore=('E265', 'W504'), skip=None, pylint_ignore=('C0103', 'C1801', 'R0201', 'R1705', 'W0108', 'W0613', - 'W0107', 'C0415'), + 'W0107', 'C0415', + 'C0209'), recursive=True, neg_pattern=None, extended=None, max_line_length=143, pattern=".*[.]py$", run_lint=True, verbose=False, run_cmd_filter=None): diff --git a/src/pyquickhelper/server/server_helper.py b/src/pyquickhelper/server/server_helper.py index c9ea7945..cdb71e0e 100644 --- a/src/pyquickhelper/server/server_helper.py +++ b/src/pyquickhelper/server/server_helper.py @@ -22,7 +22,7 @@ def get_jenkins_mappings(root, loc="dist"): if not isinstance(root, list): roots = [root] else: - roots = root + roots = root # pragma: no cover maps = {} for ro in roots: diff --git a/src/pyquickhelper/sphinxext/documentation_link.py b/src/pyquickhelper/sphinxext/documentation_link.py index 14d5119b..df9c8f0a 100644 --- a/src/pyquickhelper/sphinxext/documentation_link.py +++ b/src/pyquickhelper/sphinxext/documentation_link.py @@ -23,7 +23,7 @@ def python_link_doc(m, o=None, format="rst"): if o is None: return m, "https://docs.python.org/3/library/{0}.html".format(m) return ("{0}.{1}".format(m, o), - "https://docs.python.org/3/library/{0}.html{0}.{1}".format(m, o)) + "https://docs.python.org/3/library/{0}.html#{0}.{1}".format(m, o)) if format == "rst": name, url = python_link_doc(m, o, format="raw") return "`{0} <{1}>`_".format(name, url) diff --git a/src/pyquickhelper/sphinxext/sphinx_autosignature.py b/src/pyquickhelper/sphinxext/sphinx_autosignature.py index a4576843..a0fb4a92 100644 --- a/src/pyquickhelper/sphinxext/sphinx_autosignature.py +++ b/src/pyquickhelper/sphinxext/sphinx_autosignature.py @@ -216,7 +216,7 @@ def keep_logging(*els): if opt_link: text = "\n:py:func:`{0} <{1}>`\n\n".format(anchor, object_name) else: - text = "\n``{0}``\n\n".format(anchor) + text = "\n``{0}``\n\n".format(anchor) # pragma: no cover else: obj_sig = obj.__init__ if kind == "class" else obj try: @@ -273,10 +273,10 @@ def keep_logging(*els): 'class': 'class', 'staticmethod': 'meth', 'property': 'meth'}[kind] if signature is None: - if opt_link: + if opt_link: # pragma: no cover text = "\n:py:{2}:`{0} <{1}>`\n\n".format( anchor, object_name, domkind) - else: + else: # pragma: no cover text = "\n``{0} {1}``\n\n".format(kind, object_name) else: signature = self.build_parameters_list( diff --git a/src/pyquickhelper/sphinxext/sphinx_nbref_extension.py b/src/pyquickhelper/sphinxext/sphinx_nbref_extension.py index 3d0cff98..a7a7b0f9 100644 --- a/src/pyquickhelper/sphinxext/sphinx_nbref_extension.py +++ b/src/pyquickhelper/sphinxext/sphinx_nbref_extension.py @@ -55,8 +55,11 @@ def run(self): env = self.state.document.settings.env if hasattr( self.state.document.settings, "env") else None docname = None if env is None else env.docname - raise KeyError("unable to find 'title' in node {0}\n File \"{1}\", line {2}\nkeys: {3}".format( - str(self.__class__), docname, lineno, list(self.options.keys()))) + raise KeyError( # pragma: no cover + "Unable to find 'title' in node {0}\n File \"{1}\", " + "line {2}\nkeys: {3}".format( + str(self.__class__), docname, lineno, + list(self.options.keys()))) title = self.options['title'] if "tag" not in self.options: self.options["tag"] = "nb" diff --git a/src/pyquickhelper/sphinxext/sphinx_sharenet_extension.py b/src/pyquickhelper/sphinxext/sphinx_sharenet_extension.py index 29235505..e01fd18d 100644 --- a/src/pyquickhelper/sphinxext/sphinx_sharenet_extension.py +++ b/src/pyquickhelper/sphinxext/sphinx_sharenet_extension.py @@ -130,10 +130,10 @@ def sharenet_role(role, rawtext, text, lineno, inliner, return [prb], [msg] if len(networks) == 0: - msg = inliner.reporter.error( + msg = inliner.reporter.error( # pragma: no cover "no specified network from {0}".format(rawtext), line=lineno) - prb = inliner.problematic(rawtext, rawtext, msg) - return [prb], [msg] + prb = inliner.problematic(rawtext, rawtext, msg) # pragma: no cover + return [prb], [msg] # pragma: no cover # ref = inliner.document.settings.rfc_base_url + inliner.rfc_url % rfcnum # set_classes(options) @@ -223,7 +223,7 @@ def depart_sharenet_node(self, node): It does only html for the time being. """ - pass + pass # pragma: no cover def visit_sharenet_node_rst(self, node): diff --git a/src/pyquickhelper/sphinxext/sphinx_template_extension.py b/src/pyquickhelper/sphinxext/sphinx_template_extension.py index f8c3613a..07ad00b6 100644 --- a/src/pyquickhelper/sphinxext/sphinx_template_extension.py +++ b/src/pyquickhelper/sphinxext/sphinx_template_extension.py @@ -93,7 +93,7 @@ def tpl_role(role, rawtext, text, lineno, inliner, options=None, content=None): spl = text.split(",") template_name = spl[0] if len(spl) == 1: - context = "" + context = "" # pragma: no cover else: context = ",".join(spl[1:]) @@ -133,11 +133,11 @@ def tpl_role(role, rawtext, text, lineno, inliner, options=None, content=None): language=inliner.language) processed, messages = inliner.parse(res, lineno, memo, node) if len(messages) > 0: - msg = inliner.reporter.error( + msg = inliner.reporter.error( # pragma: no cover "unable to interpret '{0}', messages={1}".format( text, ", ".join(str(_) for _ in messages)), line=lineno) - prb = inliner.problematic(rawtext, rawtext, msg) - return [prb], [msg] + prb = inliner.problematic(rawtext, rawtext, msg) # pragma: no cover + return [prb], [msg] # pragma: no cover node += processed return [node], [] diff --git a/src/pyquickhelper/sphinxext/sphinx_video_extension.py b/src/pyquickhelper/sphinxext/sphinx_video_extension.py index be2d3689..2b653c33 100644 --- a/src/pyquickhelper/sphinxext/sphinx_video_extension.py +++ b/src/pyquickhelper/sphinxext/sphinx_video_extension.py @@ -63,7 +63,7 @@ def run(self): if docname is not None: docname = docname.replace("\\", "/").split("/")[-1] else: - docname = '' + docname = '' # pragma: no cover source = self.state.document.current_source filename = self.arguments[0] @@ -141,9 +141,8 @@ def visit_video_node(self, node): def _clean_value(val): if isinstance(val, tuple): - return val[0] - else: - return val + return val[0] # pragma: no cover + return val def depart_video_node_html(self, node): diff --git a/src/pyquickhelper/sphinxext/sphinxext_helper.py b/src/pyquickhelper/sphinxext/sphinxext_helper.py index a2e7bc7a..140463c1 100644 --- a/src/pyquickhelper/sphinxext/sphinxext_helper.py +++ b/src/pyquickhelper/sphinxext/sphinxext_helper.py @@ -43,12 +43,12 @@ def get_env_state_info(self): elif hasattr(self.state.document.settings, "env"): env = self.state.document.settings.env else: - env = None + env = None # pragma: no cover reporter = self.state.document.reporter try: docname, lineno = reporter.get_source_and_line(self.lineno) - except AttributeError: + except AttributeError: # pragma: no cover docname = lineno = None if docname is not None: diff --git a/src/pyquickhelper/texthelper/edit_text_diff.py b/src/pyquickhelper/texthelper/edit_text_diff.py index 08e7a5f0..180e8f15 100644 --- a/src/pyquickhelper/texthelper/edit_text_diff.py +++ b/src/pyquickhelper/texthelper/edit_text_diff.py @@ -52,7 +52,7 @@ def edit_distance_string(s1, s2, cmp_cost=1.): c = dist[i - 1, j - 1] + d p = 3 if p == 0: - raise RuntimeError( + raise RuntimeError( # pragma: no cover "Unexpected value for p=%d at position=%r." % (p, (i, j))) dist[i, j] = c @@ -72,7 +72,7 @@ def edit_distance_string(s1, s2, cmp_cost=1.): elif p == 1: i -= 1 else: - raise RuntimeError( + raise RuntimeError( # pragma: no cover "Unexpected value for p=%d at position=%r." % (p, (i, j))) p = pred[i, j] return d, list(reversed(equals)) @@ -170,8 +170,8 @@ def cost_cmp(i, j, row1, row2, bypass=True): pred[0, 0] = -1 if verbose: - from tqdm import tqdm - loop = tqdm(range(1, n1)) + from tqdm import tqdm # pragma: no cover + loop = tqdm(range(1, n1)) # pragma: no cover else: loop = range(1, n1) for i in loop: @@ -197,10 +197,7 @@ def cost_cmp(i, j, row1, row2, bypass=True): c = d p = 3 if p == 0: - print(i, j) - print(dist) - print(pred) - raise RuntimeError( + raise RuntimeError( # pragma: no cover "Unexpected value for p=%d at position=%r, c=%d, " "dist[i, j]=%d, dist=\n%r." % ( p, (i, j), c, dist[i, j], @@ -230,7 +227,7 @@ def cost_cmp(i, j, row1, row2, bypass=True): elif p == 1: i -= 1 else: - raise RuntimeError( + raise RuntimeError( # pragma: no cover "Unexpected value for p=%d at position=%r." % (p, (i, j))) p = pred[i, j] @@ -354,7 +351,7 @@ def diff2html(rows1, rows2, equals, aligned, two_columns=False): l2 = [spanb + _ + span_ for _ in s2] for i, j in al[1]: if i is None or j is None: - continue + continue # pragma: no cover if s1[i] == s2[j]: l1[i] = s1[i] l2[j] = s2[j]