+
    VjH                     p   R t ^ RIHt ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RI	H	t	 ^ RI
t
^ RIHt ^ RIHt ^ RIHt ]P"                  ! R4      ]P"                  ! R4      .t]RR	 l4       tRR
 ltR tR tR tRR ltRR ltRR ltR tR tR tR tR tR t R t!R t"R t#R t$]%R8X  d
   ]$! 4        R# R# ) aV  pipreqs - Generate pip requirements.txt file based on imports

Usage:
    pipreqs [options] [<path>]

Arguments:
    <path>                The path to the directory containing the application
                          files for which a requirements file should be
                          generated (defaults to the current working
                          directory).

Options:
    --use-local           Use ONLY local package info instead of querying PyPI.
    --pypi-server <url>   Use custom PyPi server.
    --proxy <url>         Use Proxy, parameter will be passed to requests
                          library. You can also just set the environments
                          parameter in your terminal:
                          $ export HTTP_PROXY="http://10.10.1.10:3128"
                          $ export HTTPS_PROXY="https://10.10.1.10:1080"
    --debug               Print debug information
    --ignore <dirs>...    Ignore extra directories, each separated by a comma
    --no-follow-links     Do not follow symbolic links in the project
    --encoding <charset>  Use encoding parameter for file open
    --savepath <file>     Save the list of requirements in the given file
    --print               Output the list of requirements in the standard
                          output
    --force               Overwrite existing requirements.txt
    --diff <file>         Compare modules in requirements.txt to project
                          imports
    --clean <file>        Clean up requirements.txt by removing modules
                          that are not imported in project
    --mode <scheme>       Enables dynamic versioning with <compat>,
                          <gt> or <non-pin> schemes.
                          <compat> | e.g. Flask~=1.1.2
                          <gt>     | e.g. Flask>=1.1.2
                          <no-pin> | e.g. Flask
)contextmanagerN)docopt)json2package)	HTTPError)__version__z^import (.+)$z!^from ((?!\.+).*?) import (?:.*)$c              #    "   V '       d   V R8X  dS   V'       d   RV9   d   \         P                  pM=RV9   d   \         P                  pM%\        RP	                  V4      4      h\        W4      p Vx  V\         P                  \         P                  39  d   VP                  4        R# R#   T\         P                  \         P                  39  d   TP                  4        i i ; i5i)an  Open a file or ``sys.stdout`` depending on the provided filename.

Args:
    filename (str): The path to the file that should be opened. If
        ``None`` or ``'-'``, ``sys.stdout`` or ``sys.stdin`` is
        returned depending on the desired mode. Defaults to ``None``.
    mode (str): The mode that should be used to open the file.

Yields:
    A file handle.

-rwzInvalid mode for file: {}N)sysstdinstdout
ValueErrorformatopenclose)filenamemodefiles   && D/var/www/idalgo/venv/lib/python3.14/site-packages/pipreqs/pipreqs.py_openr   ;   s      x3sd{99DD[::D8??EFFH#
		3::..JJL /4		3::..JJL /s#   C(AC(0B- 49C(-8C%%C(c           	      F   \        4       p\        4       p. pR p. ROpV'       dh   . p	V FN  p
V	P                  \        P                  P	                  \        P                  P                  V
4      4      4       KP  	  VP                  V	4       \        P                  ! WR7      pV EF  w  rpV Uu. uF  qV9  g   K  VNK  	  upVR&   VP                  \        P                  P	                  V4      4       V Uu. uF2  p\        P                  P                  V4      ^,          R8X  g   K0  VNK4  	  ppYn Uu. uF)  p\        P                  P                  V4      ^ ,          NK+  	  up,          pV EF  p\        P                  P                  VV4      p\        VRVR7      ;_uu_ 4       pVP                  4       pRRR4        \        P                  ! X4      p\        P                  ! V4       F  p\        V\        P                  4      '       d1   VP                    F  pVP#                  VP$                  4       K   	  KS  \        V\        P&                  4      '       g   Ku  VP#                  VP(                  4       K  	  EK  	  EK  	  V Uu. uF  pV'       g   K  VNK  	  up F)  pVP7                  R4      w  p pVP#                  V4       K+  	  V\        V4      V,          ,
          p\0        P8                  ! R	P;                  V4      4       \        \        R
4      R4      ;_uu_ 4       pV Uu0 uF  pVP=                  4       kK  	  ppRRR4       \?        VX,
          4      # u upi u upi u upi   + '       g   i     EL; i  \*         dg   pT'       d;   \,        P.                  ! T4       \0        P2                  ! RT,          4        Rp?EKl  \0        P4                  ! RT,          4       ThRp?ii ; iu upi u upi   + '       g   i     L; i)F)followlinks:NNNz.pyr	   encodingNzFailed on file: %s.zFound packages: {0}stdlib)z.hgz.svnz.gitz.tox__pycache__envvenv) setappendospathbasenamerealpathextendwalksplitextjoinr   readastparse
isinstanceImportnamesaddname
ImportFrommodule	Exception	traceback	print_excloggingwarnerror	partitiondebugr   striplist)r#   r   extra_ignore_dirsfollow_linksimportsraw_imports
candidatesignore_errorsignore_dirsignore_dirs_parseder'   rootdirsfilesdfn	file_namefcontentstreenodesubnodeexcnr1   cleaned_name_packagesxdatas   &&&&                           r   get_all_importsrY   Z   s   eG%KJMOK"A%%bgg&6&6rww7G7G7J&KL #-.7742D!E";d{&:11d;Q"''**401#Herww'7'7';A'>%'GeH?2rww''+A..??
IT95Iix88A668 9yy*HHTND!$

33'+zzG'OOGLL9 (2#D#..99#4 +  ": (-Kq1K- "^^C0aL! . #j/G34HMM'..x89	d8nc	"	"a#$%1a	1% 
# 4  W < I? 988   '',LL!5	!ABMM"6"BCI . & 
#	"sy   0M/=M/;-M4-M49/M9-M>	BN(N
P$P5P:PP>NP;O>O>>PPP 	c                 F    \        V 4      ^ 8  ;'       d    V ^ ,          R8g  # )    #)len)lines   &r   filter_liner_      s     t9q=++T!W^+    c                   a \        V R 4      ;_uu_ 4       p\        P                  ! RP                  \	        V4      T RP                  V Uu. uF  qDR,          NK  	  up4      R7      4       RV,           R,           oVP                  RP                  V3R lV 4       4      R,           4       R	R	R	4       R	# u upi   + '       g   i     R	# ; i)
r
   z/Writing {num} requirements: {imports} to {file}, r1   )numr   r@   {name}z	{version}
c              3      <"   T F8  pVR ,          '       d   SP                   ! R/ VB MRP                   ! R/ VB x  K:  	  R# 5i)versionrd   N )r   ).0itemfmts   & r   	<genexpr>-generate_requirements_file.<locals>.<genexpr>   s=      !! #'y//CJJx7N7NNs
   A,AN)r   r7   r;   r   r]   r)   write)r#   r@   symbolout_filerW   rk   s   &&&  @r   generate_requirements_filerq      s    	tS		XGNNGII':'Qyy':; O 
 	
 +-tyy !!!! !#'( 	) 
	 ;	 
		s   6B=B8AB=8B==C	c                     \        R W4       R# )r   N)rq   )r@   ro   s   &&r   output_requirementsrs      s    sG4r`   c                    . pV  EF4  p \         P                  ! R V4       \        P                  ! RP	                  W4      VR7      pVP
                  ^8X  dW   \        VP                  R4      '       d%   \        VP                  P                  4       4      pMI\        VP                  4      pM3VP
                  R8  d"   \        VP
                  VP                  R7      h \         P                  ! RVXP                  VP                  VP                  4       VP                  RVR	VP                  /4       EK7  	  V#   \         d    \         P                  ! RT4        EKa  i ; i)
zMImport named "%s" not found locally. Trying to resolve it at the PyPI server.z{0}{1}/json)proxiesdecodei,  )status_codereasonz/Package "%s" does not exist or network problemszImport named "%s" was resolved to "%s:%s" package (%s).
Please, verify manually the final list of requirements.txt to avoid possible dependency confusions.r1   rg   )r7   warningrequestsgetr   rw   hasattrcontentr   rv   r   rx   r1   latest_release_idpypi_urlr!   )r@   pypi_serverproxyresultrj   responserX   s   &&&    r   get_imports_infor      s=   F	OO;
  ||$$[7HH##s*8++X66'(8(8(?(?(ABD'(8(89D%%,H,@,@'/8 8 - 	7 II""MM	
 	vtY0F0FGH= > M  	OOA4I	s   BE E /2E  "E'&E'c                 h   . p. ROp\         P                   EFp  p\        P                  ! V4       EFQ  w  rEpV EFC  pRV9   g   K  \        P                  P	                  WG4      p\        VRV R7      ;_uu_ 4       pVP                  \        P                  4      R,          P                  R4      p	 VP                  4       P                  4       P                  R4      p
\        4       pT
 F,  pY9  g   K  T	^ ,          T9  g   K  TP                  T4       K.  	  Rp\        T	4      ^8  d*   T	^,          P                  RR4      P                  R	R4      pTP                  R
T	^ ,          RTRT/4       RRR4       EKF  	  EKT  	  EKs  	  V#     RRR4       EKb  ; i  + '       g   i     EKw  ; i)tests	top_levelr	   r   r   re   Nz.dist z.eggr1   rg   exports)r   _testseggEGGinfo)r   r#   r"   r'   r)   r   splitsepr*   r<   r=   r!   r]   replace)r   rV   ignorer#   rG   rH   rI   rj   rM   packagetop_level_modulesfiltered_top_level_modulesr3   rg   s   &             r   get_locally_installed_packagesr      so   H6F!#D$&77<<3DdC(;;q"&**RVV"4R"8">">s"C%010@0F0Ft0L- 6:V2&7F!'!5!(6!9 !; A A& I '8 #'w<!+&-aj&8&8 ''--4WVR-@ $
 !"GAJ%w%'A) 7 <;  "/ J O9%$ <;;;;s7   <6F3-F
 F7FA.FFFFF1c                    \        4       p. pV  F9  pV F0  pWER ,          9   g   WER,          8X  g   K  VP                  V4       K2  	  K;  	  \        V4       UUu. uF  w  rgWsV^,           R 9  g   K  VNK  	  pppV# u uppi )r   r1   N)r   r!   	enumerate)	r@   r   localr   rj   r   rS   iresult_uniques	   &&       r   get_import_localr      s    *,EFG y))TV_-Dg&   $-V#4N#441!8MQQ#4MN Os   A>3A>c                   \        4       p\        \        R4      R4      ;_uu_ 4       p\        R V 4       4      pRRR4       V  F#  pVP	                  XP                  WD4      4       K%  	  \        VR R7      #   + '       g   i     LG; i)zGet PyPI package names from a list of imports.

Args:
    pkgs (List[str]): List of import names.

Returns:
    List[str]: The corresponding PyPI package names.

mappingr	   c              3   ^   "   T F#  qP                  4       P                  R 4      x  K%  	  R# 5i):N)r<   r   ri   rW   s   & r   rl    get_pkg_names.<locals>.<genexpr>  s      4!QGGIOOC((!s   +-Nc                 "    V P                  4       # Nlower)ss   &r   <lambda>get_pkg_names.<locals>.<lambda>%  s
    	r`   key)r    r   r)   dictr0   r{   sorted)pkgsr   rM   rX   pkgs   &    r   get_pkg_namesr     sm     UF	d9os	#	#q4!44 
$ 	

488C%& 
 &122 
$	#s   A::B
	c                    R V 9   dK   \         ^ ,          P                  V P                  4       4      pV'       d   VP                  ^ 4      ^ ,          p V P	                  R4      ^ ,          P	                  R4      ^ ,          P                  4       # )zimport z as r   )REGEXPmatchr<   groupsr:   )r1   r   s   & r   get_name_without_aliasr   (  sd    Dq	

-<<?1%D>>&!!$..s3A6<<>>r`   c                     \         P                  P                  \         P                  P                  \        4      V 4      # r   )r"   r#   r)   dirname__file__)rM   s   &r   r)   r)   0  s$    77<<1155r`   c                   . p. R	Op \        V R4      p VP                  4        Uu. uF  qDR8w  g   K  VP                  4       NK  	  ppVP                  4        T Uu. uF#  qD^ ,          P                  4       '       g   K!  TNK%  	  ppT F  p\        T Uu. uF  qfT9   NK	  	  up4      '       g   TP                  RTRR/4       T F\  pYb9   g   K  TP                  T4      pT^ ,          pTR
,          P                  RR4      p	RTRT	/pYq9  d   TP                  T4        K  	  K  	  T# u upi   TP                  4        i ; i  \         d(    \
        P                  ! RP                  T 4      4       h i ; iu upi u upi )a  Parse a requirements formatted file.

Traverse a string until a delimiter is detected, then split at said
delimiter, get module name by element index, create a dict consisting of
module:version, and add dict to list of parsed modules.

Args:
    file_: File to parse.

Raises:
    OSerror: If there's any issues accessing the file.

Returns:
    tuple: The contents of the file, excluding comments.
=r	   re   Failed on file: {}r1   rg   Nr   )<>r   !~r   )r   	readlinesr<   r   OSErrorr7   r9   r   isalphaanyr!   r   r   )
file_modulesdelimrM   rW   rX   yr3   module_namemodule_versions
   &         r   parse_requirementsr   4  sZ     G &E	
	'({{}B}!T	IAGGI}DBGGI.t!t||~AAtD.E*EqFE*++NNFAy$78Az$Qi!'!3!3C!< +y.I(NN6* 	   N- CGGI  *11%89 / +s>   E D3 D.D.D3 E=E=F
.D3 3E2E:c                &   \        V 4      p\        \        V4      4       Uu. uF  q1V,          R,          NK  	  pp\        \        V4      4       Uu. uF  q2V,          R,          NK  	  pp\        V4      \        V4      ,
          pV# u upi u upi )a'  Compare modules in a file to imported modules in a project.

Args:
    file_ (str): File to parse for modules to be compared.
    imports (tuple): Modules being imported in the project.

Returns:
    tuple: The modules not imported in the project, but do exist in the
           specified file.
r1   )r   ranger]   r    )r   r@   r   r   modules_not_importeds   &&   r   compare_modulesr   i  s     !'G+0W+>?+>aqz&!!+>G?+0W+>?+>aqz&!!+>G?w<#g,6	 @?s   B	Bc           	         \        W4      p\        P                  ! RP                  V RP	                  R V 4       4      4      4       R# )zFDisplay the difference between modules in a file and imported modules.zBThe following modules are in {} but do not seem to be imported: {}rb   c              3   $   "   T F  qx  K  	  R # 5ir   rh   r   s   & r   rl   diff.<locals>.<genexpr>  s     $E0D1Q0Ds   N)r   r7   r   r   r)   )r   r@   r   s   && r   diffr   }  s;    *5:LL	VE499$E0D$EEFHr`   c                   \        W4      p\        V4      ^ 8X  d    \        P                  ! RV ,           4       R# \        P
                  ! RP                  V4      4      p. p \        V R4      p VP                  4        F)  pVP                  V4      e   K  VP                  V4       K+  	  VP                  ^ 4       VP                  4        V F  pVP                  V4       K  	  VP                  4        \        P                  ! RT ,           4       R#   TP                  4        i ; i  \         d(    \        P                   ! RP#                  T 4      4       h i ; i)z9Remove modules that aren't imported in project from file.zNothing to clean in N|zr+r   z(Successfully cleaned up requirements in )r   r]   r7   r   recompiler)   r   r   r   r!   seektruncatern   r   r   r9   r   )r   r@   r   	re_removeto_writerM   r   s   &&     r   cleanr     s   *5:
 A%+e34

388$89:IH

	[[]??1%-OOA& # FF1IJJL
  GGILL;eCD GGI  *11%89s   #D, 0#D AD D),2Ec                    V R8X  d"   V Uu. uF  pRVR,          RR/NK  	  ppRpW3# V R8X  d   RpW3# V R8X  d   RpVX3# u upi )	zDEnables dynamic versioning with <compat>, <gt> or <non-pin> schemes.no-pinr1   rg   r   gtz>=compatz~=rh   )schemer@   rj   ro   s   &&  r   dynamic_versioningr     sq    ELMWTFDL)R8WM
 ?	 
4 ? 
8	F? Ns   Ac                 2   V P                  R 4      pV P                  R4      pV P                  R4      '       * pV R,          pVf.   \        P                  P                  \        P                  4      pV'       d   VP                  R4      pV R,          '       d
   V R,          M\        P                  P                  VR4      pV R,          '       g\   V R,          '       gM   V R	,          '       g>   \        P                  P                  V4      '       d   \        P                  ! R
4       R# \        VVVVR7      p\        V4      p\        P                  ! RRP                  V4      ,           4       RpRpV R,          '       d
   V R,          pV R,          '       d   RV R,          RV R,          /pV R,          '       d$   \        P                  ! R4       \        WaR7      p	M\        P                  ! R4       \        WaR7      p
V UUu. uFi  pVP                  4       V
 UUu. uF  qR,           F  qNK  	  K  	  upp9  g   K:  XP                  4       V
 Uu. uF  qR,          NK  	  up9  g   Kg  XNKk  	  pppV
\        VVVR7      ,           p	\!        V	R R7      p	V R,          '       d   \#        V R,          V	4       R# V R,          '       d   \%        V R,          V	4       R# V R,          '       d2   V P                  R4      pVR#9   d   \'        W4      w  rM\)        R4      hR pV R,          '       d$   \+        W4       \        P,                  ! R!4       R# \/        WYV4       \        P,                  ! R"V,           4       R# u uppi u upi u uppi )$z
--encodingz--ignorez--no-follow-linksz<path>N,z
--savepathzrequirements.txtz--printz--forcez<requirements.txt already exists, use --force to overwrite it)r   r>   r?   zFound imports: rb   https://pypi.python.org/pypi/z--pypi-serverz--proxyhttphttpsz--use-localz9Getting package information ONLY from local installation.r   z,Getting packages information from Local/PyPIr   r1   )r   r   c                 0    V R ,          P                  4       # )r1   r   )rW   s   &r   r   init.<locals>.<lambda>  s    AfIOO,=r`   r   z--diffz--cleanz--modezFInvalid argument for mode flag, use 'compat', 'gt' or 'no-pin' insteadz==z Successfully output requirementsz(Successfully saved requirements file in )r   r   r   )r{   r"   r#   abspathcurdirr   r)   existsr7   ry   rY   r   r;   r   r   r   r   r   r   r   r   rs   r   rq   )argsr   r>   r?   
input_pathr#   rB   r   r   r@   r   rW   r   
differencer   ro   s   &               r   initr     s   xx%H,xx 344LhJWW__RYY/
-33C8"&|"4"4DGGLL%78 	OO&&OOt$$ 6 	7 *23D.:<J z*JMM#dii
&;;<1KEO?+Ii'4	?CMG	I":ADE ? ", CA ggi5'O5aI,,Q,5'OO	  ggi5'A5a&		5'AA a
 C *:167BD D W"=>GH~~T(^W%Id9ow'H~~(#//0AOGV F G G IG,78"4&9?$FGE (P (BCs0   N%N>NNN,N5NNc                  &   \        \        \        R 7      p V R,          '       d   \        P                  M\        P
                  p\        P                  ! VRR7        \        V 4       R#   \         d    \        P                  ! ^ 4        R# i ; i))rg   z--debugz%(levelname)s: %(message)s)levelr   N)r   __doc__r   r7   DEBUGINFObasicConfigr   KeyboardInterruptr   exit)r   	log_levels     r   mainr   
  s\    ';/D!%igllIi0LMT
 s   A+ +!BB__main__)Nr	   )NNT)r   Nr   )&r   
contextlibr   r"   r   r   r7   r+   r5   r   rz   yargr   yarg.exceptionsr   pipreqsr   r   r   r   rY   r_   rq   rs   r   r   r   r   r   r)   r   r   r   r   r   r   r   __name__rh   r`   r   <module>r      s   $J & 	 
 	  
     %  JJ JJ34
  <;!|,
)5#L(V*3*?62j (HE@	UHp zF r`   