관리-도구
편집 파일: self_outdated_check.cpython-310.pyc
o ƚRe� � @ s d dl Z d dlZd dlZd dlZd dlZd dlZd dlZd dlm Z m Z d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d d lmZmZmZ d d lmZ dZe�e �Z!de"d e"fdd�Z#G dd� d�Z$de"d e%fdd�Z&dedej'd dfdd�Z(dS )� N)�Any�Dict)�parse)� LinkCollector)� PackageFinder)�get_default_environment)�SelectionPreferences)� PipSession)�adjacent_tmp_file�check_path_owner�replace)� ensure_dirz%Y-%m-%dT%H:%M:%SZ�key�returnc C s | � � }t�|��� }|S �N)�encode�hashlib�sha224� hexdigest)r � key_bytes�name� r ��/builddir/build/BUILDROOT/alt-python310-pip-21.3.1-3.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/pip/_internal/self_outdated_check.py�_get_statefile_name s r c @ sH e Zd Zdeddfdd�Zedefdd��Zded ejddfd d�ZdS )�SelfCheckState� cache_dirr Nc C s� i | _ d | _|rDtj�|dt| j��| _z"t| jdd��}t� |�| _ W d � W d S 1 s/w Y W d S t ttfyC Y d S w d S )N� selfcheckzutf-8)�encoding) �state�statefile_path�os�path�joinr r �open�json�load�OSError� ValueError�KeyError)�selfr � statefiler r r �__init__! s �&���zSelfCheckState.__init__c C s t jS r )�sys�prefix)r) r r r r 2 s zSelfCheckState.key�pypi_version�current_timec C s� | j sd S ttj�| j ��sd S ttj�| j �� | j|�t�|d�}t j |ddd�}t| j ��}|�|� � � W d � n1 sBw Y z t|j| j � W d S ty[ Y d S w )N)r � last_checkr. T)�,�:)� sort_keys� separators)r r r r! �dirnamer r �strftime�SELFCHECK_DATE_FMTr$ �dumpsr �writer r r r&