
    jf#              	       x   d Z ddlZddlZddlZddlZddlmZ ej                  j                  ej                  j                  ej                  j                  ej                  j                  e            dd      xZej                  vegz         ej                  j                  dd       ddlZddlZddlmZ dd	lmZmZ dd
lmZ ddlmZ ddlmZmZ ddlm Z  ddl!m"Z" ddl#m$Z$ g dZ%ejL                  Z&dZ'ejP                  Z)ejP                  Z*d Z+d Z,d Z-ej\                  jZ                  j                   e-_         erej\                  j^                  Z0n& ejb                  ej\                  j^                        Z0 G d de0      Z/d Z2ejf                  fdZ4 G d de5      Z6 ejn                          y)z@Extensions to the 'distutils' for large or complex distributions    N)TYPE_CHECKING
setuptools_vendor	backports)DistutilsOptionError   )loggingmonkey)version)Require)PackageFinderPEP420PackageFinder)Distribution)	Extension)SetuptoolsDeprecationWarning)setupr   Commandr   r   r   find_packagesfind_namespace_packagesc                      G d dt         j                  j                        } ||       }|j                  d       |j                  rt        |       y y )Nc                   4     e Zd ZdZ fdZd fd	Zd Z xZS )4_install_setup_requires.<locals>.MinimalDistributionzl
        A minimal version of a distribution for supporting the
        fetch_build_eggs interface.
        c                     d}t        |      t        |      z  D ci c]  }|||   
 }}t        | 	  |       | j                  j	                          y c c}w )N)dependency_linkssetup_requires)setsuper__init__set_defaults_disable)selfattrs_inclkfiltered	__class__s        k/var/dept/share/cheung/public_html/OutSchool/python/env/lib/python3.12/site-packages/setuptools/__init__.pyr   z=_install_setup_requires.<locals>.MinimalDistribution.__init__6   sU    8E-0Z#e*-DE58EHEGX&&&( Fs   Ac                 X    	 t         |   |      \  }}|dfS # t        $ r |dfcY S w xY w)zAIgnore ``pyproject.toml``, they are not related to setup_requires )r    _split_standard_project_metadata	Exception)r!   	filenamescfgtomlr&   s       r'   _get_project_config_fileszN_install_setup_requires.<locals>.MinimalDistribution._get_project_config_files=   sA    %!GDYO	T 7N  % "}$%s    ))c                      y)zl
            Disable finalize_options to avoid building the working set.
            Ref #2158.
            Nr)   )r!   s    r'   finalize_optionszE_install_setup_requires.<locals>.MinimalDistribution.finalize_optionsE   s        N)__name__
__module____qualname____doc__r   r/   r1   __classcell__r&   s   @r'   MinimalDistributionr   0   s    	
	)		r2   r:   T)ignore_option_errors)	distutilscorer   parse_config_filesr   _fetch_build_eggs)r"   r:   dists      r'   _install_setup_requiresrA   -   sM    inn99 6 u%D 	6$ r2   c                     	 | j                  | j                         y # t        $ rS}d}d|j                  j                  v r3t        |d      r|j                  |        | j                  d| d        d }~ww xY w)Na  
        It is possible a package already installed in your system
        contains an version that is invalid according to PEP 440.
        You can try `pip install --use-pep517` as a workaround for this problem,
        or rely on a new virtual environment.

        If the problem refers to a package that is not installed yet,
        please contact that package's maintainers or distributors.
        InvalidVersionadd_note
)fetch_build_eggsr   r+   r&   r4   hasattrrD   announce)r@   exmsgs      r'   r?   r?   S   sz    d112  r||444r:&C  	 3%rl+s    	A:AA55A:c                  ~    t        j                          t        |        t        j                  j
                  di | S )Nr)   )r	   	configurerA   r<   r=   r   )r"   s    r'   r   r   h   s.    E">>(%((r2   c                   N     e Zd ZU dZdZeed<   def fdZd	dZd Z	d
dZ
 xZS )r   a
  
    Setuptools internal actions are organized using a *command design pattern*.
    This means that each action (or group of closely related actions) executed during
    the build should be implemented as a ``Command`` subclass.

    These commands are abstractions and do not necessarily correspond to a command that
    can (or should) be executed via a terminal, in a CLI fashion (although historically
    they would).

    When creating a new command from scratch, custom defined classes **SHOULD** inherit
    from ``setuptools.Command`` and implement a few mandatory methods.
    Between these mandatory methods, are listed:

    .. method:: initialize_options(self)

        Set or (reset) all options/attributes/caches used by the command
        to their default values. Note that these values may be overwritten during
        the build.

    .. method:: finalize_options(self)

        Set final values for all options/attributes used by the command.
        Most of the time, each option/attribute/cache should only be set if it does not
        have any value yet (e.g. ``if self.attr is None: self.attr = val``).

    .. method:: run(self)

        Execute the actions intended by the command.
        (Side effects **SHOULD** only take place when ``run`` is executed,
        for example, creating new files or writing to the terminal output).

    A useful analogy for command classes is to think of them as subroutines with local
    variables called "options".  The options are "declared" in ``initialize_options()``
    and "defined" (given their final values, aka "finalized") in ``finalize_options()``,
    both of which must be defined by every command class. The "body" of the subroutine,
    (where it does all the work) is the ``run()`` method.
    Between ``initialize_options()`` and ``finalize_options()``, ``setuptools`` may set
    the values for options/attributes based on user's input (or circumstance),
    which means that the implementation should be careful to not overwrite values in
    ``finalize_options`` unless necessary.

    Please note that other commands (or other parts of setuptools) may also overwrite
    the values of the command's options/attributes multiple times during the build
    process.
    Therefore it is important to consistently implement ``initialize_options()`` and
    ``finalize_options()``. For example, all derived attributes (or attributes that
    depend on the value of other attributes) **SHOULD** be recomputed in
    ``finalize_options``.

    When overwriting existing commands, custom defined classes **MUST** abide by the
    same APIs implemented by the original class. They also **SHOULD** inherit from the
    original class.
    Fdistributionr@   c                 X    t         |   |       t        |       j                  |       y)zj
        Construct the command for dist, updating
        vars(self) with any keyword parameters.
        N)r   r   varsupdate)r!   r@   kwr&   s      r'   r   zCommand.__init__   s$    
 	T
"r2   c           	          t        | |      }|t        | ||       |S t        |t              st	        d|d|d|d      |S )N'z' must be a z (got `z`))getattrsetattr
isinstancestrr   )r!   optionwhatdefaultvals        r'   _ensure_stringlikezCommand._ensure_stringlike   sL    dF#;D&'*NC%&28$D  
r2   c                     t        | |      }|yt        |t              r"t        | |t	        j
                  d|             yt        |t              rt        d |D              }nd}|st        d|d|d      y)a  Ensure that 'option' is a list of strings.  If 'option' is
        currently a string, we split it either on /,\s*/ or /\s+/, so
        "foo bar baz", "foo,bar,baz", and "foo,   bar baz" all become
        ["foo", "bar", "baz"].

        ..
           TODO: This method seems to be similar to the one in ``distutils.cmd``
           Probably it is just here for backward compatibility with old Python versions?

        :meta private:
        Nz,\s*|\s+c              3   <   K   | ]  }t        |t                y wr3   )rW   rX   ).0vs     r'   	<genexpr>z-Command.ensure_string_list.<locals>.<genexpr>   s     9As+9s   FrT   z!' must be a list of strings (got ))	rU   rW   rX   rV   resplitlistallr   )r!   rY   r\   oks       r'   ensure_string_listzCommand.ensure_string_list   su     dF#;S!D&"((;"<=#t$9S99*AGM  r2   c                 h    t         j                  | ||      }t        |      j                  |       |S r3   )_Commandreinitialize_commandrP   rQ   )r!   commandreinit_subcommandsrR   cmds        r'   rl   zCommand.reinitialize_command   s.    ++D';MNS	
r2   r3   )F)r4   r5   r6   r7   command_consumes_argumentsr   __annotations__r   r]   ri   rl   r8   r9   s   @r'   r   r   x   s2    4l "'\ 	6r2   r   c                     d t        j                  | d      D        }t        t         j                  j                  |      S )z%
    Find all files under 'path'
    c              3   r   K   | ]/  \  }}}|D ]$  }t         j                  j                  ||       & 1 y wr3   )ospathjoin)r`   basedirsfilesfiles        r'   rb   z#_find_all_simple.<locals>.<genexpr>   sB      D$  	T4  s   57T)followlinks)rt   walkfilterru   isfile)ru   resultss     r'   _find_all_simpler      s3    !#4!@G
 "''..'**r2   c                     t        |       }| t        j                  k(  r;t        j                  t        j
                  j                  |       }t        ||      }t        |      S )z
    Find all files under 'dir' and return the list of full filenames.
    Unless dir is '.', return full filenames with dir prepended.
    )start)	r   rt   curdir	functoolspartialru   relpathmaprf   )dirry   make_rels      r'   findallr      sJ    
 S!E
bii$$RWW__C@He$;r2   c                       e Zd ZdZy)sicz;Treat this string as-is (https://en.wikipedia.org/wiki/Sic)N)r4   r5   r6   r7   r)   r2   r'   r   r      s    Er2   r   )8r7   r   rt   rd   systypingr   ru   extendrv   dirname__file__vendor_pathmodulespop_distutils_hack.override_distutils_hackdistutils.corer<   distutils.errorsr    r	   r
   r   _version_moduledependsr   	discoveryr   r   r@   r   	extensionr   warningsr   __all____version__bootstrap_install_fromfindr   r   rA   r?   r   r=   r   rk   get_unpatchedr   r   r   rX   r   	patch_allr)   r2   r'   <module>r      s   F  	 	 
   bggoobggooh>W.XZfhq!rr+{~  |D  |D  D  IT  HU  U  V T "   1  (  9    2	 ))  ""-22 # L*) $$,,~~%%H#v##INN$:$:;Hkh k\	+ 		 	F# F
    r2   