a
    s¼Df%  ã                   @   s&   d dl Z d dlZddd„Zdd„ ZdS )é    NFc                 C   s°   t j t j |¡¡}t j |d¡}t j |¡s<t j |d¡}t j | ¡rf|s\td|  ƒ dS t | ¡ t 	ddd¡}t j |¡}t j 
|¡r tj|| |dd	 ntd
| ƒ dS )z4
    Copies the notebooks to the supplied path.
    z
./examplesz../exampleszC%s directory already exists, either delete it or set the force flagNz.ipynb_checkpointsz*.pycz*~T)ÚignoreÚsymlinkszCannot find %s)ÚosÚpathÚabspathÚdirnameÚjoinÚexistsÚprintÚshutilÚrmtreeÚignore_patternsÚisdirÚcopytree)r   ÚrootÚverboseÚforceÚfilepathZexample_dirr   Z	tree_root© r   úW/nfs/NAS7/SABIOD/METHODE/ermites/ermites_venv/lib/python3.9/site-packages/pyct/build.pyÚexamples   s    
r   c                 C   sˆ   ddl }tj tj | ¡¡}tj ||d¡}zddlm} W n   d}Y n0 |durh|jj	||ddS t
dƒ | t|dƒ¡d	 S dS )
a1  
    Helper to get the current version from either git describe or the
    .version file (if available) - allows for param to not be available.

    Normally used in setup.py as follows:

    >>> from pyct.build import get_setup_version
    >>> version = get_setup_version(__file__, reponame)  # noqa
    r   Nz.version)Úversionz$Format:%h$)Zarchive_commitzÒWARNING: param>=1.6.0 unavailable. If you are installing a package, this warning can safely be ignored. If you are creating a package or otherwise operating in a git repository, you should install param>=1.6.0.ÚrÚversion_string)Újsonr   r   r   r   r   Úparamr   ÚVersionZsetup_versionr
   ÚloadÚopen)r   Zreponamer   r   Zversion_file_pathr   r   r   r   Úget_setup_version   s    

r   )FF)r   r   r   r   r   r   r   r   Ú<module>   s   
