This commit is contained in:
2025-01-30 14:04:35 -05:00
parent b4fde9997e
commit c37938e2ed
1112 changed files with 0 additions and 210061 deletions

View File

@@ -1,241 +0,0 @@
<#
.Synopsis
Activate a Python virtual environment for the current PowerShell session.
.Description
Pushes the python executable for a virtual environment to the front of the
$Env:PATH environment variable and sets the prompt to signify that you are
in a Python virtual environment. Makes use of the command line switches as
well as the `pyvenv.cfg` file values present in the virtual environment.
.Parameter VenvDir
Path to the directory that contains the virtual environment to activate. The
default value for this is the parent of the directory that the Activate.ps1
script is located within.
.Parameter Prompt
The prompt prefix to display when this virtual environment is activated. By
default, this prompt is the name of the virtual environment folder (VenvDir)
surrounded by parentheses and followed by a single space (ie. '(.venv) ').
.Example
Activate.ps1
Activates the Python virtual environment that contains the Activate.ps1 script.
.Example
Activate.ps1 -Verbose
Activates the Python virtual environment that contains the Activate.ps1 script,
and shows extra information about the activation as it executes.
.Example
Activate.ps1 -VenvDir C:\Users\MyUser\Common\.venv
Activates the Python virtual environment located in the specified location.
.Example
Activate.ps1 -Prompt "MyPython"
Activates the Python virtual environment that contains the Activate.ps1 script,
and prefixes the current prompt with the specified string (surrounded in
parentheses) while the virtual environment is active.
.Notes
On Windows, it may be required to enable this Activate.ps1 script by setting the
execution policy for the user. You can do this by issuing the following PowerShell
command:
PS C:\> Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
For more information on Execution Policies:
https://go.microsoft.com/fwlink/?LinkID=135170
#>
Param(
[Parameter(Mandatory = $false)]
[String]
$VenvDir,
[Parameter(Mandatory = $false)]
[String]
$Prompt
)
<# Function declarations --------------------------------------------------- #>
<#
.Synopsis
Remove all shell session elements added by the Activate script, including the
addition of the virtual environment's Python executable from the beginning of
the PATH variable.
.Parameter NonDestructive
If present, do not remove this function from the global namespace for the
session.
#>
function global:deactivate ([switch]$NonDestructive) {
# Revert to original values
# The prior prompt:
if (Test-Path -Path Function:_OLD_VIRTUAL_PROMPT) {
Copy-Item -Path Function:_OLD_VIRTUAL_PROMPT -Destination Function:prompt
Remove-Item -Path Function:_OLD_VIRTUAL_PROMPT
}
# The prior PYTHONHOME:
if (Test-Path -Path Env:_OLD_VIRTUAL_PYTHONHOME) {
Copy-Item -Path Env:_OLD_VIRTUAL_PYTHONHOME -Destination Env:PYTHONHOME
Remove-Item -Path Env:_OLD_VIRTUAL_PYTHONHOME
}
# The prior PATH:
if (Test-Path -Path Env:_OLD_VIRTUAL_PATH) {
Copy-Item -Path Env:_OLD_VIRTUAL_PATH -Destination Env:PATH
Remove-Item -Path Env:_OLD_VIRTUAL_PATH
}
# Just remove the VIRTUAL_ENV altogether:
if (Test-Path -Path Env:VIRTUAL_ENV) {
Remove-Item -Path env:VIRTUAL_ENV
}
# Just remove the _PYTHON_VENV_PROMPT_PREFIX altogether:
if (Get-Variable -Name "_PYTHON_VENV_PROMPT_PREFIX" -ErrorAction SilentlyContinue) {
Remove-Variable -Name _PYTHON_VENV_PROMPT_PREFIX -Scope Global -Force
}
# Leave deactivate function in the global namespace if requested:
if (-not $NonDestructive) {
Remove-Item -Path function:deactivate
}
}
<#
.Description
Get-PyVenvConfig parses the values from the pyvenv.cfg file located in the
given folder, and returns them in a map.
For each line in the pyvenv.cfg file, if that line can be parsed into exactly
two strings separated by `=` (with any amount of whitespace surrounding the =)
then it is considered a `key = value` line. The left hand string is the key,
the right hand is the value.
If the value starts with a `'` or a `"` then the first and last character is
stripped from the value before being captured.
.Parameter ConfigDir
Path to the directory that contains the `pyvenv.cfg` file.
#>
function Get-PyVenvConfig(
[String]
$ConfigDir
) {
Write-Verbose "Given ConfigDir=$ConfigDir, obtain values in pyvenv.cfg"
# Ensure the file exists, and issue a warning if it doesn't (but still allow the function to continue).
$pyvenvConfigPath = Join-Path -Resolve -Path $ConfigDir -ChildPath 'pyvenv.cfg' -ErrorAction Continue
# An empty map will be returned if no config file is found.
$pyvenvConfig = @{ }
if ($pyvenvConfigPath) {
Write-Verbose "File exists, parse `key = value` lines"
$pyvenvConfigContent = Get-Content -Path $pyvenvConfigPath
$pyvenvConfigContent | ForEach-Object {
$keyval = $PSItem -split "\s*=\s*", 2
if ($keyval[0] -and $keyval[1]) {
$val = $keyval[1]
# Remove extraneous quotations around a string value.
if ("'""".Contains($val.Substring(0, 1))) {
$val = $val.Substring(1, $val.Length - 2)
}
$pyvenvConfig[$keyval[0]] = $val
Write-Verbose "Adding Key: '$($keyval[0])'='$val'"
}
}
}
return $pyvenvConfig
}
<# Begin Activate script --------------------------------------------------- #>
# Determine the containing directory of this script
$VenvExecPath = Split-Path -Parent $MyInvocation.MyCommand.Definition
$VenvExecDir = Get-Item -Path $VenvExecPath
Write-Verbose "Activation script is located in path: '$VenvExecPath'"
Write-Verbose "VenvExecDir Fullname: '$($VenvExecDir.FullName)"
Write-Verbose "VenvExecDir Name: '$($VenvExecDir.Name)"
# Set values required in priority: CmdLine, ConfigFile, Default
# First, get the location of the virtual environment, it might not be
# VenvExecDir if specified on the command line.
if ($VenvDir) {
Write-Verbose "VenvDir given as parameter, using '$VenvDir' to determine values"
}
else {
Write-Verbose "VenvDir not given as a parameter, using parent directory name as VenvDir."
$VenvDir = $VenvExecDir.Parent.FullName.TrimEnd("\\/")
Write-Verbose "VenvDir=$VenvDir"
}
# Next, read the `pyvenv.cfg` file to determine any required value such
# as `prompt`.
$pyvenvCfg = Get-PyVenvConfig -ConfigDir $VenvDir
# Next, set the prompt from the command line, or the config file, or
# just use the name of the virtual environment folder.
if ($Prompt) {
Write-Verbose "Prompt specified as argument, using '$Prompt'"
}
else {
Write-Verbose "Prompt not specified as argument to script, checking pyvenv.cfg value"
if ($pyvenvCfg -and $pyvenvCfg['prompt']) {
Write-Verbose " Setting based on value in pyvenv.cfg='$($pyvenvCfg['prompt'])'"
$Prompt = $pyvenvCfg['prompt'];
}
else {
Write-Verbose " Setting prompt based on parent's directory's name. (Is the directory name passed to venv module when creating the virutal environment)"
Write-Verbose " Got leaf-name of $VenvDir='$(Split-Path -Path $venvDir -Leaf)'"
$Prompt = Split-Path -Path $venvDir -Leaf
}
}
Write-Verbose "Prompt = '$Prompt'"
Write-Verbose "VenvDir='$VenvDir'"
# Deactivate any currently active virtual environment, but leave the
# deactivate function in place.
deactivate -nondestructive
# Now set the environment variable VIRTUAL_ENV, used by many tools to determine
# that there is an activated venv.
$env:VIRTUAL_ENV = $VenvDir
if (-not $Env:VIRTUAL_ENV_DISABLE_PROMPT) {
Write-Verbose "Setting prompt to '$Prompt'"
# Set the prompt to include the env name
# Make sure _OLD_VIRTUAL_PROMPT is global
function global:_OLD_VIRTUAL_PROMPT { "" }
Copy-Item -Path function:prompt -Destination function:_OLD_VIRTUAL_PROMPT
New-Variable -Name _PYTHON_VENV_PROMPT_PREFIX -Description "Python virtual environment prompt prefix" -Scope Global -Option ReadOnly -Visibility Public -Value $Prompt
function global:prompt {
Write-Host -NoNewline -ForegroundColor Green "($_PYTHON_VENV_PROMPT_PREFIX) "
_OLD_VIRTUAL_PROMPT
}
}
# Clear PYTHONHOME
if (Test-Path -Path Env:PYTHONHOME) {
Copy-Item -Path Env:PYTHONHOME -Destination Env:_OLD_VIRTUAL_PYTHONHOME
Remove-Item -Path Env:PYTHONHOME
}
# Add the venv to the PATH
Copy-Item -Path Env:PATH -Destination Env:_OLD_VIRTUAL_PATH
$Env:PATH = "$VenvExecDir$([System.IO.Path]::PathSeparator)$Env:PATH"

View File

@@ -1,66 +0,0 @@
# This file must be used with "source bin/activate" *from bash*
# you cannot run it directly
deactivate () {
# reset old environment variables
if [ -n "${_OLD_VIRTUAL_PATH:-}" ] ; then
PATH="${_OLD_VIRTUAL_PATH:-}"
export PATH
unset _OLD_VIRTUAL_PATH
fi
if [ -n "${_OLD_VIRTUAL_PYTHONHOME:-}" ] ; then
PYTHONHOME="${_OLD_VIRTUAL_PYTHONHOME:-}"
export PYTHONHOME
unset _OLD_VIRTUAL_PYTHONHOME
fi
# This should detect bash and zsh, which have a hash command that must
# be called to get it to forget past commands. Without forgetting
# past commands the $PATH changes we made may not be respected
if [ -n "${BASH:-}" -o -n "${ZSH_VERSION:-}" ] ; then
hash -r 2> /dev/null
fi
if [ -n "${_OLD_VIRTUAL_PS1:-}" ] ; then
PS1="${_OLD_VIRTUAL_PS1:-}"
export PS1
unset _OLD_VIRTUAL_PS1
fi
unset VIRTUAL_ENV
if [ ! "${1:-}" = "nondestructive" ] ; then
# Self destruct!
unset -f deactivate
fi
}
# unset irrelevant variables
deactivate nondestructive
VIRTUAL_ENV="/home/gwitt1/gwitt1Repo/MidasHMM"
export VIRTUAL_ENV
_OLD_VIRTUAL_PATH="$PATH"
PATH="$VIRTUAL_ENV/bin:$PATH"
export PATH
# unset PYTHONHOME if set
# this will fail if PYTHONHOME is set to the empty string (which is bad anyway)
# could use `if (set -u; : $PYTHONHOME) ;` in bash
if [ -n "${PYTHONHOME:-}" ] ; then
_OLD_VIRTUAL_PYTHONHOME="${PYTHONHOME:-}"
unset PYTHONHOME
fi
if [ -z "${VIRTUAL_ENV_DISABLE_PROMPT:-}" ] ; then
_OLD_VIRTUAL_PS1="${PS1:-}"
PS1="(MidasHMM) ${PS1:-}"
export PS1
fi
# This should detect bash and zsh, which have a hash command that must
# be called to get it to forget past commands. Without forgetting
# past commands the $PATH changes we made may not be respected
if [ -n "${BASH:-}" -o -n "${ZSH_VERSION:-}" ] ; then
hash -r 2> /dev/null
fi

View File

@@ -1,25 +0,0 @@
# This file must be used with "source bin/activate.csh" *from csh*.
# You cannot run it directly.
# Created by Davide Di Blasi <davidedb@gmail.com>.
# Ported to Python 3.3 venv by Andrew Svetlov <andrew.svetlov@gmail.com>
alias deactivate 'test $?_OLD_VIRTUAL_PATH != 0 && setenv PATH "$_OLD_VIRTUAL_PATH" && unset _OLD_VIRTUAL_PATH; rehash; test $?_OLD_VIRTUAL_PROMPT != 0 && set prompt="$_OLD_VIRTUAL_PROMPT" && unset _OLD_VIRTUAL_PROMPT; unsetenv VIRTUAL_ENV; test "\!:*" != "nondestructive" && unalias deactivate'
# Unset irrelevant variables.
deactivate nondestructive
setenv VIRTUAL_ENV "/home/gwitt1/gwitt1Repo/MidasHMM"
set _OLD_VIRTUAL_PATH="$PATH"
setenv PATH "$VIRTUAL_ENV/bin:$PATH"
set _OLD_VIRTUAL_PROMPT="$prompt"
if (! "$?VIRTUAL_ENV_DISABLE_PROMPT") then
set prompt = "(MidasHMM) $prompt"
endif
alias pydoc python -m pydoc
rehash

View File

@@ -1,64 +0,0 @@
# This file must be used with "source <venv>/bin/activate.fish" *from fish*
# (https://fishshell.com/); you cannot run it directly.
function deactivate -d "Exit virtual environment and return to normal shell environment"
# reset old environment variables
if test -n "$_OLD_VIRTUAL_PATH"
set -gx PATH $_OLD_VIRTUAL_PATH
set -e _OLD_VIRTUAL_PATH
end
if test -n "$_OLD_VIRTUAL_PYTHONHOME"
set -gx PYTHONHOME $_OLD_VIRTUAL_PYTHONHOME
set -e _OLD_VIRTUAL_PYTHONHOME
end
if test -n "$_OLD_FISH_PROMPT_OVERRIDE"
functions -e fish_prompt
set -e _OLD_FISH_PROMPT_OVERRIDE
functions -c _old_fish_prompt fish_prompt
functions -e _old_fish_prompt
end
set -e VIRTUAL_ENV
if test "$argv[1]" != "nondestructive"
# Self-destruct!
functions -e deactivate
end
end
# Unset irrelevant variables.
deactivate nondestructive
set -gx VIRTUAL_ENV "/home/gwitt1/gwitt1Repo/MidasHMM"
set -gx _OLD_VIRTUAL_PATH $PATH
set -gx PATH "$VIRTUAL_ENV/bin" $PATH
# Unset PYTHONHOME if set.
if set -q PYTHONHOME
set -gx _OLD_VIRTUAL_PYTHONHOME $PYTHONHOME
set -e PYTHONHOME
end
if test -z "$VIRTUAL_ENV_DISABLE_PROMPT"
# fish uses a function instead of an env var to generate the prompt.
# Save the current fish_prompt function as the function _old_fish_prompt.
functions -c fish_prompt _old_fish_prompt
# With the original prompt function renamed, we can override with our own.
function fish_prompt
# Save the return status of the last command.
set -l old_status $status
# Output the venv prompt; color taken from the blue of the Python logo.
printf "%s%s%s" (set_color 4B8BBE) "(MidasHMM) " (set_color normal)
# Restore the return status of the previous command.
echo "exit $old_status" | .
# Output the original/"old" prompt.
_old_fish_prompt
end
set -gx _OLD_FISH_PROMPT_OVERRIDE "$VIRTUAL_ENV"
end

View File

@@ -1,8 +0,0 @@
#!/home/gwitt1/gwitt1Repo/MidasHMM/bin/python3
# -*- coding: utf-8 -*-
import re
import sys
from pip._internal.cli.main import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
sys.exit(main())

View File

@@ -1,8 +0,0 @@
#!/home/gwitt1/gwitt1Repo/MidasHMM/bin/python3
# -*- coding: utf-8 -*-
import re
import sys
from pip._internal.cli.main import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
sys.exit(main())

View File

@@ -1,8 +0,0 @@
#!/home/gwitt1/gwitt1Repo/MidasHMM/bin/python3
# -*- coding: utf-8 -*-
import re
import sys
from pip._internal.cli.main import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
sys.exit(main())

View File

@@ -1 +0,0 @@
python3

View File

@@ -1 +0,0 @@
/home/gwitt1/anaconda3/bin/python3

View File

@@ -1 +0,0 @@
python3

View File

@@ -1,14 +0,0 @@
data_dir: "../../../../MidasData"
output_dir: "../MidasOutput"
tickers: ["MRNA", "NVDA", "CRWD"] # Add your tickers here
combine_tickers: True # Whether to train single unified model
resample_freq: "1H" # 1H, 4H, 1D
n_states_range: [3, 4] # Test states 3-5
features:
- returns
- volatility
- rsi
- macd
- atr
- volume_change
- obv

View File

@@ -1,63 +0,0 @@
# main.py
import yaml
import logging
from pathlib import Path
from midas.data_processor import DataProcessor
from midas.feature_engineer import FeatureEngineer
from midas.hmm_trainer import HMMTrainer
from midas.analysis import MarketRegimeAnalysis
def main():
# Setup logging
logging.basicConfig(
level=logging.INFO,
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
handlers=[
logging.FileHandler("midas.log"),
logging.StreamHandler()
]
)
try:
# Load config
with open('config/params.yaml') as f:
config = yaml.safe_load(f)
# Create output directory
output_dir = Path(config['output_dir'])
output_dir.mkdir(parents=True, exist_ok=True)
# Process data
processor = DataProcessor(config)
raw_data = processor.process_tickers()
# Engineer features
engineer = FeatureEngineer(config)
features = engineer.calculate_features(raw_data)
# Train HMM
trainer = HMMTrainer(config)
model = trainer.train(features)
trainer.save_model(output_dir / "hmm_model.pkl")
# Generate analysis
analysis = MarketRegimeAnalysis(model, features)
# Save plots
analysis.plot_regimes(pd.concat([d['close'] for d in raw_data.values]))
plt.savefig(output_dir / "combined_regimes.png")
analysis.plot_transition_matrix()
plt.savefig(output_dir / "transition_matrix.png")
analysis.plot_state_durations()
plt.savefig(output_dir / "state_durations.png")
logging.info("Process completed successfully")
except Exception as e:
logging.error(f"Main process failed: {str(e)}", exc_info=True)
raise
if __name__ == "__main__":
main()

View File

@@ -1,49 +0,0 @@
# midas/analysis.py
import matplotlib.pyplot as plt
import seaborn as sns
from matplotlib.lines import Line2D
import numpy as np
class MarketRegimeAnalysis:
def __init__(self, model, features):
self.model = model
self.features = features
self.states = model.predict(features)
def plot_regimes(self, prices: pd.Series):
plt.figure(figsize=(15, 8))
palette = sns.color_palette("husl", n_colors=self.model.n_components)
for state in range(self.model.n_components):
mask = self.states == state
plt.scatter(prices.index[mask], prices[mask],
color=palette[state], s=10, label=f'Regime {state}')
plt.title("Market Regime Visualization")
plt.xlabel("Date")
plt.ylabel("Price")
plt.legend()
return plt
def plot_transition_matrix(self):
transmat = self.model.transmat_
plt.figure(figsize=(10, 8))
sns.heatmap(transmat, annot=True, fmt=".2f", cmap="Blues",
xticklabels=range(transmat.shape[0]),
yticklabels=range(transmat.shape[1]))
plt.title("State Transition Probabilities")
plt.xlabel("Next State")
plt.ylabel("Current State")
return plt
def plot_state_durations(self):
state_changes = np.diff(self.states, prepend=self.states[0])
change_points = np.where(state_changes != 0)[0]
durations = np.diff(np.append(change_points, len(self.states)))
plt.figure(figsize=(10, 6))
sns.histplot(durations, bins=30, kde=True)
plt.title("Regime Duration Distribution")
plt.xlabel("Duration (Bars)")
plt.ylabel("Frequency")
return plt

View File

@@ -1,95 +0,0 @@
# midas/data_processor.py
import pandas as pd
import numpy as np
from pathlib import Path
import logging
from typing import List, Dict
class DataProcessor:
def __init__(self, config: Dict):
self.config = config
self.logger = logging.getLogger(__name__)
def _load_raw_data(self, ticker: str) -> pd.DataFrame:
file_path = Path(self.config['data_dir']) / f"{ticker}_5min_3years.csv"
if not file_path.exists():
raise FileNotFoundError(f"Data file not found: {file_path}")
df = pd.read_csv(
file_path,
parse_dates=['timestamp'],
usecols=['timestamp', 'open', 'high', 'low', 'close', 'volume'],
dtype={
'open': 'float32',
'high': 'float32',
'low': 'float32',
'close': 'float32',
'volume': 'float32'
}
)
return df.sort_values('timestamp').set_index('timestamp')
def _clean_data(self, df: pd.DataFrame) -> pd.DataFrame:
"""Robust data cleaning pipeline"""
# Handle missing values
df = df.dropna()
# Validate price data
self._validate_prices(df)
# Validate trading hours
df = self._filter_trading_hours(df)
# Remove outliers
df = self._remove_price_outliers(df)
df = self._remove_volume_outliers(df)
# Resample and forward fill missing intervals
df = df.resample(self.config['resample_freq']).last().ffill()
return df
def _validate_prices(self, df: pd.DataFrame):
"""Ensure price data integrity"""
if (df['close'] <= 0).any():
bad_values = df[df['close'] <= 0]
self.logger.error(f"Invalid close prices: {bad_values.index}")
raise ValueError("Negative/zero close prices detected")
if not (df['high'] >= df['low']).all():
raise ValueError("High prices < Low prices detected")
if not df['close'].is_monotonic_increasing:
self.logger.warning("Non-monotonic timestamps detected")
def _filter_trading_hours(self, df: pd.DataFrame) -> pd.DataFrame:
"""Remove non-market hours (if intraday data)"""
if pd.infer_freq(df.index) in ('H', 'T'):
return df.between_time('09:30', '16:00')
return df
def _remove_price_outliers(self, df: pd.DataFrame) -> pd.DataFrame:
"""Remove prices beyond 10 standard deviations"""
returns = np.log(df['close']).diff().dropna()
mask = (returns.abs() < 10 * returns.std()).reindex(df.index).ffill()
return df[mask]
def _remove_volume_outliers(self, df: pd.DataFrame) -> pd.DataFrame:
"""Remove volume spikes beyond 20 standard deviations"""
log_volume = np.log(df['volume'])
mask = (log_volume < log_volume.mean() + 20*log_volume.std())
return df[mask]
def process_tickers(self) -> Dict[str, pd.DataFrame]:
"""Process all tickers with cleaning and resampling"""
processed = {}
for ticker in self.config['tickers']:
try:
self.logger.info(f"Processing {ticker}")
df = self._load_raw_data(ticker)
df = self._clean_data(df)
processed[ticker] = df
except Exception as e:
self.logger.error(f"Failed processing {ticker}: {str(e)}")
raise
return processed

View File

@@ -1,72 +0,0 @@
# midas/feature_engineer.py
import numpy as np
import pandas as pd
from sklearn.preprocessing import RobustScaler
from typing import Dict
class FeatureEngineer:
def __init__(self, config: Dict):
self.config = config
self.scaler = RobustScaler() # Handles outliers
def _calculate_obv(self, df: pd.DataFrame) -> pd.Series:
"""On-Balance Volume"""
obv = (np.sign(df['close'].diff()) * df['volume']).fillna(0).cumsum()
return obv.pct_change(periods=14) # Normalized OBV
def calculate_features(self, data: Dict[str, pd.DataFrame]) -> pd.DataFrame:
all_features = []
for ticker, df in data.items():
features = pd.DataFrame(index=df.index)
# Price-based features
if 'returns' in self.config['features']:
features['returns'] = np.log(df['close']).diff()
if 'volatility' in self.config['features']:
features['volatility'] = features['returns'].rolling(20).std() * np.sqrt(252)
if 'rsi' in self.config['features']:
delta = df['close'].diff()
gain = delta.where(delta > 0, 0).rolling(14).mean()
loss = -delta.where(delta < 0, 0).rolling(14).mean()
features['rsi'] = 100 - (100 / (1 + (gain / loss)))
if 'macd' in self.config['features']:
ema12 = df['close'].ewm(span=12, adjust=False).mean()
ema26 = df['close'].ewm(span=26, adjust=False).mean()
features['macd'] = ema12 - ema26
if 'atr' in self.config['features']:
high_low = df['high'] - df['low']
high_close = (df['high'] - df['close'].shift()).abs()
low_close = (df['low'] - df['close'].shift()).abs()
tr = pd.concat([high_low, high_close, low_close], axis=1).max(axis=1)
features['atr'] = tr.rolling(14).mean() / df['close']
if 'volume_change' in self.config['features']:
features['volume_change'] = np.log(df['volume'] / df['volume'].shift(1))
if 'obv' in self.config['features']:
features['obv'] = self._calculate_obv(df)
# Add ticker identifier if combining
if self.config['combine_tickers']:
features['ticker'] = ticker
all_features.append(features.dropna())
combined = pd.concat(all_features).sort_index()
# Encode tickers if combining
if self.config['combine_tickers']:
combined = pd.get_dummies(combined, columns=['ticker'], prefix='', prefix_sep='')
# Scale features
scaled = pd.DataFrame(
self.scaler.fit_transform(combined),
index=combined.index,
columns=combined.columns
)
return scaled

View File

@@ -1,74 +0,0 @@
# midas/hmm_trainer.py
import numpy as np
from hmmlearn import hmm
import joblib
from sklearn.model_selection import TimeSeriesSplit
from sklearn.metrics import silhouette_score
import logging
class HMMTrainer:
def __init__(self, config: Dict):
self.config = config
self.logger = logging.getLogger(__name__)
self.best_model = None
def _calculate_bic(self, model, X):
"""Bayesian Information Criterion"""
log_likelihood = model.score(X)
n_params = model.n_components * (model.n_components - 1) + \
model.n_components * X.shape[1] * 2 # Means and variances
return -2 * log_likelihood + n_params * np.log(X.shape[0])
def train(self, features: pd.DataFrame):
best_score = -np.inf
best_model = None
# Time-series cross validation
tscv = TimeSeriesSplit(n_splits=3)
for n_components in range(*self.config['n_states_range']):
try:
fold_scores = []
for train_idx, test_idx in tscv.split(features):
X_train = features.iloc[train_idx]
X_test = features.iloc[test_idx]
model = hmm.GaussianHMM(
n_components=n_components,
covariance_type="diag",
n_iter=1000,
random_state=42
)
model.fit(X_train)
# Score using both likelihood and regime persistence
log_likelihood = model.score(X_test)
states = model.predict(X_test)
persistence = np.mean([len(list(g)) for _, g in groupby(states)])
score = log_likelihood + persistence
fold_scores.append(score)
avg_score = np.mean(fold_scores)
bic = self._calculate_bic(model, features)
self.logger.info(f"States {n_components}: BIC={bic:.2f}, Score={avg_score:.2f}")
if avg_score > best_score:
best_score = avg_score
self.best_model = model
except Exception as e:
self.logger.error(f"Failed training {n_components} states: {str(e)}")
if not self.best_model:
raise RuntimeError("No valid models trained")
self.best_model.fit(features) # Final training on full dataset
return self.best_model
def save_model(self, path: str):
joblib.dump({
'model': self.best_model,
'scaler': self.scaler,
'config': self.config
}, path)

View File

@@ -1,8 +0,0 @@
numpy
pandas
hmmlearn
scikit-learn
matplotlib
seaborn
pyyaml
joblib

View File

@@ -1,128 +0,0 @@
import sys
import os
import re
import importlib
import warnings
is_pypy = '__pypy__' in sys.builtin_module_names
warnings.filterwarnings('ignore',
r'.+ distutils\b.+ deprecated',
DeprecationWarning)
def warn_distutils_present():
if 'distutils' not in sys.modules:
return
if is_pypy and sys.version_info < (3, 7):
# PyPy for 3.6 unconditionally imports distutils, so bypass the warning
# https://foss.heptapod.net/pypy/pypy/-/blob/be829135bc0d758997b3566062999ee8b23872b4/lib-python/3/site.py#L250
return
warnings.warn(
"Distutils was imported before Setuptools, but importing Setuptools "
"also replaces the `distutils` module in `sys.modules`. This may lead "
"to undesirable behaviors or errors. To avoid these issues, avoid "
"using distutils directly, ensure that setuptools is installed in the "
"traditional way (e.g. not an editable install), and/or make sure "
"that setuptools is always imported before distutils.")
def clear_distutils():
if 'distutils' not in sys.modules:
return
warnings.warn("Setuptools is replacing distutils.")
mods = [name for name in sys.modules if re.match(r'distutils\b', name)]
for name in mods:
del sys.modules[name]
def enabled():
"""
Allow selection of distutils by environment variable.
"""
which = os.environ.get('SETUPTOOLS_USE_DISTUTILS', 'stdlib')
return which == 'local'
def ensure_local_distutils():
clear_distutils()
distutils = importlib.import_module('setuptools._distutils')
distutils.__name__ = 'distutils'
sys.modules['distutils'] = distutils
# sanity check that submodules load as expected
core = importlib.import_module('distutils.core')
assert '_distutils' in core.__file__, core.__file__
def do_override():
"""
Ensure that the local copy of distutils is preferred over stdlib.
See https://github.com/pypa/setuptools/issues/417#issuecomment-392298401
for more motivation.
"""
if enabled():
warn_distutils_present()
ensure_local_distutils()
class DistutilsMetaFinder:
def find_spec(self, fullname, path, target=None):
if path is not None:
return
method_name = 'spec_for_{fullname}'.format(**locals())
method = getattr(self, method_name, lambda: None)
return method()
def spec_for_distutils(self):
import importlib.abc
import importlib.util
class DistutilsLoader(importlib.abc.Loader):
def create_module(self, spec):
return importlib.import_module('setuptools._distutils')
def exec_module(self, module):
pass
return importlib.util.spec_from_loader('distutils', DistutilsLoader())
def spec_for_pip(self):
"""
Ensure stdlib distutils when running under pip.
See pypa/pip#8761 for rationale.
"""
if self.pip_imported_during_build():
return
clear_distutils()
self.spec_for_distutils = lambda: None
@staticmethod
def pip_imported_during_build():
"""
Detect if pip is being imported in a build script. Ref #2355.
"""
import traceback
return any(
frame.f_globals['__file__'].endswith('setup.py')
for frame, line in traceback.walk_stack(None)
)
DISTUTILS_FINDER = DistutilsMetaFinder()
def add_shim():
sys.meta_path.insert(0, DISTUTILS_FINDER)
def remove_shim():
try:
sys.meta_path.remove(DISTUTILS_FINDER)
except ValueError:
pass

View File

@@ -1 +0,0 @@
__import__('_distutils_hack').do_override()

View File

@@ -1 +0,0 @@
import os; var = 'SETUPTOOLS_USE_DISTUTILS'; enabled = os.environ.get(var, 'stdlib') == 'local'; enabled and __import__('_distutils_hack').add_shim();

View File

@@ -1,20 +0,0 @@
Copyright (c) 2008-2021 The pip developers (see AUTHORS.txt file)
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@@ -1,92 +0,0 @@
Metadata-Version: 2.1
Name: pip
Version: 21.2.3
Summary: The PyPA recommended tool for installing Python packages.
Home-page: https://pip.pypa.io/
Author: The pip developers
Author-email: distutils-sig@python.org
License: MIT
Project-URL: Documentation, https://pip.pypa.io
Project-URL: Source, https://github.com/pypa/pip
Project-URL: Changelog, https://pip.pypa.io/en/stable/news/
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Topic :: Software Development :: Build Tools
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Requires-Python: >=3.6
License-File: LICENSE.txt
pip - The Python Package Installer
==================================
.. image:: https://img.shields.io/pypi/v/pip.svg
:target: https://pypi.org/project/pip/
.. image:: https://readthedocs.org/projects/pip/badge/?version=latest
:target: https://pip.pypa.io/en/latest
pip is the `package installer`_ for Python. You can use pip to install packages from the `Python Package Index`_ and other indexes.
Please take a look at our documentation for how to install and use pip:
* `Installation`_
* `Usage`_
We release updates regularly, with a new version every 3 months. Find more details in our documentation:
* `Release notes`_
* `Release process`_
In pip 20.3, we've `made a big improvement to the heart of pip`_; `learn more`_. We want your input, so `sign up for our user experience research studies`_ to help us do it right.
**Note**: pip 21.0, in January 2021, removed Python 2 support, per pip's `Python 2 support policy`_. Please migrate to Python 3.
If you find bugs, need help, or want to talk to the developers, please use our mailing lists or chat rooms:
* `Issue tracking`_
* `Discourse channel`_
* `User IRC`_
If you want to get involved head over to GitHub to get the source code, look at our development documentation and feel free to jump on the developer mailing lists and chat rooms:
* `GitHub page`_
* `Development documentation`_
* `Development mailing list`_
* `Development IRC`_
Code of Conduct
---------------
Everyone interacting in the pip project's codebases, issue trackers, chat
rooms, and mailing lists is expected to follow the `PSF Code of Conduct`_.
.. _package installer: https://packaging.python.org/guides/tool-recommendations/
.. _Python Package Index: https://pypi.org
.. _Installation: https://pip.pypa.io/en/stable/installation/
.. _Usage: https://pip.pypa.io/en/stable/
.. _Release notes: https://pip.pypa.io/en/stable/news.html
.. _Release process: https://pip.pypa.io/en/latest/development/release-process/
.. _GitHub page: https://github.com/pypa/pip
.. _Development documentation: https://pip.pypa.io/en/latest/development
.. _made a big improvement to the heart of pip: https://pyfound.blogspot.com/2020/11/pip-20-3-new-resolver.html
.. _learn more: https://pip.pypa.io/en/latest/user_guide/#changes-to-the-pip-dependency-resolver-in-20-3-2020
.. _sign up for our user experience research studies: https://pyfound.blogspot.com/2020/03/new-pip-resolver-to-roll-out-this-year.html
.. _Python 2 support policy: https://pip.pypa.io/en/latest/development/release-process/#python-2-support
.. _Issue tracking: https://github.com/pypa/pip/issues
.. _Discourse channel: https://discuss.python.org/c/packaging
.. _Development mailing list: https://mail.python.org/mailman3/lists/distutils-sig.python.org/
.. _User IRC: https://kiwiirc.com/nextclient/#ircs://irc.libera.chat:+6697/pypa
.. _Development IRC: https://kiwiirc.com/nextclient/#ircs://irc.libera.chat:+6697/pypa-dev
.. _PSF Code of Conduct: https://github.com/pypa/.github/blob/main/CODE_OF_CONDUCT.md

View File

@@ -1,795 +0,0 @@
../../../bin/pip,sha256=mtmXGa6bjnZDeR2q0BMNMmFueWLpZQosiQab6s2IPSc,249
../../../bin/pip3,sha256=mtmXGa6bjnZDeR2q0BMNMmFueWLpZQosiQab6s2IPSc,249
../../../bin/pip3.9,sha256=mtmXGa6bjnZDeR2q0BMNMmFueWLpZQosiQab6s2IPSc,249
pip-21.2.3.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
pip-21.2.3.dist-info/LICENSE.txt,sha256=gJDJthjxG8mDPXZg96yUjnIt4bce2hULfec5mrfNnmI,1110
pip-21.2.3.dist-info/METADATA,sha256=BA4M-MqDkwwNoSPm1cVEoleu3sEr_iN4HbpM3cjr6rI,4165
pip-21.2.3.dist-info/RECORD,,
pip-21.2.3.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
pip-21.2.3.dist-info/WHEEL,sha256=OqRkF0eY5GHssMorFjlbTIq072vpHpF60fIQA6lS9xA,92
pip-21.2.3.dist-info/entry_points.txt,sha256=HtfDOwpUlr9s73jqLQ6wF9V0_0qvUXJwCBz7Vwx0Ue0,125
pip-21.2.3.dist-info/top_level.txt,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
pip/__init__.py,sha256=qXU49Q5cd1uydhWo2AnReaOxEtM0o8t5EP9EvhtRCN8,370
pip/__main__.py,sha256=8mTMucDffyV05KR_fXWM2p1JQEnHPu1-CWjbthYHYis,1229
pip/__pycache__/__init__.cpython-39.pyc,,
pip/__pycache__/__main__.cpython-39.pyc,,
pip/_internal/__init__.py,sha256=OLxitHt9NAlSaObDjAlRSYUkAftIjV9sUpv1yIZDO4E,592
pip/_internal/__pycache__/__init__.cpython-39.pyc,,
pip/_internal/__pycache__/build_env.cpython-39.pyc,,
pip/_internal/__pycache__/cache.cpython-39.pyc,,
pip/_internal/__pycache__/configuration.cpython-39.pyc,,
pip/_internal/__pycache__/exceptions.cpython-39.pyc,,
pip/_internal/__pycache__/main.cpython-39.pyc,,
pip/_internal/__pycache__/pyproject.cpython-39.pyc,,
pip/_internal/__pycache__/self_outdated_check.cpython-39.pyc,,
pip/_internal/__pycache__/wheel_builder.cpython-39.pyc,,
pip/_internal/build_env.py,sha256=YMIinJTDdKm_x5JC8IjJZp-_Zw42kBm6fkiWprBi-Hk,10415
pip/_internal/cache.py,sha256=bjyh33eOAq6kX1kPk84Oxb_JXazpP6izVZipJLq0eJI,10245
pip/_internal/cli/__init__.py,sha256=9gMw_A_StJXzDh2Rhxil6bd8tFP-ZR719Q1pINHAw5I,136
pip/_internal/cli/__pycache__/__init__.cpython-39.pyc,,
pip/_internal/cli/__pycache__/autocompletion.cpython-39.pyc,,
pip/_internal/cli/__pycache__/base_command.cpython-39.pyc,,
pip/_internal/cli/__pycache__/cmdoptions.cpython-39.pyc,,
pip/_internal/cli/__pycache__/command_context.cpython-39.pyc,,
pip/_internal/cli/__pycache__/main.cpython-39.pyc,,
pip/_internal/cli/__pycache__/main_parser.cpython-39.pyc,,
pip/_internal/cli/__pycache__/parser.cpython-39.pyc,,
pip/_internal/cli/__pycache__/progress_bars.cpython-39.pyc,,
pip/_internal/cli/__pycache__/req_command.cpython-39.pyc,,
pip/_internal/cli/__pycache__/spinners.cpython-39.pyc,,
pip/_internal/cli/__pycache__/status_codes.cpython-39.pyc,,
pip/_internal/cli/autocompletion.py,sha256=_d6Ugrj-KQOCoDgDscSr_238-RcwedXzpLmW8F_L_uc,6562
pip/_internal/cli/base_command.py,sha256=mZH7AMA9tBoiYEysFx9l3Pe_h23mnNZy8K8M_ZhsRSs,7810
pip/_internal/cli/cmdoptions.py,sha256=Kalu7Z2ZAvySgOOIo4e_Ah3Vv8HDmGhLQlkDysI-ihw,29292
pip/_internal/cli/command_context.py,sha256=ocjEqsuP6pFF98N_ljRyLToYLm5fBgMaZicVjMy_f0Y,787
pip/_internal/cli/main.py,sha256=D6DAuHgfr4na5SuEbtLyx1FlZhcGHIB9BltXsjrrKsA,2542
pip/_internal/cli/main_parser.py,sha256=rusU-JYOLpcJ8cFXWiPvuDoNpTptRlndY3WyBh2UXq4,2701
pip/_internal/cli/parser.py,sha256=0eTD4_7ucvjv_VnZajerOhzHUAIOju5KDlQM0rv5VP4,11080
pip/_internal/cli/progress_bars.py,sha256=-bhkKHcjsZ0tWdf-DH9eGHsJuGedVPih8E0vV2_rJXg,8550
pip/_internal/cli/req_command.py,sha256=_9w-fMnI0j8bey7mryr-iLxjCoUT_jIU3lkNp2PQJVU,17001
pip/_internal/cli/spinners.py,sha256=rQJtl8c9JiMpOCsOk-YRFYtWdhiFoFectJuryMM-jn4,5233
pip/_internal/cli/status_codes.py,sha256=1xaB32lG8Nf1nMl_6e0yy5z2Iyvv81OTUpuHwXgGsfU,122
pip/_internal/commands/__init__.py,sha256=LoscneenHTO4OCqGIah4KtHyPNURU6F7bUeGRjbcr_k,3888
pip/_internal/commands/__pycache__/__init__.cpython-39.pyc,,
pip/_internal/commands/__pycache__/cache.cpython-39.pyc,,
pip/_internal/commands/__pycache__/check.cpython-39.pyc,,
pip/_internal/commands/__pycache__/completion.cpython-39.pyc,,
pip/_internal/commands/__pycache__/configuration.cpython-39.pyc,,
pip/_internal/commands/__pycache__/debug.cpython-39.pyc,,
pip/_internal/commands/__pycache__/download.cpython-39.pyc,,
pip/_internal/commands/__pycache__/freeze.cpython-39.pyc,,
pip/_internal/commands/__pycache__/hash.cpython-39.pyc,,
pip/_internal/commands/__pycache__/help.cpython-39.pyc,,
pip/_internal/commands/__pycache__/index.cpython-39.pyc,,
pip/_internal/commands/__pycache__/install.cpython-39.pyc,,
pip/_internal/commands/__pycache__/list.cpython-39.pyc,,
pip/_internal/commands/__pycache__/search.cpython-39.pyc,,
pip/_internal/commands/__pycache__/show.cpython-39.pyc,,
pip/_internal/commands/__pycache__/uninstall.cpython-39.pyc,,
pip/_internal/commands/__pycache__/wheel.cpython-39.pyc,,
pip/_internal/commands/cache.py,sha256=XqHqGkiyZ6A0Vf0oIGJhWiNY4k9JIC0nlNmooiaCtuo,7453
pip/_internal/commands/check.py,sha256=FZ7IHeRkwnWkwgdaMI1AjFPcI4xrPK4_4jODp8aDyiA,1617
pip/_internal/commands/completion.py,sha256=RXEru4uYaBfUUtZJ2bLE7s6FJUe9t1BAVSUQ8wPzW0o,3005
pip/_internal/commands/configuration.py,sha256=1Fr4QLwdu1OcBL_FZQh6uY3i7i38qI70OJGG-JhoUuI,9228
pip/_internal/commands/debug.py,sha256=Bb2Lxzn7XEQRYgBYOZbuK3EYeLphKHo8Gubg_EZ6JnU,6851
pip/_internal/commands/download.py,sha256=sT3gInhPvMyhuZ-rVBf1OlpLzh52J0hStM57_CPdvCA,5088
pip/_internal/commands/freeze.py,sha256=xzVjiTJT5DBJceJPNnAYyCF4oGITyuSpfsfkSKR70Fg,2869
pip/_internal/commands/hash.py,sha256=XoLZ3Hx_b72asRLGOe1WXSvJ6ClwSFhn-aFPgbcB9Zk,1719
pip/_internal/commands/help.py,sha256=zV8LmdIbJOnVOIZTz1TwlNWQZQLEWZnJGwXSSh9SSEw,1173
pip/_internal/commands/index.py,sha256=qTchSIS-zCEiJCrZ9X-o5_93kMYCSVZDRTmeY_fhOOE,4920
pip/_internal/commands/install.py,sha256=oj_4a73RMGXgmFQV1jUZEZTnvnZw5kkT6pA3naYj3PA,28243
pip/_internal/commands/list.py,sha256=1K-dhUMEs8akjPE16n5Eq9GsalONKkS7bvWwSCNzQe8,12090
pip/_internal/commands/search.py,sha256=Dtebo30wNJJ0Blr5MkmiET1wIuNioxzoH8vR82ma7Tc,5707
pip/_internal/commands/show.py,sha256=G-ak6SZS-H2MJqQI89D2x4TLd8l9amVYhtaa5dhCFeE,8208
pip/_internal/commands/uninstall.py,sha256=sTUTiJSTp0NKeFHUBJHD3f-fSVPGFjBY6go_DhpvC0Q,3580
pip/_internal/commands/wheel.py,sha256=dIRE7v6g9HTpTw0nsOG2HHoG0uvwrWV5-xyp0kuJdhU,6365
pip/_internal/configuration.py,sha256=g_C1ByxxCGrYfY26B-X8v-3mbUwzlXdj9EKwDs-0kH0,14128
pip/_internal/distributions/__init__.py,sha256=99Rzk077wS5wGire_mchcAjtJG9vbwTLPXZKLWrh_D4,879
pip/_internal/distributions/__pycache__/__init__.cpython-39.pyc,,
pip/_internal/distributions/__pycache__/base.cpython-39.pyc,,
pip/_internal/distributions/__pycache__/installed.cpython-39.pyc,,
pip/_internal/distributions/__pycache__/sdist.cpython-39.pyc,,
pip/_internal/distributions/__pycache__/wheel.cpython-39.pyc,,
pip/_internal/distributions/base.py,sha256=VCEqCFm36o5SSpu3esHmM055Wv5TOxGFLXtxpY8m-L8,1244
pip/_internal/distributions/installed.py,sha256=UZU2Q4-jcAaPexNZzqk5YXhols1jTjyh4xAA0ZQ_A8g,667
pip/_internal/distributions/sdist.py,sha256=5OpYaS51ll8tqsZC-h86ij62RQkid3YZEOqUXCRq8TA,3957
pip/_internal/distributions/wheel.py,sha256=8lzZqqpA5oUUHANOZlf0qcKLIunsJ3K821VP29hLYdg,1217
pip/_internal/exceptions.py,sha256=yiMEmKFvLIPNGaLCQxxtnacfNhUisQayQ4XiqPuRLZU,13567
pip/_internal/index/__init__.py,sha256=x0ifDyFChwwQC4V_eHBFF1fvzLwbXRYG3nq15-Axy24,32
pip/_internal/index/__pycache__/__init__.cpython-39.pyc,,
pip/_internal/index/__pycache__/collector.cpython-39.pyc,,
pip/_internal/index/__pycache__/package_finder.cpython-39.pyc,,
pip/_internal/index/__pycache__/sources.cpython-39.pyc,,
pip/_internal/index/collector.py,sha256=pB-NFZkI-KjQnhTBo7JzArphtu6OVJ52WVQlFQrSbFU,18179
pip/_internal/index/package_finder.py,sha256=k7qar-7Lw778ODq0iB-ETXjof-MUhRh4YHXsVNjl6eo,37120
pip/_internal/index/sources.py,sha256=SW2LlD5eAF2Rj74TbpEUNjADU9UH-K76oqgJFNtDlWc,6781
pip/_internal/locations/__init__.py,sha256=bReITFXFSX786ngLRJhXhsb1npYOw8YbpOuOngrQUik,11584
pip/_internal/locations/__pycache__/__init__.cpython-39.pyc,,
pip/_internal/locations/__pycache__/_distutils.cpython-39.pyc,,
pip/_internal/locations/__pycache__/_sysconfig.cpython-39.pyc,,
pip/_internal/locations/__pycache__/base.cpython-39.pyc,,
pip/_internal/locations/_distutils.py,sha256=OUPuNiGJP2vmiYgwdAR-ZQryj_2yANs9DebSm4afDZU,6040
pip/_internal/locations/_sysconfig.py,sha256=sJJD4PQujUcLAaKiOeXYsILmQb0-hjznP79PzKPiA4Q,8137
pip/_internal/locations/base.py,sha256=KMpxtATY6iOshQ3AimpymGTy81zK-pM1CWPemJQ0mj4,1631
pip/_internal/main.py,sha256=yXF5_lVS3QQTxrbbvNk31juR2E1_16H1iu-xuXAod9o,364
pip/_internal/metadata/__init__.py,sha256=p3NvOGG_3quhV9bOlDPvWSAEByPsdn63cO4FrsFubM0,1624
pip/_internal/metadata/__pycache__/__init__.cpython-39.pyc,,
pip/_internal/metadata/__pycache__/base.cpython-39.pyc,,
pip/_internal/metadata/__pycache__/pkg_resources.cpython-39.pyc,,
pip/_internal/metadata/base.py,sha256=dCfs9XIcicyYSoFtVtzq6rFvduUYNdV6U_EDDlG4yJ0,8170
pip/_internal/metadata/pkg_resources.py,sha256=azUoAkvyF-h80pORd0czY4-fWUIRe_z3i2qNHuKiSjE,5353
pip/_internal/models/__init__.py,sha256=j2kiRfNTH6h5JVP5yO_N2Yn0DqiNzJUtaPjHe2xMcgg,65
pip/_internal/models/__pycache__/__init__.cpython-39.pyc,,
pip/_internal/models/__pycache__/candidate.cpython-39.pyc,,
pip/_internal/models/__pycache__/direct_url.cpython-39.pyc,,
pip/_internal/models/__pycache__/format_control.cpython-39.pyc,,
pip/_internal/models/__pycache__/index.cpython-39.pyc,,
pip/_internal/models/__pycache__/link.cpython-39.pyc,,
pip/_internal/models/__pycache__/scheme.cpython-39.pyc,,
pip/_internal/models/__pycache__/search_scope.cpython-39.pyc,,
pip/_internal/models/__pycache__/selection_prefs.cpython-39.pyc,,
pip/_internal/models/__pycache__/target_python.cpython-39.pyc,,
pip/_internal/models/__pycache__/wheel.cpython-39.pyc,,
pip/_internal/models/candidate.py,sha256=L4nKS2HIgdOfbylU-2MIO2APVWEWueJpHu_gcwO0iH4,977
pip/_internal/models/direct_url.py,sha256=36n2ed5kddmPLhNLh4b1GzGr36dUdSgl23Xrbcxd_ck,6482
pip/_internal/models/format_control.py,sha256=PZ5PExPrxArZWzzPFATSj6W07UqvxjtrMBgFNAUxae4,2641
pip/_internal/models/index.py,sha256=vqgOrXoZqQW4AA928wBmEGjKbxjeb-_NALLGZH0kMXY,1090
pip/_internal/models/link.py,sha256=SrRPbWmpzWh1LfQd-eurbYAuMvOvpD5fzMvNDlRFpQ8,10227
pip/_internal/models/scheme.py,sha256=moDcYk85amZUkf6Je5TDvXh4xMHxsSgf8rkD1ykpQhU,769
pip/_internal/models/search_scope.py,sha256=D_Q6xSo1dTjSRljshHz_xVe4vXXivl2H7_rtj0dSHpU,4600
pip/_internal/models/selection_prefs.py,sha256=0DZIWNPT8q2EiuqZCAQxczCoVnbs9_C4zugNfhNnvaw,1923
pip/_internal/models/target_python.py,sha256=NUm2Ua7qbJHFK0UzKAlfHixudx4-FgmAFKPKf3B2RyU,3981
pip/_internal/models/wheel.py,sha256=NLmn_y8dVc5vfTcAYw3EfS692hAF9MPPMDr5wTBu_4E,3633
pip/_internal/network/__init__.py,sha256=IEtuAPVGqBTS0C7M0KJ95xqGcA76coOc2AsDcgIBP-8,52
pip/_internal/network/__pycache__/__init__.cpython-39.pyc,,
pip/_internal/network/__pycache__/auth.cpython-39.pyc,,
pip/_internal/network/__pycache__/cache.cpython-39.pyc,,
pip/_internal/network/__pycache__/download.cpython-39.pyc,,
pip/_internal/network/__pycache__/lazy_wheel.cpython-39.pyc,,
pip/_internal/network/__pycache__/session.cpython-39.pyc,,
pip/_internal/network/__pycache__/utils.cpython-39.pyc,,
pip/_internal/network/__pycache__/xmlrpc.cpython-39.pyc,,
pip/_internal/network/auth.py,sha256=820jI8SAsVfNnfoOfxfH7HaGVFtYX_M8vsHEtiHCS14,11961
pip/_internal/network/cache.py,sha256=KfaWDbALIGsUnP4qi1MfvKSpCJ0vlC5lviELSTNKLtQ,2169
pip/_internal/network/download.py,sha256=-EnS83XhpNVRsfB107nYU-OPZsHd29QQdG6lNokemAk,6200
pip/_internal/network/lazy_wheel.py,sha256=LFVwrv2nHpwr0pl17i-3sbEAedJjraaLdRTFRfS23vo,7825
pip/_internal/network/session.py,sha256=9KBZpMGrtEmek4iPgpZiLEBgyxQ6bPH3yUUxNbEEQ54,17036
pip/_internal/network/utils.py,sha256=K4d2srYGzR_tz5vVBbKFC7rBWA-G_DqqX9io2flIrI0,4155
pip/_internal/network/xmlrpc.py,sha256=oFCngChTOtIVcc55ExwdX1HJcPvL-6PKMNl5ok6nMQk,1851
pip/_internal/operations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
pip/_internal/operations/__pycache__/__init__.cpython-39.pyc,,
pip/_internal/operations/__pycache__/check.cpython-39.pyc,,
pip/_internal/operations/__pycache__/freeze.cpython-39.pyc,,
pip/_internal/operations/__pycache__/prepare.cpython-39.pyc,,
pip/_internal/operations/build/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
pip/_internal/operations/build/__pycache__/__init__.cpython-39.pyc,,
pip/_internal/operations/build/__pycache__/metadata.cpython-39.pyc,,
pip/_internal/operations/build/__pycache__/metadata_legacy.cpython-39.pyc,,
pip/_internal/operations/build/__pycache__/wheel.cpython-39.pyc,,
pip/_internal/operations/build/__pycache__/wheel_legacy.cpython-39.pyc,,
pip/_internal/operations/build/metadata.py,sha256=-06VLFRgwxsIuqHL_56NxXdn7TQuZHeaL4RYXDnjB18,1200
pip/_internal/operations/build/metadata_legacy.py,sha256=1V8i8VVGUF7GauyS_KPEhcl7dIwrocD6lyT5kWvXkBA,1991
pip/_internal/operations/build/wheel.py,sha256=r2IKZgek1REUjP4xA0RLEG5O1-HsPZtzfy7q7W3_nhQ,1144
pip/_internal/operations/build/wheel_legacy.py,sha256=4ddx179dnTTHJertW50M6869gchuyrNEdYcyWe4w5Yg,3337
pip/_internal/operations/check.py,sha256=eCLrRScb_ZJDxTK9rMjU5kbLuu1xRngdoLxATNPuPQE,5448
pip/_internal/operations/freeze.py,sha256=WEglEwdf9rD9M6jGzMyRVhiN-WF8p-hhiHGnwsWlDDc,10833
pip/_internal/operations/install/__init__.py,sha256=Zug2xxRJjeI2LdVd45iwmeavUBYXA4ltbhFFwc4BEOg,53
pip/_internal/operations/install/__pycache__/__init__.cpython-39.pyc,,
pip/_internal/operations/install/__pycache__/editable_legacy.cpython-39.pyc,,
pip/_internal/operations/install/__pycache__/legacy.cpython-39.pyc,,
pip/_internal/operations/install/__pycache__/wheel.cpython-39.pyc,,
pip/_internal/operations/install/editable_legacy.py,sha256=FhvBds_MF_Flabnylh6EVwCD3mFDxa-RmdKq3jl5JGM,1443
pip/_internal/operations/install/legacy.py,sha256=xyGakzR-Xnfa9H37-OzT6cKH-AQMsctBkFxfUr3jlvw,4537
pip/_internal/operations/install/wheel.py,sha256=oV6IB77355YCaI_ta4mqWXyHlkQF8OqBRZAdq8jpQYs,30269
pip/_internal/operations/prepare.py,sha256=QB3-cmVD1agyO6_B9oiRs9HCQyyDMHF9pLTboLtufxo,25503
pip/_internal/pyproject.py,sha256=DQoqc7F3HyFBO7fG82HOPsdP-GfEzfuqTUGOG0v2E1c,7246
pip/_internal/req/__init__.py,sha256=5eiQnk8IiwtrWHU4r1ttcLy545MCrUdg5eRRq7_ZNz0,2925
pip/_internal/req/__pycache__/__init__.cpython-39.pyc,,
pip/_internal/req/__pycache__/constructors.cpython-39.pyc,,
pip/_internal/req/__pycache__/req_file.cpython-39.pyc,,
pip/_internal/req/__pycache__/req_install.cpython-39.pyc,,
pip/_internal/req/__pycache__/req_set.cpython-39.pyc,,
pip/_internal/req/__pycache__/req_tracker.cpython-39.pyc,,
pip/_internal/req/__pycache__/req_uninstall.cpython-39.pyc,,
pip/_internal/req/constructors.py,sha256=Izde_5pbxkMzDWN-khLufzKKpC0uaGNTPRO9ShWrud8,16300
pip/_internal/req/req_file.py,sha256=RN04-oHRNn5xECciUcs0Gh3LxA1RdlVw1X6wbVs0r7k,17936
pip/_internal/req/req_install.py,sha256=gIGZ3t9QzqCBoeL04my4DIuqM86j0i5nId6iwZIGYzQ,32517
pip/_internal/req/req_set.py,sha256=yeKmy9-oH5tW2Oe7SHobrp9btcDBZ3DxdFJ3HqAKQ44,7762
pip/_internal/req/req_tracker.py,sha256=tFN50kuTTWwpY0WJkPK6QCPUZePmUhaBbuKVSgkWl1A,4312
pip/_internal/req/req_uninstall.py,sha256=T6n_Pgpljq30LLQ81Qs4kpPoxSuJUkUvbvG9b697rGs,24450
pip/_internal/resolution/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
pip/_internal/resolution/__pycache__/__init__.cpython-39.pyc,,
pip/_internal/resolution/__pycache__/base.cpython-39.pyc,,
pip/_internal/resolution/base.py,sha256=qMuP4GV1NJU-81E3gUKzczQxzS-f_SWF0Dk59YVrH9A,575
pip/_internal/resolution/legacy/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
pip/_internal/resolution/legacy/__pycache__/__init__.cpython-39.pyc,,
pip/_internal/resolution/legacy/__pycache__/resolver.cpython-39.pyc,,
pip/_internal/resolution/legacy/resolver.py,sha256=6nUm1wcBGRT58gUOu0-B0TE354XrCx_dexslaFtlDis,18005
pip/_internal/resolution/resolvelib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
pip/_internal/resolution/resolvelib/__pycache__/__init__.cpython-39.pyc,,
pip/_internal/resolution/resolvelib/__pycache__/base.cpython-39.pyc,,
pip/_internal/resolution/resolvelib/__pycache__/candidates.cpython-39.pyc,,
pip/_internal/resolution/resolvelib/__pycache__/factory.cpython-39.pyc,,
pip/_internal/resolution/resolvelib/__pycache__/found_candidates.cpython-39.pyc,,
pip/_internal/resolution/resolvelib/__pycache__/provider.cpython-39.pyc,,
pip/_internal/resolution/resolvelib/__pycache__/reporter.cpython-39.pyc,,
pip/_internal/resolution/resolvelib/__pycache__/requirements.cpython-39.pyc,,
pip/_internal/resolution/resolvelib/__pycache__/resolver.cpython-39.pyc,,
pip/_internal/resolution/resolvelib/base.py,sha256=IWvd3KNMJtIqDLcqeUuGV4MbimM83JOofBKwggVYxzI,5434
pip/_internal/resolution/resolvelib/candidates.py,sha256=a8-csKtuj_Bz8UeYgk2cz8mP1EOObTyXsZrCO8wq2Tc,19397
pip/_internal/resolution/resolvelib/factory.py,sha256=clwGzM3_u3SReBwOOG9sAvcdd2pNqk03T5qrCyryeB4,27559
pip/_internal/resolution/resolvelib/found_candidates.py,sha256=9kFfU_ZFugtCMaCIez6UYrG4hyfqwDaQYxP9db9XQvE,5427
pip/_internal/resolution/resolvelib/provider.py,sha256=qXB9l3kjEca0orqTS2e6TGaWHJIn537kEqJYClBIShQ,8617
pip/_internal/resolution/resolvelib/reporter.py,sha256=AwjzTX3LytVk9wuVS1LdJAk1V2kPhEdn1dE7MfrPwLM,2669
pip/_internal/resolution/resolvelib/requirements.py,sha256=FKE-HcZmsljRrcLpr545XprOOqDd09149GjjF8AfTiw,5621
pip/_internal/resolution/resolvelib/resolver.py,sha256=Bmwfy5pO8cLzI-13YMgWEAWwFlpjLKdKeCBHMrdWyWM,10795
pip/_internal/self_outdated_check.py,sha256=cNOjZkFVtwJmftBZt34cH2j9SJ5Gd4vSbJY8FBYM6tg,6671
pip/_internal/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
pip/_internal/utils/__pycache__/__init__.cpython-39.pyc,,
pip/_internal/utils/__pycache__/_log.cpython-39.pyc,,
pip/_internal/utils/__pycache__/appdirs.cpython-39.pyc,,
pip/_internal/utils/__pycache__/compat.cpython-39.pyc,,
pip/_internal/utils/__pycache__/compatibility_tags.cpython-39.pyc,,
pip/_internal/utils/__pycache__/datetime.cpython-39.pyc,,
pip/_internal/utils/__pycache__/deprecation.cpython-39.pyc,,
pip/_internal/utils/__pycache__/direct_url_helpers.cpython-39.pyc,,
pip/_internal/utils/__pycache__/distutils_args.cpython-39.pyc,,
pip/_internal/utils/__pycache__/encoding.cpython-39.pyc,,
pip/_internal/utils/__pycache__/entrypoints.cpython-39.pyc,,
pip/_internal/utils/__pycache__/filesystem.cpython-39.pyc,,
pip/_internal/utils/__pycache__/filetypes.cpython-39.pyc,,
pip/_internal/utils/__pycache__/glibc.cpython-39.pyc,,
pip/_internal/utils/__pycache__/hashes.cpython-39.pyc,,
pip/_internal/utils/__pycache__/inject_securetransport.cpython-39.pyc,,
pip/_internal/utils/__pycache__/logging.cpython-39.pyc,,
pip/_internal/utils/__pycache__/misc.cpython-39.pyc,,
pip/_internal/utils/__pycache__/models.cpython-39.pyc,,
pip/_internal/utils/__pycache__/packaging.cpython-39.pyc,,
pip/_internal/utils/__pycache__/parallel.cpython-39.pyc,,
pip/_internal/utils/__pycache__/pkg_resources.cpython-39.pyc,,
pip/_internal/utils/__pycache__/setuptools_build.cpython-39.pyc,,
pip/_internal/utils/__pycache__/subprocess.cpython-39.pyc,,
pip/_internal/utils/__pycache__/temp_dir.cpython-39.pyc,,
pip/_internal/utils/__pycache__/unpacking.cpython-39.pyc,,
pip/_internal/utils/__pycache__/urls.cpython-39.pyc,,
pip/_internal/utils/__pycache__/virtualenv.cpython-39.pyc,,
pip/_internal/utils/__pycache__/wheel.cpython-39.pyc,,
pip/_internal/utils/_log.py,sha256=t0zjUNjMLPYna4ZbL0MJB8wrxGdFvC8JsPs7f3UUdz0,1053
pip/_internal/utils/appdirs.py,sha256=JKsp6Dlfk0BjBfni2Geq_uzpSycc8pV0Ap5A5qAwhag,1220
pip/_internal/utils/compat.py,sha256=U1ofuQpRkcmWNtCsZccTK_24YsauhWl0KPDMnC69adM,1947
pip/_internal/utils/compatibility_tags.py,sha256=f0RJ5Wb3Jj2T5z57i0RPLyoWNtqYvymealy3aUucrVU,5622
pip/_internal/utils/datetime.py,sha256=NhzGBwpDdc5W1hX7-ynGHSFH5T8srUUPpFw6zOORiMM,253
pip/_internal/utils/deprecation.py,sha256=onEDau8zZyztsQf5HjhHTckTChbXIIdOWRh_Ugz1PSQ,3304
pip/_internal/utils/direct_url_helpers.py,sha256=7xVyieLJtD1SmB1xsNhIPsYBGIDK7AZGQUtfZyRi0tQ,3073
pip/_internal/utils/distutils_args.py,sha256=fw5ZrUBHRy2IWgLciAKUl7RA4Ryu6jWL-M9LNv90V2k,1291
pip/_internal/utils/encoding.py,sha256=3Hr_T_shHHq5EJmQg7sUCeNY37pvmxEmQay6aPsK_4o,1205
pip/_internal/utils/entrypoints.py,sha256=Iq8laJFPEcErDlGcPIshG_-VrUmfwLB3_nLWlT1EIKI,1082
pip/_internal/utils/filesystem.py,sha256=8UhURyTKl2R1l9TAnYXuULsGNNMkH9IBPHAoRy4QEaU,6075
pip/_internal/utils/filetypes.py,sha256=0VA-FQmevfgw7_9OAe7YXjxB3DcYUxpUypVKERWlU_I,789
pip/_internal/utils/glibc.py,sha256=6i1vPIDuLfV3vKQeFe2oUa9QjSHGVlOkvysujEldOEE,3262
pip/_internal/utils/hashes.py,sha256=dV10-3U4kcopR-XrArkX6vFSiLS9uNOhPbrv8olu8Qw,5332
pip/_internal/utils/inject_securetransport.py,sha256=Wa89Vhq5SdlBGreg8wdE40iDJGTouYEyFuugMrOVUI0,846
pip/_internal/utils/logging.py,sha256=cRHg2gUYXEUknl_WzZ2Zdxxah485Gr69wl8TpymaAHc,12735
pip/_internal/utils/misc.py,sha256=Zt509grPCYtfQEI16CHULTX9nW8eRXbBucPQQasuOYk,24472
pip/_internal/utils/models.py,sha256=89bZ42cL0YJUmV9GCaFLfs4ZiG_cDW1udAHc6UTCI2c,1376
pip/_internal/utils/packaging.py,sha256=xTyBldqCDRn0_v9CQizadbHd3ZUTgjXeElTxrJW_JKo,2989
pip/_internal/utils/parallel.py,sha256=7IFve8sBfphARNXprnhhuSyzlxfdDWaMP3LTFwCUL9c,3325
pip/_internal/utils/pkg_resources.py,sha256=bkYDe05U5fph4t8TO-q06fpHQwuzookJqP0MokucHWg,1146
pip/_internal/utils/setuptools_build.py,sha256=tO48Mgcb28GJf3zmkQlzBvsRR-2hdrpm1dipXFBkyaE,5220
pip/_internal/utils/subprocess.py,sha256=0GB0g9r2muHAnljX2s_sX-x805eWWoDtdN_9JcCwKu8,10324
pip/_internal/utils/temp_dir.py,sha256=gFwfsfEtM-y5Lb9ZqpbP1wy_K3o-vUPsMouAFQCy7mg,8210
pip/_internal/utils/unpacking.py,sha256=klIaodkk3_rIg-VjN2s-PQFPfGXaVhOWpOwd46T7bHo,9317
pip/_internal/utils/urls.py,sha256=pJQSXBv1vKtBFr9KPbSMYA5lY7-G9rjLHq0A8plI7yo,1863
pip/_internal/utils/virtualenv.py,sha256=3JeTdc_O-2uZbfn7EmQKLyXurWKD3nKSEi856ZZWSC4,3675
pip/_internal/utils/wheel.py,sha256=xeIImmT3FJfVBPv3J4jxsHJy2wLinnJXAsZOcrrMSAM,6479
pip/_internal/vcs/__init__.py,sha256=6ZAbu6NoqDWJjYPWCtn8PaZjulAEgs-R0Xngq2Z174Q,611
pip/_internal/vcs/__pycache__/__init__.cpython-39.pyc,,
pip/_internal/vcs/__pycache__/bazaar.cpython-39.pyc,,
pip/_internal/vcs/__pycache__/git.cpython-39.pyc,,
pip/_internal/vcs/__pycache__/mercurial.cpython-39.pyc,,
pip/_internal/vcs/__pycache__/subversion.cpython-39.pyc,,
pip/_internal/vcs/__pycache__/versioncontrol.cpython-39.pyc,,
pip/_internal/vcs/bazaar.py,sha256=6_3dygJ3x0TrnlsMx2-sokvNKpk-6EfH2zsMgAmLj4o,3058
pip/_internal/vcs/git.py,sha256=vYxXxg4M6YIUxNQCswMJJ2ZiBkb4capqTziRrATcp0E,17853
pip/_internal/vcs/mercurial.py,sha256=jrfkmZF7SLOwxrJroz-NjvTTMCvaWl8BnZATPdu1CsE,5234
pip/_internal/vcs/subversion.py,sha256=Oy4kcrNGmimnatKWHGKtED-0Da6bjfuc2DtsnitUam0,12195
pip/_internal/vcs/versioncontrol.py,sha256=7w9WNAlFXQj5pRlWA-3jA8XUwn1VSxbNfmWvI-aY2p0,23998
pip/_internal/wheel_builder.py,sha256=3bibo47mjXw7rRChRqudDQObp5JynLQ5uZ8x81PtBq8,12100
pip/_vendor/__init__.py,sha256=3sjRJDFysoLez0JAFlt8jJA0FUzWVPkt9AlJlcuNsC0,4814
pip/_vendor/__pycache__/__init__.cpython-39.pyc,,
pip/_vendor/__pycache__/appdirs.cpython-39.pyc,,
pip/_vendor/__pycache__/distro.cpython-39.pyc,,
pip/_vendor/__pycache__/pyparsing.cpython-39.pyc,,
pip/_vendor/__pycache__/six.cpython-39.pyc,,
pip/_vendor/appdirs.py,sha256=Od1rs7d0yMmHLUc0FQn2DleIUbC--EEmM-UtXvFqAjM,26540
pip/_vendor/cachecontrol/__init__.py,sha256=SR74BEsga7Z2I6-CH8doh2Oq_vH0GG7RCwjJg7TntdI,313
pip/_vendor/cachecontrol/__pycache__/__init__.cpython-39.pyc,,
pip/_vendor/cachecontrol/__pycache__/_cmd.cpython-39.pyc,,
pip/_vendor/cachecontrol/__pycache__/adapter.cpython-39.pyc,,
pip/_vendor/cachecontrol/__pycache__/cache.cpython-39.pyc,,
pip/_vendor/cachecontrol/__pycache__/compat.cpython-39.pyc,,
pip/_vendor/cachecontrol/__pycache__/controller.cpython-39.pyc,,
pip/_vendor/cachecontrol/__pycache__/filewrapper.cpython-39.pyc,,
pip/_vendor/cachecontrol/__pycache__/heuristics.cpython-39.pyc,,
pip/_vendor/cachecontrol/__pycache__/serialize.cpython-39.pyc,,
pip/_vendor/cachecontrol/__pycache__/wrapper.cpython-39.pyc,,
pip/_vendor/cachecontrol/_cmd.py,sha256=KIO6PIJoXmNr5RGS2pZjDum1-40oR4fw5kE0LguxrY4,1352
pip/_vendor/cachecontrol/adapter.py,sha256=FBRrYfpkXaH8hKogEgw6wYCScnL2SJFDZlHBNF0EvLE,5015
pip/_vendor/cachecontrol/cache.py,sha256=gCo5R0D__iptJ49dUfxwWfu2Lc2OjpDs-MERy2hTpK8,844
pip/_vendor/cachecontrol/caches/__init__.py,sha256=rN8Ox5dd2ucPtgkybgz77XfTTUL4HFTO2-n2ACK2q3E,88
pip/_vendor/cachecontrol/caches/__pycache__/__init__.cpython-39.pyc,,
pip/_vendor/cachecontrol/caches/__pycache__/file_cache.cpython-39.pyc,,
pip/_vendor/cachecontrol/caches/__pycache__/redis_cache.cpython-39.pyc,,
pip/_vendor/cachecontrol/caches/file_cache.py,sha256=tw35e4ZnOsxqrlZ2fQ2VYz2FlUlCbFMerNu2tPwtRHY,4299
pip/_vendor/cachecontrol/caches/redis_cache.py,sha256=hFJ_J9MCUTjblJCBT_cV_glP--2toqHDCKLRGUIHSOQ,889
pip/_vendor/cachecontrol/compat.py,sha256=3BisP29GBHAo0QxUrbpBsMeXSp8YzKQcGHwEW7VYU2U,724
pip/_vendor/cachecontrol/controller.py,sha256=fTDK1V7NjpnU1hwfMboX4Vyh73-uWgL6QkghtvvyTrY,14525
pip/_vendor/cachecontrol/filewrapper.py,sha256=YsK9ISeZg26n-rS0z7MdEcMTyQ9gW_fLb6zIRJvE2rg,2613
pip/_vendor/cachecontrol/heuristics.py,sha256=yndlfXHJZ5u_TC1ECrV4fVl68OuWiXnDS0HPyscK1MM,4205
pip/_vendor/cachecontrol/serialize.py,sha256=7Jq5PcVBH6RVI-qkKkQsV5yAiZCFQa7yFhvITw_DYsc,7279
pip/_vendor/cachecontrol/wrapper.py,sha256=tKJnzRvbl7uJRxOChwlNLdJf9NR0QlnknQxgNzQW2kM,719
pip/_vendor/certifi/__init__.py,sha256=mRf2Fl2WmJxc7O-Zob068lpqa3nlsU4215CXzbkoBBU,65
pip/_vendor/certifi/__main__.py,sha256=4JJNpOgznsXzgISGReUBrJGB6Q4zJOlIV99WFE185fM,267
pip/_vendor/certifi/__pycache__/__init__.cpython-39.pyc,,
pip/_vendor/certifi/__pycache__/__main__.cpython-39.pyc,,
pip/_vendor/certifi/__pycache__/core.cpython-39.pyc,,
pip/_vendor/certifi/cacert.pem,sha256=3i-hfE2K5o3CBKG2tYt6ehJWk2fP64o6Th83fHPoPp4,259465
pip/_vendor/certifi/core.py,sha256=u1ccq2BcSYX_ZtX61r6UFpwbKCKxNavjrzse_QVQ_PI,2916
pip/_vendor/chardet/__init__.py,sha256=yxky3TQpsr5YTFEf5XYv0O4wq2e1WSilELYZ9e2AEes,3354
pip/_vendor/chardet/__pycache__/__init__.cpython-39.pyc,,
pip/_vendor/chardet/__pycache__/big5freq.cpython-39.pyc,,
pip/_vendor/chardet/__pycache__/big5prober.cpython-39.pyc,,
pip/_vendor/chardet/__pycache__/chardistribution.cpython-39.pyc,,
pip/_vendor/chardet/__pycache__/charsetgroupprober.cpython-39.pyc,,
pip/_vendor/chardet/__pycache__/charsetprober.cpython-39.pyc,,
pip/_vendor/chardet/__pycache__/codingstatemachine.cpython-39.pyc,,
pip/_vendor/chardet/__pycache__/compat.cpython-39.pyc,,
pip/_vendor/chardet/__pycache__/cp949prober.cpython-39.pyc,,
pip/_vendor/chardet/__pycache__/enums.cpython-39.pyc,,
pip/_vendor/chardet/__pycache__/escprober.cpython-39.pyc,,
pip/_vendor/chardet/__pycache__/escsm.cpython-39.pyc,,
pip/_vendor/chardet/__pycache__/eucjpprober.cpython-39.pyc,,
pip/_vendor/chardet/__pycache__/euckrfreq.cpython-39.pyc,,
pip/_vendor/chardet/__pycache__/euckrprober.cpython-39.pyc,,
pip/_vendor/chardet/__pycache__/euctwfreq.cpython-39.pyc,,
pip/_vendor/chardet/__pycache__/euctwprober.cpython-39.pyc,,
pip/_vendor/chardet/__pycache__/gb2312freq.cpython-39.pyc,,
pip/_vendor/chardet/__pycache__/gb2312prober.cpython-39.pyc,,
pip/_vendor/chardet/__pycache__/hebrewprober.cpython-39.pyc,,
pip/_vendor/chardet/__pycache__/jisfreq.cpython-39.pyc,,
pip/_vendor/chardet/__pycache__/jpcntx.cpython-39.pyc,,
pip/_vendor/chardet/__pycache__/langbulgarianmodel.cpython-39.pyc,,
pip/_vendor/chardet/__pycache__/langgreekmodel.cpython-39.pyc,,
pip/_vendor/chardet/__pycache__/langhebrewmodel.cpython-39.pyc,,
pip/_vendor/chardet/__pycache__/langhungarianmodel.cpython-39.pyc,,
pip/_vendor/chardet/__pycache__/langrussianmodel.cpython-39.pyc,,
pip/_vendor/chardet/__pycache__/langthaimodel.cpython-39.pyc,,
pip/_vendor/chardet/__pycache__/langturkishmodel.cpython-39.pyc,,
pip/_vendor/chardet/__pycache__/latin1prober.cpython-39.pyc,,
pip/_vendor/chardet/__pycache__/mbcharsetprober.cpython-39.pyc,,
pip/_vendor/chardet/__pycache__/mbcsgroupprober.cpython-39.pyc,,
pip/_vendor/chardet/__pycache__/mbcssm.cpython-39.pyc,,
pip/_vendor/chardet/__pycache__/sbcharsetprober.cpython-39.pyc,,
pip/_vendor/chardet/__pycache__/sbcsgroupprober.cpython-39.pyc,,
pip/_vendor/chardet/__pycache__/sjisprober.cpython-39.pyc,,
pip/_vendor/chardet/__pycache__/universaldetector.cpython-39.pyc,,
pip/_vendor/chardet/__pycache__/utf8prober.cpython-39.pyc,,
pip/_vendor/chardet/__pycache__/version.cpython-39.pyc,,
pip/_vendor/chardet/big5freq.py,sha256=dwRzRlsGp3Zgr1JQSSSwnxvyaZ7_q-5kuPfCVMuy4to,31640
pip/_vendor/chardet/big5prober.py,sha256=TpmdoNfRtnQ7x9Q_p-a1CHaG-ok2mbisN5e9UHAtOiY,1804
pip/_vendor/chardet/chardistribution.py,sha256=NzboAhfS6GODy_Tp6BkmUOL4NuxwTVfdVFcKA9bdUAo,9644
pip/_vendor/chardet/charsetgroupprober.py,sha256=NPYh0Agp8UnrfqIls_qdbwszQ1mv9imGawGUCErFT6M,3946
pip/_vendor/chardet/charsetprober.py,sha256=kk5-m0VdjqzbEhPRkBZ386R3fBQo3DxsBrdL-WFyk1o,5255
pip/_vendor/chardet/cli/__init__.py,sha256=frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN_XKdLCPjaYaY,2
pip/_vendor/chardet/cli/__pycache__/__init__.cpython-39.pyc,,
pip/_vendor/chardet/cli/__pycache__/chardetect.cpython-39.pyc,,
pip/_vendor/chardet/cli/chardetect.py,sha256=535zsG4tA_x-_xPtEeDvn46QLib2nvF-5NT_nJdGgVs,2831
pip/_vendor/chardet/codingstatemachine.py,sha256=qz9ZwK1q4mZ4s4zDRbyXu5KaGunYbk7g1Z7fqfb4mA4,3678
pip/_vendor/chardet/compat.py,sha256=3j2eGvEAakISaIanHZ4wZutzfttNdRSdlo6RSjpyxsM,1236
pip/_vendor/chardet/cp949prober.py,sha256=5NnMVUcel3jDY3w8ljD0cXyj2lcrvdagxOVE1jxl7xc,1904
pip/_vendor/chardet/enums.py,sha256=3H_EIVP-VUYOdKqe2xmYdyooEDSLqS8sACMbn_3oejU,1737
pip/_vendor/chardet/escprober.py,sha256=5MrTnVtZGEt3ssnY-lOXmOo3JY-CIqz9ruG3KjDpkbY,4051
pip/_vendor/chardet/escsm.py,sha256=xQbwmM3Ieuskg-Aohyc6-bSfg3vsY0tx2TEKLDoVZGg,10756
pip/_vendor/chardet/eucjpprober.py,sha256=PHumemJS19xMhDR4xPrsvxMfyBfsb297kVWmYz6zgy8,3841
pip/_vendor/chardet/euckrfreq.py,sha256=MrLrIWMtlaDI0LYt-MM3MougBbLtSWHs6kvZx0VasIM,13741
pip/_vendor/chardet/euckrprober.py,sha256=VbiOn7_id7mL9Q5GdeV0Ze3w5fG0nRCpUkEzeR-bnnY,1795
pip/_vendor/chardet/euctwfreq.py,sha256=ZPBIHZDwNknGf7m6r4xGH8bX0W38qBpnTwVVv1QHw_M,32008
pip/_vendor/chardet/euctwprober.py,sha256=hlUyGKUxzOPfBxCcyUcvRZSxgkLuvRoDU9wejp6YMiM,1793
pip/_vendor/chardet/gb2312freq.py,sha256=aLHs-2GS8vmSM2ljyoWWgeVq_xRRcS_gN7ykpIiV43A,20998
pip/_vendor/chardet/gb2312prober.py,sha256=msVbrDFcrJRE_XvsyETiqbTGfvdFhVIEZ2zBd-OENaE,1800
pip/_vendor/chardet/hebrewprober.py,sha256=r81LqgKb24ZbvOmfi95MzItUxx7bkrjJR1ppkj5rvZw,14130
pip/_vendor/chardet/jisfreq.py,sha256=vrqCR4CmwownBVXJ3Hh_gsfiDnIHOELbcNmTyC6Jx3w,26102
pip/_vendor/chardet/jpcntx.py,sha256=Cn4cypo2y8CpqCan-zsdfYdEgXkRCnsqQoYaCu6FRjI,19876
pip/_vendor/chardet/langbulgarianmodel.py,sha256=IuDOQ4uAe5spaYXt1F-2_496DFYd3J5lyLKKbVg-Nkw,110347
pip/_vendor/chardet/langgreekmodel.py,sha256=cZRowhYjEUNYCevhuD5ZMHMiOIf3Pk1IpRixjTpRPB0,103969
pip/_vendor/chardet/langhebrewmodel.py,sha256=p-xw_b2XvGVSIQFgQL91cVpS7u3vPpGJZ0udYxD07Do,103159
pip/_vendor/chardet/langhungarianmodel.py,sha256=EKIZs5Z8Y-l6ORDcBzE9htOMMnAnr2j6Wb1PFRBMVxM,107148
pip/_vendor/chardet/langrussianmodel.py,sha256=TFH-3rTFzbCBF15oasmoqf92FKBnwWY_HaN2ptl5WVo,136898
pip/_vendor/chardet/langthaimodel.py,sha256=rTzLQ2x_RjQEzZfIksCR--SCFQyuP5eCtQpqxyl5-x8,107695
pip/_vendor/chardet/langturkishmodel.py,sha256=fWI_tafe_UQ24gdOGqOWy1tnEY2jxKHoi4ueoT3rrrc,100329
pip/_vendor/chardet/latin1prober.py,sha256=s1SFkEFY2NGe2_9bgX2MhOmyM_U_qSd_jVSdkdSgZxs,5515
pip/_vendor/chardet/mbcharsetprober.py,sha256=hzFVD-brxTAVLnTAkDqa1ztd6RwGGwb5oAdvhj1-lE8,3504
pip/_vendor/chardet/mbcsgroupprober.py,sha256=DlT-X7KRUl5y3SWJNqF1NXqvkjVc47jPKjJ2j4KVs3A,2066
pip/_vendor/chardet/mbcssm.py,sha256=LGUDh1VB61rWsZB4QlJBzaCjI2PUEUgbBc91gPlX4DQ,26053
pip/_vendor/chardet/metadata/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
pip/_vendor/chardet/metadata/__pycache__/__init__.cpython-39.pyc,,
pip/_vendor/chardet/metadata/__pycache__/languages.cpython-39.pyc,,
pip/_vendor/chardet/metadata/languages.py,sha256=pGf_EnapgynSUCViRjUcwEi7AWw_bYPJFHCqerAFSbQ,19784
pip/_vendor/chardet/sbcharsetprober.py,sha256=VPAZ5z-o8ixIIfEGTScLVXeQxkd3Zqi1eceerr0rb78,6281
pip/_vendor/chardet/sbcsgroupprober.py,sha256=p8XICsXYXOF78Anypfvdne8K_0p8qFC-SUF5nwD1fo4,4392
pip/_vendor/chardet/sjisprober.py,sha256=1WGev_SSHpa7AVXmM0DIONl1OvyKc8mdydUNaKtGGNI,3866
pip/_vendor/chardet/universaldetector.py,sha256=C3ryFrDZ9JuroNMdYwgDa2_zAYJlWuPHyHLX5WtCY-g,12789
pip/_vendor/chardet/utf8prober.py,sha256=rGwn69WfIvmibp0sWvYuH_TPoXs7zzwKHTX79Ojbr9o,2848
pip/_vendor/chardet/version.py,sha256=LCY3oiBIflXJGeBYm7ly2aw6P9n272rhp3t7qz3oOHo,251
pip/_vendor/colorama/__init__.py,sha256=besK61Glmusp-wZ1wjjSlsPKEY_6zndaeulh1FkVStw,245
pip/_vendor/colorama/__pycache__/__init__.cpython-39.pyc,,
pip/_vendor/colorama/__pycache__/ansi.cpython-39.pyc,,
pip/_vendor/colorama/__pycache__/ansitowin32.cpython-39.pyc,,
pip/_vendor/colorama/__pycache__/initialise.cpython-39.pyc,,
pip/_vendor/colorama/__pycache__/win32.cpython-39.pyc,,
pip/_vendor/colorama/__pycache__/winterm.cpython-39.pyc,,
pip/_vendor/colorama/ansi.py,sha256=121ZIWJSdXR76TcqKXusVZQRgyb0AIlRnf5EW6oSGlQ,2624
pip/_vendor/colorama/ansitowin32.py,sha256=bZByVMjpiUp-LSAK21KNvCh63UN9CPkXdHFPUsq20kA,10775
pip/_vendor/colorama/initialise.py,sha256=J92wwYPAAEgdlAyw-ady4JJxl1j9UmXPodi0HicWDwg,1995
pip/_vendor/colorama/win32.py,sha256=fI0Ani_DO_cYDAbHz_a0BsMbDKHCA1-P3PGcj0eDCmA,5556
pip/_vendor/colorama/winterm.py,sha256=Zurpa5AEwarU62JTuERX53gGelEWH5SBUiAXN4CxMtA,6607
pip/_vendor/distlib/__init__.py,sha256=iP0jP2IxDeV5bLyzuna9JsdxOw2AO-VqAMXslthb-oQ,604
pip/_vendor/distlib/__pycache__/__init__.cpython-39.pyc,,
pip/_vendor/distlib/__pycache__/compat.cpython-39.pyc,,
pip/_vendor/distlib/__pycache__/database.cpython-39.pyc,,
pip/_vendor/distlib/__pycache__/index.cpython-39.pyc,,
pip/_vendor/distlib/__pycache__/locators.cpython-39.pyc,,
pip/_vendor/distlib/__pycache__/manifest.cpython-39.pyc,,
pip/_vendor/distlib/__pycache__/markers.cpython-39.pyc,,
pip/_vendor/distlib/__pycache__/metadata.cpython-39.pyc,,
pip/_vendor/distlib/__pycache__/resources.cpython-39.pyc,,
pip/_vendor/distlib/__pycache__/scripts.cpython-39.pyc,,
pip/_vendor/distlib/__pycache__/util.cpython-39.pyc,,
pip/_vendor/distlib/__pycache__/version.cpython-39.pyc,,
pip/_vendor/distlib/__pycache__/wheel.cpython-39.pyc,,
pip/_vendor/distlib/_backport/__init__.py,sha256=XkACqtjaFfFn1QQBFDNxSqhMva0LqXeeh6H3fVwwLQ4,280
pip/_vendor/distlib/_backport/__pycache__/__init__.cpython-39.pyc,,
pip/_vendor/distlib/_backport/__pycache__/misc.cpython-39.pyc,,
pip/_vendor/distlib/_backport/__pycache__/shutil.cpython-39.pyc,,
pip/_vendor/distlib/_backport/__pycache__/sysconfig.cpython-39.pyc,,
pip/_vendor/distlib/_backport/__pycache__/tarfile.cpython-39.pyc,,
pip/_vendor/distlib/_backport/misc.py,sha256=focjmI7975W3LgEtiNC99lvxohfZdsNSLTakOcPNShs,1012
pip/_vendor/distlib/_backport/shutil.py,sha256=h-yIttFtLq-_LKn5lLn4beHXzRwcmo2wEg4UKU7hX6E,26471
pip/_vendor/distlib/_backport/sysconfig.cfg,sha256=LoipPkR2PfCKC7JUQBGxp6OFVlWIiWBXT-rNuzv8acU,2701
pip/_vendor/distlib/_backport/sysconfig.py,sha256=qV5ZK6YVkHS-gUFacIT2TpFBw7bZJFH3DYa8PbT6O54,27640
pip/_vendor/distlib/_backport/tarfile.py,sha256=fzwGLsCdTmO8uzoHjyjSgu4-srrDQEAcw4jNKUfvQH0,95235
pip/_vendor/distlib/compat.py,sha256=Z8PBQ-ZPCJuRvzs5rtHuzceFOB8iYV8HHjAGrW3SQ8s,42528
pip/_vendor/distlib/database.py,sha256=m_LtL3siDUdcSvftoTnXcjhUJA-WZhDwTvHO7rg72SA,52398
pip/_vendor/distlib/index.py,sha256=LMZK2uX_oH2SNgPQ_lnnoJFFx6X5ByY-LBP8qgUTuC0,21248
pip/_vendor/distlib/locators.py,sha256=mefGpRbPPG1Bl-UhNUquwBQR50J8uL0x2CSG-c5mbJs,53265
pip/_vendor/distlib/manifest.py,sha256=0TlGw5ZyFp8wxr_GJz7tAAXGYwUJvceMIOsh9ydAXpM,15204
pip/_vendor/distlib/markers.py,sha256=lTFISO7AcGHoYk2AQx_VFrjDltOFAg5YnPTvBGnOZtE,4474
pip/_vendor/distlib/metadata.py,sha256=tCLNLfWfC-lQacX4bY-mBTKPgJZTiowKnLX2HWUcQeE,40167
pip/_vendor/distlib/resources.py,sha256=DMriFf8j-5IXduPHW0YPnx50jQIbaOlvTQkPcdN5r88,11178
pip/_vendor/distlib/scripts.py,sha256=-jtzATPNKOj8VpnxJUh1aXdUUkNpXiop-bOwsojbwWA,17671
pip/_vendor/distlib/t32.exe,sha256=NS3xBCVAld35JVFNmb-1QRyVtThukMrwZVeXn4LhaEQ,96768
pip/_vendor/distlib/t64.exe,sha256=oAqHes78rUWVM0OtVqIhUvequl_PKhAhXYQWnUf7zR0,105984
pip/_vendor/distlib/util.py,sha256=w5nS2W71eWhilj69cZbERp6NR5rV1p_yIUbkwpvtqu4,69523
pip/_vendor/distlib/version.py,sha256=cI1oZGIqY11EQn5P-jI_OqQml7jIxLFS52syBFIpXNU,24247
pip/_vendor/distlib/w32.exe,sha256=lJtnZdeUxTZWya_EW5DZos_K5rswRECGspIl8ZJCIXs,90112
pip/_vendor/distlib/w64.exe,sha256=0aRzoN2BO9NWW4ENy4_4vHkHR4qZTFZNVSAJJYlODTI,99840
pip/_vendor/distlib/wheel.py,sha256=NNoICc3pe4uSF-gHpmqgGwQs3Q-0dnn5418JHS1ZI6c,44118
pip/_vendor/distro.py,sha256=ni3ahks9qSr3P1FMur9zTPEF_xcAdaHW8iWZWqwB5mU,44858
pip/_vendor/html5lib/__init__.py,sha256=Bmlpvs5dN2GoaWRAvN2UZ1yF_p7xb2zROelA0QxBKis,1195
pip/_vendor/html5lib/__pycache__/__init__.cpython-39.pyc,,
pip/_vendor/html5lib/__pycache__/_ihatexml.cpython-39.pyc,,
pip/_vendor/html5lib/__pycache__/_inputstream.cpython-39.pyc,,
pip/_vendor/html5lib/__pycache__/_tokenizer.cpython-39.pyc,,
pip/_vendor/html5lib/__pycache__/_utils.cpython-39.pyc,,
pip/_vendor/html5lib/__pycache__/constants.cpython-39.pyc,,
pip/_vendor/html5lib/__pycache__/html5parser.cpython-39.pyc,,
pip/_vendor/html5lib/__pycache__/serializer.cpython-39.pyc,,
pip/_vendor/html5lib/_ihatexml.py,sha256=IyMKE35pNPCYYGs290_oSUhWXF1BQZsbVcXBzGuFvl4,17017
pip/_vendor/html5lib/_inputstream.py,sha256=EA6Wj46jxuK6544Vnk9YOjIpFwGbfJW0Ar2cMH1H0VU,33271
pip/_vendor/html5lib/_tokenizer.py,sha256=BUDNWZENVB0oFBiKR49sZsqQU4rzLLa13-byISlYRfA,78775
pip/_vendor/html5lib/_trie/__init__.py,sha256=kfSo27BaU64El8U7bg4ugLmI3Ksywu54xE6BlhVgggA,114
pip/_vendor/html5lib/_trie/__pycache__/__init__.cpython-39.pyc,,
pip/_vendor/html5lib/_trie/__pycache__/_base.cpython-39.pyc,,
pip/_vendor/html5lib/_trie/__pycache__/py.cpython-39.pyc,,
pip/_vendor/html5lib/_trie/_base.py,sha256=LTpLNz1pn7LAcfn2TFvRp4moVPbFTkkbhzjPKUrvGes,1053
pip/_vendor/html5lib/_trie/py.py,sha256=LmuYcbypKw-aMLcT0-IY6WewATGzg1QRkmyd8hTBQeY,1842
pip/_vendor/html5lib/_utils.py,sha256=dLFxoZDTv5r38HOIHy45uxWwUY7VhLgbEFWNQw6Wppo,5090
pip/_vendor/html5lib/constants.py,sha256=P9n6_ScDgAFkst0YfKaB-yaAlxVtUS9uMn5Lh8ywbQo,86410
pip/_vendor/html5lib/filters/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
pip/_vendor/html5lib/filters/__pycache__/__init__.cpython-39.pyc,,
pip/_vendor/html5lib/filters/__pycache__/alphabeticalattributes.cpython-39.pyc,,
pip/_vendor/html5lib/filters/__pycache__/base.cpython-39.pyc,,
pip/_vendor/html5lib/filters/__pycache__/inject_meta_charset.cpython-39.pyc,,
pip/_vendor/html5lib/filters/__pycache__/lint.cpython-39.pyc,,
pip/_vendor/html5lib/filters/__pycache__/optionaltags.cpython-39.pyc,,
pip/_vendor/html5lib/filters/__pycache__/sanitizer.cpython-39.pyc,,
pip/_vendor/html5lib/filters/__pycache__/whitespace.cpython-39.pyc,,
pip/_vendor/html5lib/filters/alphabeticalattributes.py,sha256=0TV6VWJzhNkcLFiR7BNZUJsTJgAEEyZ02in6-PuL2gU,948
pip/_vendor/html5lib/filters/base.py,sha256=6D2t423hbOLtjnvAAOrs1mWX1vsabMLBrWQF67ITPho,298
pip/_vendor/html5lib/filters/inject_meta_charset.py,sha256=J-W5X3LyosH1sUipiHU1x-2ocd7g9JSudpIek_QlCUU,3018
pip/_vendor/html5lib/filters/lint.py,sha256=O6sK29HXXW02Nv-EIEOfGvdQMuXxWvBePu2sQ2ecbJc,3736
pip/_vendor/html5lib/filters/optionaltags.py,sha256=IVHcJ35kr6_MYBqahFMIK-Gel-ALLUk6Wk9X-or_yXk,10795
pip/_vendor/html5lib/filters/sanitizer.py,sha256=uwT0HNJHjnw3Omf2LpmvfoVdIgAWb9_3VrMcWD1es_M,27813
pip/_vendor/html5lib/filters/whitespace.py,sha256=bCC0mMQZicbq8HCg67pip_oScN5Fz_KkkvldfE137Kw,1252
pip/_vendor/html5lib/html5parser.py,sha256=2xGZMaUvdkuuswAmpkazK1CXHT_y3-XTy4lS71PYUuU,119981
pip/_vendor/html5lib/serializer.py,sha256=vMivcnRcQxjCSTrbMFdevLMhJ2HbF0cfv_CkroTODZM,16168
pip/_vendor/html5lib/treeadapters/__init__.py,sha256=76InX2oJAx-C4rGAJziZsoE_CHI8_3thl6TeMgP-ypk,709
pip/_vendor/html5lib/treeadapters/__pycache__/__init__.cpython-39.pyc,,
pip/_vendor/html5lib/treeadapters/__pycache__/genshi.cpython-39.pyc,,
pip/_vendor/html5lib/treeadapters/__pycache__/sax.cpython-39.pyc,,
pip/_vendor/html5lib/treeadapters/genshi.py,sha256=nQHNa4Hu0IMpu4bqHbJJS3_Cd1pKXgDO1pgMZ6gADDg,1769
pip/_vendor/html5lib/treeadapters/sax.py,sha256=PAmV6NG9BSpfMHUY72bDbXwAe6Q2tPn1BC2yAD-K1G0,1826
pip/_vendor/html5lib/treebuilders/__init__.py,sha256=zfrXDjeqDo2M7cJFax6hRJs70Az4pfHFiZbuLOZ9YE4,3680
pip/_vendor/html5lib/treebuilders/__pycache__/__init__.cpython-39.pyc,,
pip/_vendor/html5lib/treebuilders/__pycache__/base.cpython-39.pyc,,
pip/_vendor/html5lib/treebuilders/__pycache__/dom.cpython-39.pyc,,
pip/_vendor/html5lib/treebuilders/__pycache__/etree.cpython-39.pyc,,
pip/_vendor/html5lib/treebuilders/__pycache__/etree_lxml.cpython-39.pyc,,
pip/_vendor/html5lib/treebuilders/base.py,sha256=Yao9LOJd-4KaLEx-3ysqRkAkhv1YaDqhTksvX6nuQyY,14982
pip/_vendor/html5lib/treebuilders/dom.py,sha256=QWkBtUprtDosTiTFlIY6QpgKwk2-pD0AV84qVTNgiLo,9164
pip/_vendor/html5lib/treebuilders/etree.py,sha256=k-LHrme562Hd5GmIi87r1_vfF25MtURGPurT3mAp8sY,13179
pip/_vendor/html5lib/treebuilders/etree_lxml.py,sha256=CviyyGjvv2TwN-m47DC8DFWdx0Gt-atRw9jMTv4v8-Q,15158
pip/_vendor/html5lib/treewalkers/__init__.py,sha256=buyxCJb9LFfJ_1ZIMdc-Do1zV93Uw-7L942o2H-Swy0,5873
pip/_vendor/html5lib/treewalkers/__pycache__/__init__.cpython-39.pyc,,
pip/_vendor/html5lib/treewalkers/__pycache__/base.cpython-39.pyc,,
pip/_vendor/html5lib/treewalkers/__pycache__/dom.cpython-39.pyc,,
pip/_vendor/html5lib/treewalkers/__pycache__/etree.cpython-39.pyc,,
pip/_vendor/html5lib/treewalkers/__pycache__/etree_lxml.cpython-39.pyc,,
pip/_vendor/html5lib/treewalkers/__pycache__/genshi.cpython-39.pyc,,
pip/_vendor/html5lib/treewalkers/base.py,sha256=g-cLq7VStBtpZZZ1v_Tbwp3GhJjQ2oG5njgeHVhAaXE,7728
pip/_vendor/html5lib/treewalkers/dom.py,sha256=fBJht3gn5a6y1WN2KE9gsUru158yTQ0KikT3vOM7Xc4,1456
pip/_vendor/html5lib/treewalkers/etree.py,sha256=VtcKOS13qy9nv2PAaYoB1j9V1Z8n9o0AEA9KoGAgYOg,4682
pip/_vendor/html5lib/treewalkers/etree_lxml.py,sha256=u9X06RqSrHanDb0qGI-v8I99-PqzOzmnpZOspHHz_Io,6572
pip/_vendor/html5lib/treewalkers/genshi.py,sha256=P_2Tnc2GkbWJfuodXN9oYIg6kN9E26aWXXe9iL0_eX4,2378
pip/_vendor/idna/__init__.py,sha256=aHTBHXXun6n0ecdus8ToBvhs-4Ziin24HuNbJ9ZXE3o,893
pip/_vendor/idna/__pycache__/__init__.cpython-39.pyc,,
pip/_vendor/idna/__pycache__/codec.cpython-39.pyc,,
pip/_vendor/idna/__pycache__/compat.cpython-39.pyc,,
pip/_vendor/idna/__pycache__/core.cpython-39.pyc,,
pip/_vendor/idna/__pycache__/idnadata.cpython-39.pyc,,
pip/_vendor/idna/__pycache__/intranges.cpython-39.pyc,,
pip/_vendor/idna/__pycache__/package_data.cpython-39.pyc,,
pip/_vendor/idna/__pycache__/uts46data.cpython-39.pyc,,
pip/_vendor/idna/codec.py,sha256=LtpT6KflQ-NkZZXgLc0_ADLiShhKuC__nz_JmYyLnXs,3570
pip/_vendor/idna/compat.py,sha256=Y-t409G3-dxunv_cSx0zrDjJkOKtC60ALLuqSknryXc,376
pip/_vendor/idna/core.py,sha256=PWa20xVmQMBN8zgaBNXGNKCbQHOdnqKEpdcWCxXTidw,13235
pip/_vendor/idna/idnadata.py,sha256=z3JZKnxitScqic6U-cO3rM_SmC2P0-UjUHEDnGv1xsQ,44400
pip/_vendor/idna/intranges.py,sha256=Ipf6IPZDhD56FppDz_tjl_1YWzzh_viPiEBBp_nSQ8k,1991
pip/_vendor/idna/package_data.py,sha256=MMuW8HkL_d3g6tkyzl7kIEN-fg9uyv6YDmk_v_jjL3U,23
pip/_vendor/idna/uts46data.py,sha256=l_0BwSDthDPKq_AX35avb7jnXUgPEKgjf816traOf8s,210287
pip/_vendor/msgpack/__init__.py,sha256=OhoFouHD7wOYMP2PN-Hlyk9RAZw39V-iPTDRsmkoIns,1172
pip/_vendor/msgpack/__pycache__/__init__.cpython-39.pyc,,
pip/_vendor/msgpack/__pycache__/_version.cpython-39.pyc,,
pip/_vendor/msgpack/__pycache__/exceptions.cpython-39.pyc,,
pip/_vendor/msgpack/__pycache__/ext.cpython-39.pyc,,
pip/_vendor/msgpack/__pycache__/fallback.cpython-39.pyc,,
pip/_vendor/msgpack/_version.py,sha256=qcv5IclQy1PSvtCYDvZyjaUSFWdHPIRzdGjv3YwkKCs,21
pip/_vendor/msgpack/exceptions.py,sha256=2fCtczricqQgdT3NtW6cTqmZn3WA7GQtmlPuT-NhLyM,1129
pip/_vendor/msgpack/ext.py,sha256=3Xznjz11nxxfQJe50uLzKDznWOvxOBxWSZ833DL_DDs,6281
pip/_vendor/msgpack/fallback.py,sha256=ZaNwBMO2hh9WrqHnYqdHJaCv8zzPMnva9YhD5yInTpM,39113
pip/_vendor/packaging/__about__.py,sha256=eoW72tGZd0YfLOf_tDScx_kjG1SFtdXMg79yNoJrxg4,687
pip/_vendor/packaging/__init__.py,sha256=Rtl7XZgdQyDFurOf4u9TWH8UM8-Y6pNC9mfN1QP5NZY,522
pip/_vendor/packaging/__pycache__/__about__.cpython-39.pyc,,
pip/_vendor/packaging/__pycache__/__init__.cpython-39.pyc,,
pip/_vendor/packaging/__pycache__/_manylinux.cpython-39.pyc,,
pip/_vendor/packaging/__pycache__/_musllinux.cpython-39.pyc,,
pip/_vendor/packaging/__pycache__/_structures.cpython-39.pyc,,
pip/_vendor/packaging/__pycache__/markers.cpython-39.pyc,,
pip/_vendor/packaging/__pycache__/requirements.cpython-39.pyc,,
pip/_vendor/packaging/__pycache__/specifiers.cpython-39.pyc,,
pip/_vendor/packaging/__pycache__/tags.cpython-39.pyc,,
pip/_vendor/packaging/__pycache__/utils.cpython-39.pyc,,
pip/_vendor/packaging/__pycache__/version.cpython-39.pyc,,
pip/_vendor/packaging/_manylinux.py,sha256=qLGjZQVH7CwWE2jjOIyE2f4hektTsbtFc7UxfRCQzMI,11789
pip/_vendor/packaging/_musllinux.py,sha256=Eq-8bd_ZnxcxPEZ-N4TTl7_HATTosVSmxMhZidXvg5g,4514
pip/_vendor/packaging/_structures.py,sha256=9-rULC3_oZTgVRl9Furm3bFZe7xVsZeGiway_piR3c0,1696
pip/_vendor/packaging/markers.py,sha256=nTk-tDQYPWjSMZSUIwGVaIvY3NbYmtQQLSXvAgBBxL8,8791
pip/_vendor/packaging/requirements.py,sha256=PKbV9AWRNnqd0jGBMi83GPyS3hAUmx8IMxjQSJEBXsY,4822
pip/_vendor/packaging/specifiers.py,sha256=HeDND7swHCqUzD9mKLuvXwBp8Rl-sBdWoA9okxul8cA,31792
pip/_vendor/packaging/tags.py,sha256=aUZfcmH14rf5DAwYCHHjx5Z9zWnPAYqm9QKJf0yEkRk,16198
pip/_vendor/packaging/utils.py,sha256=wl4SX90PE-_rF8s24QsN30N9afxY8BX42yKBmwI3wtU,4336
pip/_vendor/packaging/version.py,sha256=CfhEcnRcBUAgA2viaZV9i5f84V0goapf5vSGgg3Yxl0,15169
pip/_vendor/pep517/__init__.py,sha256=_xFPzQ0RNMbFs0cvD091C2aMOneiq-cTNfGj9uSTc3k,136
pip/_vendor/pep517/__pycache__/__init__.cpython-39.pyc,,
pip/_vendor/pep517/__pycache__/build.cpython-39.pyc,,
pip/_vendor/pep517/__pycache__/check.cpython-39.pyc,,
pip/_vendor/pep517/__pycache__/colorlog.cpython-39.pyc,,
pip/_vendor/pep517/__pycache__/compat.cpython-39.pyc,,
pip/_vendor/pep517/__pycache__/dirtools.cpython-39.pyc,,
pip/_vendor/pep517/__pycache__/envbuild.cpython-39.pyc,,
pip/_vendor/pep517/__pycache__/meta.cpython-39.pyc,,
pip/_vendor/pep517/__pycache__/wrappers.cpython-39.pyc,,
pip/_vendor/pep517/build.py,sha256=MDBFdwDA7ygdOFkHRZDA2vmbLuM5vIg3PYnHAszhMz8,3596
pip/_vendor/pep517/check.py,sha256=FwTS6MXy67e7MCC3QPsN4g7sou0Pg1FkXxMBLimFJQ4,6303
pip/_vendor/pep517/colorlog.py,sha256=uOdcoDYZ0ocKGRPPs5JgvpLYVDIfoEVvoMpc43ICQFU,4213
pip/_vendor/pep517/compat.py,sha256=BmdEmQQW3XQqBjgDov0EWT-q1V-ECANNzDp692gUTdg,1113
pip/_vendor/pep517/dirtools.py,sha256=hrSzAJOGDo3tXdtCbgJ6LqoLhPVJn6JGmekz1ofLi6o,1173
pip/_vendor/pep517/envbuild.py,sha256=D8XnGq1CZKAuIAMZQxpJQrvDwkjKRzKotHAOpr_AF1M,6283
pip/_vendor/pep517/in_process/__init__.py,sha256=IZ3Qr3CBsGM77dePRWUxnF9FADyAi0imlDLX5MWGPz8,580
pip/_vendor/pep517/in_process/__pycache__/__init__.cpython-39.pyc,,
pip/_vendor/pep517/in_process/__pycache__/_in_process.cpython-39.pyc,,
pip/_vendor/pep517/in_process/_in_process.py,sha256=MW1-Z-5WuMGVy0cdY3-kgSr2rEO7bIYDlhgMuMHciEw,11182
pip/_vendor/pep517/meta.py,sha256=ZkHYB0YHt4FDuSE5NdFuVsat3xfZ6LgW6VS6d4D6vIQ,2555
pip/_vendor/pep517/wrappers.py,sha256=mgBTFXDKJtKluWpQ7VMZda49ZUzFGSNu5d_PYJLoor0,13629
pip/_vendor/pkg_resources/__init__.py,sha256=zeMvnKzGEcWISjTwy6YtFKWamTFJdwBwYjBAFUoyf7A,111573
pip/_vendor/pkg_resources/__pycache__/__init__.cpython-39.pyc,,
pip/_vendor/pkg_resources/__pycache__/py31compat.cpython-39.pyc,,
pip/_vendor/pkg_resources/py31compat.py,sha256=tzQGe-w8g7GEXb6Ozw2-v8ZHaIygADmw0LAgriYzPAc,585
pip/_vendor/progress/__init__.py,sha256=YTntFxK5CZDfVAa1b77EbNkWljGqvyM72YKRTHaHap8,5034
pip/_vendor/progress/__pycache__/__init__.cpython-39.pyc,,
pip/_vendor/progress/__pycache__/bar.cpython-39.pyc,,
pip/_vendor/progress/__pycache__/counter.cpython-39.pyc,,
pip/_vendor/progress/__pycache__/spinner.cpython-39.pyc,,
pip/_vendor/progress/bar.py,sha256=evFQod41y2bMU60teK16uV-A5F4yVUehab8dtCiXj1E,2945
pip/_vendor/progress/counter.py,sha256=c8AdstUGrFQvIQbvtHjjXxZx6LCflrY-a7DVM6IYTBs,1413
pip/_vendor/progress/spinner.py,sha256=zLcx2RFinPfM6UwveJJrcJ8YABE3aLCAKqQFVD3pHow,1423
pip/_vendor/pyparsing.py,sha256=lD3A8iEK1JYvnNDP00Cgve4vZjwEFonCvrpo7mEl3Q8,280501
pip/_vendor/requests/__init__.py,sha256=IPdrlLH8zOpx45fFKwMSH9HT_d9wfwdjjoka0HEY9ps,5267
pip/_vendor/requests/__pycache__/__init__.cpython-39.pyc,,
pip/_vendor/requests/__pycache__/__version__.cpython-39.pyc,,
pip/_vendor/requests/__pycache__/_internal_utils.cpython-39.pyc,,
pip/_vendor/requests/__pycache__/adapters.cpython-39.pyc,,
pip/_vendor/requests/__pycache__/api.cpython-39.pyc,,
pip/_vendor/requests/__pycache__/auth.cpython-39.pyc,,
pip/_vendor/requests/__pycache__/certs.cpython-39.pyc,,
pip/_vendor/requests/__pycache__/compat.cpython-39.pyc,,
pip/_vendor/requests/__pycache__/cookies.cpython-39.pyc,,
pip/_vendor/requests/__pycache__/exceptions.cpython-39.pyc,,
pip/_vendor/requests/__pycache__/help.cpython-39.pyc,,
pip/_vendor/requests/__pycache__/hooks.cpython-39.pyc,,
pip/_vendor/requests/__pycache__/models.cpython-39.pyc,,
pip/_vendor/requests/__pycache__/packages.cpython-39.pyc,,
pip/_vendor/requests/__pycache__/sessions.cpython-39.pyc,,
pip/_vendor/requests/__pycache__/status_codes.cpython-39.pyc,,
pip/_vendor/requests/__pycache__/structures.cpython-39.pyc,,
pip/_vendor/requests/__pycache__/utils.cpython-39.pyc,,
pip/_vendor/requests/__version__.py,sha256=SKjnGRNIWoxDQR1pAkRW3fen6mAXw7MruEBPlqvEjuE,455
pip/_vendor/requests/_internal_utils.py,sha256=zDALdxFfs4pAp4CME_TTw2rGyYR2EGBpSehYHgfn8o0,1138
pip/_vendor/requests/adapters.py,sha256=v-nXh1zlxNzGQWQicaDrnsMmus75p2c99GPOtPl-6uw,22081
pip/_vendor/requests/api.py,sha256=IPHU2zrGr6hURdheImh9lqurXPhQlv4PFOkjik6dmSQ,6561
pip/_vendor/requests/auth.py,sha256=xe7s91xl3ENjQgRlZP3-2KsACnXYHAiLOuHLDw6nyyQ,10512
pip/_vendor/requests/certs.py,sha256=fFBPJjnP90gWELetFYPbzrsfZgSZopej7XhlkrnVVec,483
pip/_vendor/requests/compat.py,sha256=xfkhI1O0M1RPT9n92GEeoalPuBOYMsdApi7TONmwWD8,2121
pip/_vendor/requests/cookies.py,sha256=PIxSKntoUn6l2irwR-CBMgm0scK8s-6yUZzwoCVIAdo,18979
pip/_vendor/requests/exceptions.py,sha256=-_Uvqm89mT79nPWoxlf_NF7JawnsfHcJdAeIipOiAQg,3377
pip/_vendor/requests/help.py,sha256=HQ9KRPaFWwmEYS46TnLTyaGYXGNv-G3RQyO9yUfa7Gg,4104
pip/_vendor/requests/hooks.py,sha256=LAWGUHI8SB52PkhFYbwyPcT6mWsjuVJeeZpM0RUTADc,791
pip/_vendor/requests/models.py,sha256=eBTofFVVYXXqpuqkMrPzRNYKJfuICHhw5bPn6bi-lEI,35890
pip/_vendor/requests/packages.py,sha256=ry2VlKGoCDdr8ZJyNCXxDcAF1HfENfmoylCK-_VzXh0,711
pip/_vendor/requests/sessions.py,sha256=xn0NHgjfsCdvZoi11vUDP8zS0LPM0sVuZP_6qYNC7kw,30949
pip/_vendor/requests/status_codes.py,sha256=ef_TQlJHa44J6_nrl_hTw6h7I-oZS8qg2MHCu9YyzYY,4311
pip/_vendor/requests/structures.py,sha256=ssrNLrH8XELX89hk4yRQYEVeHnbopq1HAJBfgu38bi8,3110
pip/_vendor/requests/utils.py,sha256=dZh-kGRO-A8sLHdHp_hcS_5u4syIDRRE2T-un0s4HwM,32407
pip/_vendor/resolvelib/__init__.py,sha256=g_NlynQjt3xlCb_JRtRIrV6Y-zBYSkQMxH4NtoC4Axc,563
pip/_vendor/resolvelib/__pycache__/__init__.cpython-39.pyc,,
pip/_vendor/resolvelib/__pycache__/providers.cpython-39.pyc,,
pip/_vendor/resolvelib/__pycache__/reporters.cpython-39.pyc,,
pip/_vendor/resolvelib/__pycache__/resolvers.cpython-39.pyc,,
pip/_vendor/resolvelib/__pycache__/structs.cpython-39.pyc,,
pip/_vendor/resolvelib/compat/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
pip/_vendor/resolvelib/compat/__pycache__/__init__.cpython-39.pyc,,
pip/_vendor/resolvelib/compat/__pycache__/collections_abc.cpython-39.pyc,,
pip/_vendor/resolvelib/compat/collections_abc.py,sha256=RCp_gXYFZUg2DF2iUPTTD-XSpBTia4xEuJhjbXNzQyM,162
pip/_vendor/resolvelib/providers.py,sha256=4rEMGvu_xM5qx42oiIeMwgfwsrd1vCUZusmbfvMknWg,5762
pip/_vendor/resolvelib/reporters.py,sha256=Yi7l5VMEKyhL20KIEglPukQHWJHkweV4e4amcJs-4yk,1401
pip/_vendor/resolvelib/resolvers.py,sha256=nlrz0Zql6opJgYgnBoFg3FwG_Z9lGp8rAi7hooQ33E8,17698
pip/_vendor/resolvelib/structs.py,sha256=8HTLTjfJCdDs2FBt3EqaNiFbn0oelLG9OQK9htCvBpE,4959
pip/_vendor/six.py,sha256=MB08ff_RApHF8XMk2vSx581-xTyX6sf_pQOtz6j1BZU,35547
pip/_vendor/tenacity/__init__.py,sha256=YfrArVagvtYH5gcjBOlOQ2u6dx2C2N4X1x0DOUBXv5Y,18774
pip/_vendor/tenacity/__pycache__/__init__.cpython-39.pyc,,
pip/_vendor/tenacity/__pycache__/_asyncio.cpython-39.pyc,,
pip/_vendor/tenacity/__pycache__/_utils.cpython-39.pyc,,
pip/_vendor/tenacity/__pycache__/after.cpython-39.pyc,,
pip/_vendor/tenacity/__pycache__/before.cpython-39.pyc,,
pip/_vendor/tenacity/__pycache__/before_sleep.cpython-39.pyc,,
pip/_vendor/tenacity/__pycache__/nap.cpython-39.pyc,,
pip/_vendor/tenacity/__pycache__/retry.cpython-39.pyc,,
pip/_vendor/tenacity/__pycache__/stop.cpython-39.pyc,,
pip/_vendor/tenacity/__pycache__/tornadoweb.cpython-39.pyc,,
pip/_vendor/tenacity/__pycache__/wait.cpython-39.pyc,,
pip/_vendor/tenacity/_asyncio.py,sha256=jZcrONVfckAiLERCKTxI9DJ_Aeq4fquZj9G7Vr1_I7s,3406
pip/_vendor/tenacity/_utils.py,sha256=J2-zhV7bDTTuye-U8jtimO7lN1x70_a23qAdKniuzSE,2012
pip/_vendor/tenacity/after.py,sha256=mJq5ygM_NzL69Bx63RbI24IU5KgGHqmwl3AbQXiTCTc,1542
pip/_vendor/tenacity/before.py,sha256=RmWTv09-aU_3kFVRJw6PX3dp74ZZqnRD1UZUoCWw5XY,1417
pip/_vendor/tenacity/before_sleep.py,sha256=gSQPoPHevxpluUv0ASzd2Z4AOfq8Q8Y7XOns32cL4n8,1966
pip/_vendor/tenacity/nap.py,sha256=5DH1ui6-d3X4ZsQCRKJhY5jaQ0NdYZ2AEqt7Svt5VFM,1426
pip/_vendor/tenacity/retry.py,sha256=VsJQ9DcYTMr0ZeV43yhQfBDDJD1y5av52TJ0OSwvqLw,6858
pip/_vendor/tenacity/stop.py,sha256=lVnfBu2fzvqVtsL-HH8o1m_HborN7zLnlXBWa2UzM-A,2886
pip/_vendor/tenacity/tornadoweb.py,sha256=2wGpfDdTztK9Sk74ARv8prohTReTQzst9a1m1qo5bBs,2204
pip/_vendor/tenacity/wait.py,sha256=t16nLHioncGDdKA6ETwTNzABC-RrZiR-7HS1pXikVsg,6882
pip/_vendor/tomli/__init__.py,sha256=fUFJngh-LwLWqbgw4Vc7wvxnfTdrIK8Nc7wvydyxOjw,236
pip/_vendor/tomli/__pycache__/__init__.cpython-39.pyc,,
pip/_vendor/tomli/__pycache__/_parser.cpython-39.pyc,,
pip/_vendor/tomli/__pycache__/_re.cpython-39.pyc,,
pip/_vendor/tomli/_parser.py,sha256=946C00VAWqHjKSueGK44YSAU_Ufwg4LQmvd8yqta2dg,23118
pip/_vendor/tomli/_re.py,sha256=tGGogP0HJnQDBSITAPldXRB5TLQeaC069FBzxVOOy5k,2764
pip/_vendor/urllib3/__init__.py,sha256=FzLqycdKhCzSxjYOPTX50D3qf0lTCe6UgfZdwT-Li7o,2848
pip/_vendor/urllib3/__pycache__/__init__.cpython-39.pyc,,
pip/_vendor/urllib3/__pycache__/_collections.cpython-39.pyc,,
pip/_vendor/urllib3/__pycache__/_version.cpython-39.pyc,,
pip/_vendor/urllib3/__pycache__/connection.cpython-39.pyc,,
pip/_vendor/urllib3/__pycache__/connectionpool.cpython-39.pyc,,
pip/_vendor/urllib3/__pycache__/exceptions.cpython-39.pyc,,
pip/_vendor/urllib3/__pycache__/fields.cpython-39.pyc,,
pip/_vendor/urllib3/__pycache__/filepost.cpython-39.pyc,,
pip/_vendor/urllib3/__pycache__/poolmanager.cpython-39.pyc,,
pip/_vendor/urllib3/__pycache__/request.cpython-39.pyc,,
pip/_vendor/urllib3/__pycache__/response.cpython-39.pyc,,
pip/_vendor/urllib3/_collections.py,sha256=RQtWWhudTDETvb2BCVqih1QTpXS2Q5HSf77UJY5ditA,11148
pip/_vendor/urllib3/_version.py,sha256=Cs83ZyfrMWqd18tvuyiZ-SW91-r7-fsCZ-S3EnE-7Vk,65
pip/_vendor/urllib3/connection.py,sha256=ml6ucQ9HfP5eR3t_x7Qpgkke62PF92i-b_XYrIUdZeI,19293
pip/_vendor/urllib3/connectionpool.py,sha256=itteZaSObupTC6p-6YYcI3KTQdLwgQxlS01w_hOoQqA,38198
pip/_vendor/urllib3/contrib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
pip/_vendor/urllib3/contrib/__pycache__/__init__.cpython-39.pyc,,
pip/_vendor/urllib3/contrib/__pycache__/_appengine_environ.cpython-39.pyc,,
pip/_vendor/urllib3/contrib/__pycache__/appengine.cpython-39.pyc,,
pip/_vendor/urllib3/contrib/__pycache__/ntlmpool.cpython-39.pyc,,
pip/_vendor/urllib3/contrib/__pycache__/pyopenssl.cpython-39.pyc,,
pip/_vendor/urllib3/contrib/__pycache__/securetransport.cpython-39.pyc,,
pip/_vendor/urllib3/contrib/__pycache__/socks.cpython-39.pyc,,
pip/_vendor/urllib3/contrib/_appengine_environ.py,sha256=POYJSeNWacJYwXQdv0If3v56lcoiHuL6MQE8pwG1Yoc,993
pip/_vendor/urllib3/contrib/_securetransport/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
pip/_vendor/urllib3/contrib/_securetransport/__pycache__/__init__.cpython-39.pyc,,
pip/_vendor/urllib3/contrib/_securetransport/__pycache__/bindings.cpython-39.pyc,,
pip/_vendor/urllib3/contrib/_securetransport/__pycache__/low_level.cpython-39.pyc,,
pip/_vendor/urllib3/contrib/_securetransport/bindings.py,sha256=jreOmmwBW-Cio0m7I_OjmP028nqgrGuo_oB2f7Gir3s,18168
pip/_vendor/urllib3/contrib/_securetransport/low_level.py,sha256=0KKeznz3h0z-SBDbCtGorDfgCgiZ30VQOqkX5ZgaPBY,14304
pip/_vendor/urllib3/contrib/appengine.py,sha256=nlIR6iWZ0A1cV9X4dYwdx7H1F1tqGE7ai9QCfJ7ntFo,11348
pip/_vendor/urllib3/contrib/ntlmpool.py,sha256=JCCrvNQpXdL3eb_D4AoviNnl71nYhSX2r-hG9N-dPf4,4668
pip/_vendor/urllib3/contrib/pyopenssl.py,sha256=093d4DdfHcz0h8KcEg-D9fQEUtXaVLENmOkzOqNQ5eU,17402
pip/_vendor/urllib3/contrib/securetransport.py,sha256=ozB5tLGYiVgN2NLx9vvzVxjdtY9nNj9mBxGsCYTwEGI,35356
pip/_vendor/urllib3/contrib/socks.py,sha256=RqYih4HGeICnKzmYnG3MMo2xMlCdwb1bAdEuo6zCA_Y,7313
pip/_vendor/urllib3/exceptions.py,sha256=QDT9xy1fNxui5aS7dMabeb1gokQOQ-zOT7XiDp-O5Qo,8540
pip/_vendor/urllib3/fields.py,sha256=0KSfpuXxzXUMLkI2npM9siWOqCJO1H4wCiJN6neVmlA,8853
pip/_vendor/urllib3/filepost.py,sha256=BVkEES0YAO9tFwXGBj1mD9yO92pRwk4pX5Q6cO5IRb8,2538
pip/_vendor/urllib3/packages/__init__.py,sha256=FsOIVHqBFBlT3XxZnaD5y2yq0mvtVwmY4kut3GEfcBI,113
pip/_vendor/urllib3/packages/__pycache__/__init__.cpython-39.pyc,,
pip/_vendor/urllib3/packages/__pycache__/six.cpython-39.pyc,,
pip/_vendor/urllib3/packages/backports/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
pip/_vendor/urllib3/packages/backports/__pycache__/__init__.cpython-39.pyc,,
pip/_vendor/urllib3/packages/backports/__pycache__/makefile.cpython-39.pyc,,
pip/_vendor/urllib3/packages/backports/makefile.py,sha256=DREmQjGcs2LoVH_Q3hrggClhTNdcI5Y3GJglsuihjAM,1468
pip/_vendor/urllib3/packages/six.py,sha256=dUImuFN7dZON9oeQQqHjXdwH3n2Oxr9148Ns4K4Y2xg,35743
pip/_vendor/urllib3/packages/ssl_match_hostname/__init__.py,sha256=d-Tyw37qbvVdcjcVF4WLYiM7AXaOpIg386C2P2uB5Ks,951
pip/_vendor/urllib3/packages/ssl_match_hostname/__pycache__/__init__.cpython-39.pyc,,
pip/_vendor/urllib3/packages/ssl_match_hostname/__pycache__/_implementation.cpython-39.pyc,,
pip/_vendor/urllib3/packages/ssl_match_hostname/_implementation.py,sha256=WXs1yNtk9PsYVmeTJQAcqeAm81zbzeabEWWf-xRJSAo,5839
pip/_vendor/urllib3/poolmanager.py,sha256=blNTYqVqFg9zUGncVtyXk1HQsTxKO1Cy9hfGVLAGvhM,20299
pip/_vendor/urllib3/request.py,sha256=Fe4bQCUhum8qh3t1dihpSsQwdyfd5nB44cNX8566DmM,6155
pip/_vendor/urllib3/response.py,sha256=LjfUJBUhwPrJTrGgNI3WoySUizNEPd1Xiv71YxE2J7Y,29024
pip/_vendor/urllib3/util/__init__.py,sha256=UV_J7p9b29cJXXQ6wTvBZppJDLUeKQ6mcv0v1ptl13c,1204
pip/_vendor/urllib3/util/__pycache__/__init__.cpython-39.pyc,,
pip/_vendor/urllib3/util/__pycache__/connection.cpython-39.pyc,,
pip/_vendor/urllib3/util/__pycache__/proxy.cpython-39.pyc,,
pip/_vendor/urllib3/util/__pycache__/queue.cpython-39.pyc,,
pip/_vendor/urllib3/util/__pycache__/request.cpython-39.pyc,,
pip/_vendor/urllib3/util/__pycache__/response.cpython-39.pyc,,
pip/_vendor/urllib3/util/__pycache__/retry.cpython-39.pyc,,
pip/_vendor/urllib3/util/__pycache__/ssl_.cpython-39.pyc,,
pip/_vendor/urllib3/util/__pycache__/ssltransport.cpython-39.pyc,,
pip/_vendor/urllib3/util/__pycache__/timeout.cpython-39.pyc,,
pip/_vendor/urllib3/util/__pycache__/url.cpython-39.pyc,,
pip/_vendor/urllib3/util/__pycache__/wait.cpython-39.pyc,,
pip/_vendor/urllib3/util/connection.py,sha256=hoiT3Z-vROOSOB-4JrFyRKzF67xYt-ZTFMTiYj1yd6Q,5070
pip/_vendor/urllib3/util/proxy.py,sha256=xMGYpCWlY1Obf1nod_fhOG3rk3NTUM2q_BJmj6B_NmU,1660
pip/_vendor/urllib3/util/queue.py,sha256=mY2d0cfoJG51UEKZwk_sJMwYraofNfQWq7Larj9xh_o,520
pip/_vendor/urllib3/util/request.py,sha256=O-NJTFysuN_wgY33pne8xA1P35qv3R7uh67ER9zwqYM,4266
pip/_vendor/urllib3/util/response.py,sha256=685vBStgxTo8u3KoOilR6Kuh7IGPZr7TmzrP9awEtqU,3617
pip/_vendor/urllib3/util/retry.py,sha256=6xS4OYGWN2gz8kX34RH6ly7Uc6YcfCb2Z3V0QMdHpys,21993
pip/_vendor/urllib3/util/ssl_.py,sha256=WILvlnNl3FxrO1-AuSJzGBuFTLCNIfkzRbhNvIuxseU,17672
pip/_vendor/urllib3/util/ssltransport.py,sha256=r8zXGD19jRdpYPlAt9wR-mBg9aVRIB3UkV1GiT5uENQ,7152
pip/_vendor/urllib3/util/timeout.py,sha256=Ym2WjTspeYp4fzcCYGTQ5aSU1neVSMHXBAgDp1rcETw,10271
pip/_vendor/urllib3/util/url.py,sha256=3MdcqSYaGz4A2FIwYwe4KclwnrTn6ZdEG1-sUoCniUo,14479
pip/_vendor/urllib3/util/wait.py,sha256=qk2qJQNb3FjhOm9lKJtpByhnsLWRVapWdhW_NLr7Eog,5557
pip/_vendor/vendor.txt,sha256=gryMWlplkGEQkjoFzG1xYAfARSAghGWVWX-fGObCxOw,386
pip/_vendor/webencodings/__init__.py,sha256=kG5cBDbIrAtrrdU-h1iSPVYq10ayTFldU1CTRcb1ym4,10921
pip/_vendor/webencodings/__pycache__/__init__.cpython-39.pyc,,
pip/_vendor/webencodings/__pycache__/labels.cpython-39.pyc,,
pip/_vendor/webencodings/__pycache__/mklabels.cpython-39.pyc,,
pip/_vendor/webencodings/__pycache__/tests.cpython-39.pyc,,
pip/_vendor/webencodings/__pycache__/x_user_defined.cpython-39.pyc,,
pip/_vendor/webencodings/labels.py,sha256=e9gPVTA1XNYalJMVVX7lXvb52Kurc4UdnXFJDPcBXFE,9210
pip/_vendor/webencodings/mklabels.py,sha256=tyhoDDc-TC6kjJY25Qn5TlsyMs2_IyPf_rfh4L6nSrg,1364
pip/_vendor/webencodings/tests.py,sha256=7J6TdufKEml8sQSWcYEsl-e73QXtPmsIHF6pPT0sq08,6716
pip/_vendor/webencodings/x_user_defined.py,sha256=CMn5bx2ccJ4y3Bsqf3xC24bYO4ONC3ZY_lv5vrqhKAY,4632
pip/py.typed,sha256=9_aEgAx4lyfhJKT_8nv7mk-FpX3Mdtn8cV5Fw11xicg,290

View File

@@ -1,5 +0,0 @@
Wheel-Version: 1.0
Generator: bdist_wheel (0.36.2)
Root-Is-Purelib: true
Tag: py3-none-any

View File

@@ -1,5 +0,0 @@
[console_scripts]
pip = pip._internal.cli.main:main
pip3 = pip._internal.cli.main:main
pip3.8 = pip._internal.cli.main:main

View File

@@ -1,13 +0,0 @@
from typing import List, Optional
__version__ = "21.2.3"
def main(args: Optional[List[str]] = None) -> int:
"""This is an internal API only meant for use by pip's own console scripts.
For additional details, see https://github.com/pypa/pip/issues/7498.
"""
from pip._internal.utils.entrypoints import _wrapper
return _wrapper(args)

View File

@@ -1,31 +0,0 @@
import os
import sys
import warnings
# Remove '' and current working directory from the first entry
# of sys.path, if present to avoid using current directory
# in pip commands check, freeze, install, list and show,
# when invoked as python -m pip <command>
if sys.path[0] in ("", os.getcwd()):
sys.path.pop(0)
# If we are running from a wheel, add the wheel to sys.path
# This allows the usage python pip-*.whl/pip install pip-*.whl
if __package__ == "":
# __file__ is pip-*.whl/pip/__main__.py
# first dirname call strips of '/__main__.py', second strips off '/pip'
# Resulting path is the name of the wheel itself
# Add that to sys.path so we can import pip
path = os.path.dirname(os.path.dirname(__file__))
sys.path.insert(0, path)
if __name__ == "__main__":
# Work around the error reported in #9540, pending a proper fix.
# Note: It is essential the warning filter is set *before* importing
# pip, as the deprecation happens at import time, not runtime.
warnings.filterwarnings(
"ignore", category=DeprecationWarning, module=".*packaging\\.version"
)
from pip._internal.cli.main import main as _main
sys.exit(_main())

View File

@@ -1,19 +0,0 @@
from typing import List, Optional
import pip._internal.utils.inject_securetransport # noqa
from pip._internal.utils import _log
# init_logging() must be called before any call to logging.getLogger()
# which happens at import of most modules.
_log.init_logging()
def main(args: (Optional[List[str]]) = None) -> int:
"""This is preserved for old console scripts that may still be referencing
it.
For additional details, see https://github.com/pypa/pip/issues/7498.
"""
from pip._internal.utils.entrypoints import _wrapper
return _wrapper(args)

View File

@@ -1,294 +0,0 @@
"""Build Environment used for isolation during sdist building
"""
import contextlib
import logging
import os
import pathlib
import sys
import textwrap
import zipfile
from collections import OrderedDict
from sysconfig import get_paths
from types import TracebackType
from typing import TYPE_CHECKING, Iterable, Iterator, List, Optional, Set, Tuple, Type
from pip._vendor.certifi import where
from pip._vendor.packaging.requirements import Requirement
from pip._vendor.packaging.version import Version
from pip import __file__ as pip_location
from pip._internal.cli.spinners import open_spinner
from pip._internal.locations import get_platlib, get_prefixed_libs, get_purelib
from pip._internal.metadata import get_environment
from pip._internal.utils.subprocess import call_subprocess
from pip._internal.utils.temp_dir import TempDirectory, tempdir_kinds
if TYPE_CHECKING:
from pip._internal.index.package_finder import PackageFinder
logger = logging.getLogger(__name__)
class _Prefix:
def __init__(self, path):
# type: (str) -> None
self.path = path
self.setup = False
self.bin_dir = get_paths(
'nt' if os.name == 'nt' else 'posix_prefix',
vars={'base': path, 'platbase': path}
)['scripts']
self.lib_dirs = get_prefixed_libs(path)
@contextlib.contextmanager
def _create_standalone_pip() -> Iterator[str]:
"""Create a "standalone pip" zip file.
The zip file's content is identical to the currently-running pip.
It will be used to install requirements into the build environment.
"""
source = pathlib.Path(pip_location).resolve().parent
# Return the current instance if `source` is not a directory. We can't build
# a zip from this, and it likely means the instance is already standalone.
if not source.is_dir():
yield str(source)
return
with TempDirectory(kind="standalone-pip") as tmp_dir:
pip_zip = os.path.join(tmp_dir.path, "__env_pip__.zip")
kwargs = {}
if sys.version_info >= (3, 8):
kwargs["strict_timestamps"] = False
with zipfile.ZipFile(pip_zip, "w", **kwargs) as zf:
for child in source.rglob("*"):
zf.write(child, child.relative_to(source.parent).as_posix())
yield os.path.join(pip_zip, "pip")
class BuildEnvironment:
"""Creates and manages an isolated environment to install build deps
"""
def __init__(self):
# type: () -> None
temp_dir = TempDirectory(
kind=tempdir_kinds.BUILD_ENV, globally_managed=True
)
self._prefixes = OrderedDict(
(name, _Prefix(os.path.join(temp_dir.path, name)))
for name in ('normal', 'overlay')
)
self._bin_dirs = [] # type: List[str]
self._lib_dirs = [] # type: List[str]
for prefix in reversed(list(self._prefixes.values())):
self._bin_dirs.append(prefix.bin_dir)
self._lib_dirs.extend(prefix.lib_dirs)
# Customize site to:
# - ensure .pth files are honored
# - prevent access to system site packages
system_sites = {
os.path.normcase(site) for site in (get_purelib(), get_platlib())
}
self._site_dir = os.path.join(temp_dir.path, 'site')
if not os.path.exists(self._site_dir):
os.mkdir(self._site_dir)
with open(os.path.join(self._site_dir, 'sitecustomize.py'), 'w') as fp:
fp.write(textwrap.dedent(
'''
import os, site, sys
# First, drop system-sites related paths.
original_sys_path = sys.path[:]
known_paths = set()
for path in {system_sites!r}:
site.addsitedir(path, known_paths=known_paths)
system_paths = set(
os.path.normcase(path)
for path in sys.path[len(original_sys_path):]
)
original_sys_path = [
path for path in original_sys_path
if os.path.normcase(path) not in system_paths
]
sys.path = original_sys_path
# Second, add lib directories.
# ensuring .pth file are processed.
for path in {lib_dirs!r}:
assert not path in sys.path
site.addsitedir(path)
'''
).format(system_sites=system_sites, lib_dirs=self._lib_dirs))
def __enter__(self):
# type: () -> None
self._save_env = {
name: os.environ.get(name, None)
for name in ('PATH', 'PYTHONNOUSERSITE', 'PYTHONPATH')
}
path = self._bin_dirs[:]
old_path = self._save_env['PATH']
if old_path:
path.extend(old_path.split(os.pathsep))
pythonpath = [self._site_dir]
os.environ.update({
'PATH': os.pathsep.join(path),
'PYTHONNOUSERSITE': '1',
'PYTHONPATH': os.pathsep.join(pythonpath),
})
def __exit__(
self,
exc_type, # type: Optional[Type[BaseException]]
exc_val, # type: Optional[BaseException]
exc_tb # type: Optional[TracebackType]
):
# type: (...) -> None
for varname, old_value in self._save_env.items():
if old_value is None:
os.environ.pop(varname, None)
else:
os.environ[varname] = old_value
def check_requirements(self, reqs):
# type: (Iterable[str]) -> Tuple[Set[Tuple[str, str]], Set[str]]
"""Return 2 sets:
- conflicting requirements: set of (installed, wanted) reqs tuples
- missing requirements: set of reqs
"""
missing = set()
conflicting = set()
if reqs:
env = get_environment(self._lib_dirs)
for req_str in reqs:
req = Requirement(req_str)
dist = env.get_distribution(req.name)
if not dist:
missing.add(req_str)
continue
if isinstance(dist.version, Version):
installed_req_str = f"{req.name}=={dist.version}"
else:
installed_req_str = f"{req.name}==={dist.version}"
if dist.version not in req.specifier:
conflicting.add((installed_req_str, req_str))
# FIXME: Consider direct URL?
return conflicting, missing
def install_requirements(
self,
finder, # type: PackageFinder
requirements, # type: Iterable[str]
prefix_as_string, # type: str
message # type: str
):
# type: (...) -> None
prefix = self._prefixes[prefix_as_string]
assert not prefix.setup
prefix.setup = True
if not requirements:
return
with contextlib.ExitStack() as ctx:
# TODO: Remove this block when dropping 3.6 support. Python 3.6
# lacks importlib.resources and pep517 has issues loading files in
# a zip, so we fallback to the "old" method by adding the current
# pip directory to the child process's sys.path.
if sys.version_info < (3, 7):
pip_runnable = os.path.dirname(pip_location)
else:
pip_runnable = ctx.enter_context(_create_standalone_pip())
self._install_requirements(
pip_runnable,
finder,
requirements,
prefix,
message,
)
@staticmethod
def _install_requirements(
pip_runnable: str,
finder: "PackageFinder",
requirements: Iterable[str],
prefix: _Prefix,
message: str,
) -> None:
args = [
sys.executable, pip_runnable, 'install',
'--ignore-installed', '--no-user', '--prefix', prefix.path,
'--no-warn-script-location',
] # type: List[str]
if logger.getEffectiveLevel() <= logging.DEBUG:
args.append('-v')
for format_control in ('no_binary', 'only_binary'):
formats = getattr(finder.format_control, format_control)
args.extend(('--' + format_control.replace('_', '-'),
','.join(sorted(formats or {':none:'}))))
index_urls = finder.index_urls
if index_urls:
args.extend(['-i', index_urls[0]])
for extra_index in index_urls[1:]:
args.extend(['--extra-index-url', extra_index])
else:
args.append('--no-index')
for link in finder.find_links:
args.extend(['--find-links', link])
for host in finder.trusted_hosts:
args.extend(['--trusted-host', host])
if finder.allow_all_prereleases:
args.append('--pre')
if finder.prefer_binary:
args.append('--prefer-binary')
args.append('--')
args.extend(requirements)
extra_environ = {"_PIP_STANDALONE_CERT": where()}
with open_spinner(message) as spinner:
call_subprocess(args, spinner=spinner, extra_environ=extra_environ)
class NoOpBuildEnvironment(BuildEnvironment):
"""A no-op drop-in replacement for BuildEnvironment
"""
def __init__(self):
# type: () -> None
pass
def __enter__(self):
# type: () -> None
pass
def __exit__(
self,
exc_type, # type: Optional[Type[BaseException]]
exc_val, # type: Optional[BaseException]
exc_tb # type: Optional[TracebackType]
):
# type: (...) -> None
pass
def cleanup(self):
# type: () -> None
pass
def install_requirements(
self,
finder, # type: PackageFinder
requirements, # type: Iterable[str]
prefix_as_string, # type: str
message # type: str
):
# type: (...) -> None
raise NotImplementedError()

View File

@@ -1,287 +0,0 @@
"""Cache Management
"""
import hashlib
import json
import logging
import os
from typing import Any, Dict, List, Optional, Set
from pip._vendor.packaging.tags import Tag, interpreter_name, interpreter_version
from pip._vendor.packaging.utils import canonicalize_name
from pip._internal.exceptions import InvalidWheelFilename
from pip._internal.models.format_control import FormatControl
from pip._internal.models.link import Link
from pip._internal.models.wheel import Wheel
from pip._internal.utils.temp_dir import TempDirectory, tempdir_kinds
from pip._internal.utils.urls import path_to_url
logger = logging.getLogger(__name__)
def _hash_dict(d):
# type: (Dict[str, str]) -> str
"""Return a stable sha224 of a dictionary."""
s = json.dumps(d, sort_keys=True, separators=(",", ":"), ensure_ascii=True)
return hashlib.sha224(s.encode("ascii")).hexdigest()
class Cache:
"""An abstract class - provides cache directories for data from links
:param cache_dir: The root of the cache.
:param format_control: An object of FormatControl class to limit
binaries being read from the cache.
:param allowed_formats: which formats of files the cache should store.
('binary' and 'source' are the only allowed values)
"""
def __init__(self, cache_dir, format_control, allowed_formats):
# type: (str, FormatControl, Set[str]) -> None
super().__init__()
assert not cache_dir or os.path.isabs(cache_dir)
self.cache_dir = cache_dir or None
self.format_control = format_control
self.allowed_formats = allowed_formats
_valid_formats = {"source", "binary"}
assert self.allowed_formats.union(_valid_formats) == _valid_formats
def _get_cache_path_parts(self, link):
# type: (Link) -> List[str]
"""Get parts of part that must be os.path.joined with cache_dir
"""
# We want to generate an url to use as our cache key, we don't want to
# just re-use the URL because it might have other items in the fragment
# and we don't care about those.
key_parts = {"url": link.url_without_fragment}
if link.hash_name is not None and link.hash is not None:
key_parts[link.hash_name] = link.hash
if link.subdirectory_fragment:
key_parts["subdirectory"] = link.subdirectory_fragment
# Include interpreter name, major and minor version in cache key
# to cope with ill-behaved sdists that build a different wheel
# depending on the python version their setup.py is being run on,
# and don't encode the difference in compatibility tags.
# https://github.com/pypa/pip/issues/7296
key_parts["interpreter_name"] = interpreter_name()
key_parts["interpreter_version"] = interpreter_version()
# Encode our key url with sha224, we'll use this because it has similar
# security properties to sha256, but with a shorter total output (and
# thus less secure). However the differences don't make a lot of
# difference for our use case here.
hashed = _hash_dict(key_parts)
# We want to nest the directories some to prevent having a ton of top
# level directories where we might run out of sub directories on some
# FS.
parts = [hashed[:2], hashed[2:4], hashed[4:6], hashed[6:]]
return parts
def _get_candidates(self, link, canonical_package_name):
# type: (Link, str) -> List[Any]
can_not_cache = (
not self.cache_dir or
not canonical_package_name or
not link
)
if can_not_cache:
return []
formats = self.format_control.get_allowed_formats(
canonical_package_name
)
if not self.allowed_formats.intersection(formats):
return []
candidates = []
path = self.get_path_for_link(link)
if os.path.isdir(path):
for candidate in os.listdir(path):
candidates.append((candidate, path))
return candidates
def get_path_for_link(self, link):
# type: (Link) -> str
"""Return a directory to store cached items in for link.
"""
raise NotImplementedError()
def get(
self,
link, # type: Link
package_name, # type: Optional[str]
supported_tags, # type: List[Tag]
):
# type: (...) -> Link
"""Returns a link to a cached item if it exists, otherwise returns the
passed link.
"""
raise NotImplementedError()
class SimpleWheelCache(Cache):
"""A cache of wheels for future installs.
"""
def __init__(self, cache_dir, format_control):
# type: (str, FormatControl) -> None
super().__init__(cache_dir, format_control, {"binary"})
def get_path_for_link(self, link):
# type: (Link) -> str
"""Return a directory to store cached wheels for link
Because there are M wheels for any one sdist, we provide a directory
to cache them in, and then consult that directory when looking up
cache hits.
We only insert things into the cache if they have plausible version
numbers, so that we don't contaminate the cache with things that were
not unique. E.g. ./package might have dozens of installs done for it
and build a version of 0.0...and if we built and cached a wheel, we'd
end up using the same wheel even if the source has been edited.
:param link: The link of the sdist for which this will cache wheels.
"""
parts = self._get_cache_path_parts(link)
assert self.cache_dir
# Store wheels within the root cache_dir
return os.path.join(self.cache_dir, "wheels", *parts)
def get(
self,
link, # type: Link
package_name, # type: Optional[str]
supported_tags, # type: List[Tag]
):
# type: (...) -> Link
candidates = []
if not package_name:
return link
canonical_package_name = canonicalize_name(package_name)
for wheel_name, wheel_dir in self._get_candidates(
link, canonical_package_name
):
try:
wheel = Wheel(wheel_name)
except InvalidWheelFilename:
continue
if canonicalize_name(wheel.name) != canonical_package_name:
logger.debug(
"Ignoring cached wheel %s for %s as it "
"does not match the expected distribution name %s.",
wheel_name, link, package_name,
)
continue
if not wheel.supported(supported_tags):
# Built for a different python/arch/etc
continue
candidates.append(
(
wheel.support_index_min(supported_tags),
wheel_name,
wheel_dir,
)
)
if not candidates:
return link
_, wheel_name, wheel_dir = min(candidates)
return Link(path_to_url(os.path.join(wheel_dir, wheel_name)))
class EphemWheelCache(SimpleWheelCache):
"""A SimpleWheelCache that creates it's own temporary cache directory
"""
def __init__(self, format_control):
# type: (FormatControl) -> None
self._temp_dir = TempDirectory(
kind=tempdir_kinds.EPHEM_WHEEL_CACHE,
globally_managed=True,
)
super().__init__(self._temp_dir.path, format_control)
class CacheEntry:
def __init__(
self,
link, # type: Link
persistent, # type: bool
):
self.link = link
self.persistent = persistent
class WheelCache(Cache):
"""Wraps EphemWheelCache and SimpleWheelCache into a single Cache
This Cache allows for gracefully degradation, using the ephem wheel cache
when a certain link is not found in the simple wheel cache first.
"""
def __init__(self, cache_dir, format_control):
# type: (str, FormatControl) -> None
super().__init__(cache_dir, format_control, {'binary'})
self._wheel_cache = SimpleWheelCache(cache_dir, format_control)
self._ephem_cache = EphemWheelCache(format_control)
def get_path_for_link(self, link):
# type: (Link) -> str
return self._wheel_cache.get_path_for_link(link)
def get_ephem_path_for_link(self, link):
# type: (Link) -> str
return self._ephem_cache.get_path_for_link(link)
def get(
self,
link, # type: Link
package_name, # type: Optional[str]
supported_tags, # type: List[Tag]
):
# type: (...) -> Link
cache_entry = self.get_cache_entry(link, package_name, supported_tags)
if cache_entry is None:
return link
return cache_entry.link
def get_cache_entry(
self,
link, # type: Link
package_name, # type: Optional[str]
supported_tags, # type: List[Tag]
):
# type: (...) -> Optional[CacheEntry]
"""Returns a CacheEntry with a link to a cached item if it exists or
None. The cache entry indicates if the item was found in the persistent
or ephemeral cache.
"""
retval = self._wheel_cache.get(
link=link,
package_name=package_name,
supported_tags=supported_tags,
)
if retval is not link:
return CacheEntry(retval, persistent=True)
retval = self._ephem_cache.get(
link=link,
package_name=package_name,
supported_tags=supported_tags,
)
if retval is not link:
return CacheEntry(retval, persistent=False)
return None

View File

@@ -1,4 +0,0 @@
"""Subpackage containing all of pip's command line interface related code
"""
# This file intentionally does not import submodules

View File

@@ -1,163 +0,0 @@
"""Logic that powers autocompletion installed by ``pip completion``.
"""
import optparse
import os
import sys
from itertools import chain
from typing import Any, Iterable, List, Optional
from pip._internal.cli.main_parser import create_main_parser
from pip._internal.commands import commands_dict, create_command
from pip._internal.metadata import get_default_environment
def autocomplete() -> None:
"""Entry Point for completion of main and subcommand options."""
# Don't complete if user hasn't sourced bash_completion file.
if "PIP_AUTO_COMPLETE" not in os.environ:
return
cwords = os.environ["COMP_WORDS"].split()[1:]
cword = int(os.environ["COMP_CWORD"])
try:
current = cwords[cword - 1]
except IndexError:
current = ""
parser = create_main_parser()
subcommands = list(commands_dict)
options = []
# subcommand
subcommand_name: Optional[str] = None
for word in cwords:
if word in subcommands:
subcommand_name = word
break
# subcommand options
if subcommand_name is not None:
# special case: 'help' subcommand has no options
if subcommand_name == "help":
sys.exit(1)
# special case: list locally installed dists for show and uninstall
should_list_installed = not current.startswith("-") and subcommand_name in [
"show",
"uninstall",
]
if should_list_installed:
env = get_default_environment()
lc = current.lower()
installed = [
dist.canonical_name
for dist in env.iter_installed_distributions(local_only=True)
if dist.canonical_name.startswith(lc)
and dist.canonical_name not in cwords[1:]
]
# if there are no dists installed, fall back to option completion
if installed:
for dist in installed:
print(dist)
sys.exit(1)
subcommand = create_command(subcommand_name)
for opt in subcommand.parser.option_list_all:
if opt.help != optparse.SUPPRESS_HELP:
for opt_str in opt._long_opts + opt._short_opts:
options.append((opt_str, opt.nargs))
# filter out previously specified options from available options
prev_opts = [x.split("=")[0] for x in cwords[1 : cword - 1]]
options = [(x, v) for (x, v) in options if x not in prev_opts]
# filter options by current input
options = [(k, v) for k, v in options if k.startswith(current)]
# get completion type given cwords and available subcommand options
completion_type = get_path_completion_type(
cwords,
cword,
subcommand.parser.option_list_all,
)
# get completion files and directories if ``completion_type`` is
# ``<file>``, ``<dir>`` or ``<path>``
if completion_type:
paths = auto_complete_paths(current, completion_type)
options = [(path, 0) for path in paths]
for option in options:
opt_label = option[0]
# append '=' to options which require args
if option[1] and option[0][:2] == "--":
opt_label += "="
print(opt_label)
else:
# show main parser options only when necessary
opts = [i.option_list for i in parser.option_groups]
opts.append(parser.option_list)
flattened_opts = chain.from_iterable(opts)
if current.startswith("-"):
for opt in flattened_opts:
if opt.help != optparse.SUPPRESS_HELP:
subcommands += opt._long_opts + opt._short_opts
else:
# get completion type given cwords and all available options
completion_type = get_path_completion_type(cwords, cword, flattened_opts)
if completion_type:
subcommands = list(auto_complete_paths(current, completion_type))
print(" ".join([x for x in subcommands if x.startswith(current)]))
sys.exit(1)
def get_path_completion_type(
cwords: List[str], cword: int, opts: Iterable[Any]
) -> Optional[str]:
"""Get the type of path completion (``file``, ``dir``, ``path`` or None)
:param cwords: same as the environmental variable ``COMP_WORDS``
:param cword: same as the environmental variable ``COMP_CWORD``
:param opts: The available options to check
:return: path completion type (``file``, ``dir``, ``path`` or None)
"""
if cword < 2 or not cwords[cword - 2].startswith("-"):
return None
for opt in opts:
if opt.help == optparse.SUPPRESS_HELP:
continue
for o in str(opt).split("/"):
if cwords[cword - 2].split("=")[0] == o:
if not opt.metavar or any(
x in ("path", "file", "dir") for x in opt.metavar.split("/")
):
return opt.metavar
return None
def auto_complete_paths(current: str, completion_type: str) -> Iterable[str]:
"""If ``completion_type`` is ``file`` or ``path``, list all regular files
and directories starting with ``current``; otherwise only list directories
starting with ``current``.
:param current: The word to be completed
:param completion_type: path completion type(`file`, `path` or `dir`)i
:return: A generator of regular files and/or directories
"""
directory, filename = os.path.split(current)
current_path = os.path.abspath(directory)
# Don't complete paths if they can't be accessed
if not os.access(current_path, os.R_OK):
return
filename = os.path.normcase(filename)
# list all files that start with ``filename``
file_list = (
x for x in os.listdir(current_path) if os.path.normcase(x).startswith(filename)
)
for f in file_list:
opt = os.path.join(current_path, f)
comp_file = os.path.normcase(os.path.join(directory, f))
# complete regular files when there is not ``<dir>`` after option
# complete directories when there is ``<file>``, ``<path>`` or
# ``<dir>``after option
if completion_type != "dir" and os.path.isfile(opt):
yield comp_file
elif os.path.isdir(opt):
yield os.path.join(comp_file, "")

View File

@@ -1,214 +0,0 @@
"""Base Command class, and related routines"""
import logging
import logging.config
import optparse
import os
import sys
import traceback
from optparse import Values
from typing import Any, List, Optional, Tuple
from pip._internal.cli import cmdoptions
from pip._internal.cli.command_context import CommandContextMixIn
from pip._internal.cli.parser import ConfigOptionParser, UpdatingDefaultsHelpFormatter
from pip._internal.cli.status_codes import (
ERROR,
PREVIOUS_BUILD_DIR_ERROR,
UNKNOWN_ERROR,
VIRTUALENV_NOT_FOUND,
)
from pip._internal.exceptions import (
BadCommand,
CommandError,
InstallationError,
NetworkConnectionError,
PreviousBuildDirError,
UninstallationError,
)
from pip._internal.utils.deprecation import deprecated
from pip._internal.utils.filesystem import check_path_owner
from pip._internal.utils.logging import BrokenStdoutLoggingError, setup_logging
from pip._internal.utils.misc import get_prog, normalize_path
from pip._internal.utils.temp_dir import TempDirectoryTypeRegistry as TempDirRegistry
from pip._internal.utils.temp_dir import global_tempdir_manager, tempdir_registry
from pip._internal.utils.virtualenv import running_under_virtualenv
__all__ = ["Command"]
logger = logging.getLogger(__name__)
class Command(CommandContextMixIn):
usage: str = ""
ignore_require_venv: bool = False
def __init__(self, name: str, summary: str, isolated: bool = False) -> None:
super().__init__()
self.name = name
self.summary = summary
self.parser = ConfigOptionParser(
usage=self.usage,
prog=f"{get_prog()} {name}",
formatter=UpdatingDefaultsHelpFormatter(),
add_help_option=False,
name=name,
description=self.__doc__,
isolated=isolated,
)
self.tempdir_registry: Optional[TempDirRegistry] = None
# Commands should add options to this option group
optgroup_name = f"{self.name.capitalize()} Options"
self.cmd_opts = optparse.OptionGroup(self.parser, optgroup_name)
# Add the general options
gen_opts = cmdoptions.make_option_group(
cmdoptions.general_group,
self.parser,
)
self.parser.add_option_group(gen_opts)
self.add_options()
def add_options(self) -> None:
pass
def handle_pip_version_check(self, options: Values) -> None:
"""
This is a no-op so that commands by default do not do the pip version
check.
"""
# Make sure we do the pip version check if the index_group options
# are present.
assert not hasattr(options, "no_index")
def run(self, options: Values, args: List[Any]) -> int:
raise NotImplementedError
def parse_args(self, args: List[str]) -> Tuple[Any, Any]:
# factored out for testability
return self.parser.parse_args(args)
def main(self, args: List[str]) -> int:
try:
with self.main_context():
return self._main(args)
finally:
logging.shutdown()
def _main(self, args: List[str]) -> int:
# We must initialize this before the tempdir manager, otherwise the
# configuration would not be accessible by the time we clean up the
# tempdir manager.
self.tempdir_registry = self.enter_context(tempdir_registry())
# Intentionally set as early as possible so globally-managed temporary
# directories are available to the rest of the code.
self.enter_context(global_tempdir_manager())
options, args = self.parse_args(args)
# Set verbosity so that it can be used elsewhere.
self.verbosity = options.verbose - options.quiet
level_number = setup_logging(
verbosity=self.verbosity,
no_color=options.no_color,
user_log_file=options.log,
)
# TODO: Try to get these passing down from the command?
# without resorting to os.environ to hold these.
# This also affects isolated builds and it should.
if options.no_input:
os.environ["PIP_NO_INPUT"] = "1"
if options.exists_action:
os.environ["PIP_EXISTS_ACTION"] = " ".join(options.exists_action)
if options.require_venv and not self.ignore_require_venv:
# If a venv is required check if it can really be found
if not running_under_virtualenv():
logger.critical("Could not find an activated virtualenv (required).")
sys.exit(VIRTUALENV_NOT_FOUND)
if options.cache_dir:
options.cache_dir = normalize_path(options.cache_dir)
if not check_path_owner(options.cache_dir):
logger.warning(
"The directory '%s' or its parent directory is not owned "
"or is not writable by the current user. The cache "
"has been disabled. Check the permissions and owner of "
"that directory. If executing pip with sudo, you should "
"use sudo's -H flag.",
options.cache_dir,
)
options.cache_dir = None
if getattr(options, "build_dir", None):
deprecated(
reason=(
"The -b/--build/--build-dir/--build-directory "
"option is deprecated and has no effect anymore."
),
replacement=(
"use the TMPDIR/TEMP/TMP environment variable, "
"possibly combined with --no-clean"
),
gone_in="21.3",
issue=8333,
)
if "2020-resolver" in options.features_enabled:
logger.warning(
"--use-feature=2020-resolver no longer has any effect, "
"since it is now the default dependency resolver in pip. "
"This will become an error in pip 21.0."
)
try:
status = self.run(options, args)
assert isinstance(status, int)
return status
except PreviousBuildDirError as exc:
logger.critical(str(exc))
logger.debug("Exception information:", exc_info=True)
return PREVIOUS_BUILD_DIR_ERROR
except (
InstallationError,
UninstallationError,
BadCommand,
NetworkConnectionError,
) as exc:
logger.critical(str(exc))
logger.debug("Exception information:", exc_info=True)
return ERROR
except CommandError as exc:
logger.critical("%s", exc)
logger.debug("Exception information:", exc_info=True)
return ERROR
except BrokenStdoutLoggingError:
# Bypass our logger and write any remaining messages to stderr
# because stdout no longer works.
print("ERROR: Pipe to stdout was broken", file=sys.stderr)
if level_number <= logging.DEBUG:
traceback.print_exc(file=sys.stderr)
return ERROR
except KeyboardInterrupt:
logger.critical("Operation cancelled by user")
logger.debug("Exception information:", exc_info=True)
return ERROR
except BaseException:
logger.critical("Exception:", exc_info=True)
return UNKNOWN_ERROR
finally:
self.handle_pip_version_check(options)

View File

@@ -1,27 +0,0 @@
from contextlib import ExitStack, contextmanager
from typing import ContextManager, Iterator, TypeVar
_T = TypeVar("_T", covariant=True)
class CommandContextMixIn:
def __init__(self) -> None:
super().__init__()
self._in_main_context = False
self._main_context = ExitStack()
@contextmanager
def main_context(self) -> Iterator[None]:
assert not self._in_main_context
self._in_main_context = True
try:
with self._main_context:
yield
finally:
self._in_main_context = False
def enter_context(self, context_provider: ContextManager[_T]) -> _T:
assert self._in_main_context
return self._main_context.enter_context(context_provider)

View File

@@ -1,70 +0,0 @@
"""Primary application entrypoint.
"""
import locale
import logging
import os
import sys
from typing import List, Optional
from pip._internal.cli.autocompletion import autocomplete
from pip._internal.cli.main_parser import parse_command
from pip._internal.commands import create_command
from pip._internal.exceptions import PipError
from pip._internal.utils import deprecation
logger = logging.getLogger(__name__)
# Do not import and use main() directly! Using it directly is actively
# discouraged by pip's maintainers. The name, location and behavior of
# this function is subject to change, so calling it directly is not
# portable across different pip versions.
# In addition, running pip in-process is unsupported and unsafe. This is
# elaborated in detail at
# https://pip.pypa.io/en/stable/user_guide/#using-pip-from-your-program.
# That document also provides suggestions that should work for nearly
# all users that are considering importing and using main() directly.
# However, we know that certain users will still want to invoke pip
# in-process. If you understand and accept the implications of using pip
# in an unsupported manner, the best approach is to use runpy to avoid
# depending on the exact location of this entry point.
# The following example shows how to use runpy to invoke pip in that
# case:
#
# sys.argv = ["pip", your, args, here]
# runpy.run_module("pip", run_name="__main__")
#
# Note that this will exit the process after running, unlike a direct
# call to main. As it is not safe to do any processing after calling
# main, this should not be an issue in practice.
def main(args: Optional[List[str]] = None) -> int:
if args is None:
args = sys.argv[1:]
# Configure our deprecation warnings to be sent through loggers
deprecation.install_warning_logger()
autocomplete()
try:
cmd_name, cmd_args = parse_command(args)
except PipError as exc:
sys.stderr.write(f"ERROR: {exc}")
sys.stderr.write(os.linesep)
sys.exit(1)
# Needed for locale.getpreferredencoding(False) to work
# in pip._internal.utils.encoding.auto_decode
try:
locale.setlocale(locale.LC_ALL, "")
except locale.Error as e:
# setlocale can apparently crash if locale are uninitialized
logger.debug("Ignoring error %s when setting locale", e)
command = create_command(cmd_name, isolated=("--isolated" in cmd_args))
return command.main(cmd_args)

View File

@@ -1,87 +0,0 @@
"""A single place for constructing and exposing the main parser
"""
import os
import sys
from typing import List, Tuple
from pip._internal.cli import cmdoptions
from pip._internal.cli.parser import ConfigOptionParser, UpdatingDefaultsHelpFormatter
from pip._internal.commands import commands_dict, get_similar_commands
from pip._internal.exceptions import CommandError
from pip._internal.utils.misc import get_pip_version, get_prog
__all__ = ["create_main_parser", "parse_command"]
def create_main_parser() -> ConfigOptionParser:
"""Creates and returns the main parser for pip's CLI"""
parser = ConfigOptionParser(
usage="\n%prog <command> [options]",
add_help_option=False,
formatter=UpdatingDefaultsHelpFormatter(),
name="global",
prog=get_prog(),
)
parser.disable_interspersed_args()
parser.version = get_pip_version()
# add the general options
gen_opts = cmdoptions.make_option_group(cmdoptions.general_group, parser)
parser.add_option_group(gen_opts)
# so the help formatter knows
parser.main = True # type: ignore
# create command listing for description
description = [""] + [
f"{name:27} {command_info.summary}"
for name, command_info in commands_dict.items()
]
parser.description = "\n".join(description)
return parser
def parse_command(args: List[str]) -> Tuple[str, List[str]]:
parser = create_main_parser()
# Note: parser calls disable_interspersed_args(), so the result of this
# call is to split the initial args into the general options before the
# subcommand and everything else.
# For example:
# args: ['--timeout=5', 'install', '--user', 'INITools']
# general_options: ['--timeout==5']
# args_else: ['install', '--user', 'INITools']
general_options, args_else = parser.parse_args(args)
# --version
if general_options.version:
sys.stdout.write(parser.version)
sys.stdout.write(os.linesep)
sys.exit()
# pip || pip help -> print_help()
if not args_else or (args_else[0] == "help" and len(args_else) == 1):
parser.print_help()
sys.exit()
# the subcommand name
cmd_name = args_else[0]
if cmd_name not in commands_dict:
guess = get_similar_commands(cmd_name)
msg = [f'unknown command "{cmd_name}"']
if guess:
msg.append(f'maybe you meant "{guess}"')
raise CommandError(" - ".join(msg))
# all the args without the subcommand
cmd_args = args[:]
cmd_args.remove(cmd_name)
return cmd_name, cmd_args

View File

@@ -1,292 +0,0 @@
"""Base option parser setup"""
import logging
import optparse
import shutil
import sys
import textwrap
from contextlib import suppress
from typing import Any, Dict, Iterator, List, Tuple
from pip._internal.cli.status_codes import UNKNOWN_ERROR
from pip._internal.configuration import Configuration, ConfigurationError
from pip._internal.utils.misc import redact_auth_from_url, strtobool
logger = logging.getLogger(__name__)
class PrettyHelpFormatter(optparse.IndentedHelpFormatter):
"""A prettier/less verbose help formatter for optparse."""
def __init__(self, *args: Any, **kwargs: Any) -> None:
# help position must be aligned with __init__.parseopts.description
kwargs["max_help_position"] = 30
kwargs["indent_increment"] = 1
kwargs["width"] = shutil.get_terminal_size()[0] - 2
super().__init__(*args, **kwargs)
def format_option_strings(self, option: optparse.Option) -> str:
return self._format_option_strings(option)
def _format_option_strings(
self, option: optparse.Option, mvarfmt: str = " <{}>", optsep: str = ", "
) -> str:
"""
Return a comma-separated list of option strings and metavars.
:param option: tuple of (short opt, long opt), e.g: ('-f', '--format')
:param mvarfmt: metavar format string
:param optsep: separator
"""
opts = []
if option._short_opts:
opts.append(option._short_opts[0])
if option._long_opts:
opts.append(option._long_opts[0])
if len(opts) > 1:
opts.insert(1, optsep)
if option.takes_value():
assert option.dest is not None
metavar = option.metavar or option.dest.lower()
opts.append(mvarfmt.format(metavar.lower()))
return "".join(opts)
def format_heading(self, heading: str) -> str:
if heading == "Options":
return ""
return heading + ":\n"
def format_usage(self, usage: str) -> str:
"""
Ensure there is only one newline between usage and the first heading
if there is no description.
"""
msg = "\nUsage: {}\n".format(self.indent_lines(textwrap.dedent(usage), " "))
return msg
def format_description(self, description: str) -> str:
# leave full control over description to us
if description:
if hasattr(self.parser, "main"):
label = "Commands"
else:
label = "Description"
# some doc strings have initial newlines, some don't
description = description.lstrip("\n")
# some doc strings have final newlines and spaces, some don't
description = description.rstrip()
# dedent, then reindent
description = self.indent_lines(textwrap.dedent(description), " ")
description = f"{label}:\n{description}\n"
return description
else:
return ""
def format_epilog(self, epilog: str) -> str:
# leave full control over epilog to us
if epilog:
return epilog
else:
return ""
def indent_lines(self, text: str, indent: str) -> str:
new_lines = [indent + line for line in text.split("\n")]
return "\n".join(new_lines)
class UpdatingDefaultsHelpFormatter(PrettyHelpFormatter):
"""Custom help formatter for use in ConfigOptionParser.
This is updates the defaults before expanding them, allowing
them to show up correctly in the help listing.
Also redact auth from url type options
"""
def expand_default(self, option: optparse.Option) -> str:
default_values = None
if self.parser is not None:
assert isinstance(self.parser, ConfigOptionParser)
self.parser._update_defaults(self.parser.defaults)
assert option.dest is not None
default_values = self.parser.defaults.get(option.dest)
help_text = super().expand_default(option)
if default_values and option.metavar == "URL":
if isinstance(default_values, str):
default_values = [default_values]
# If its not a list, we should abort and just return the help text
if not isinstance(default_values, list):
default_values = []
for val in default_values:
help_text = help_text.replace(val, redact_auth_from_url(val))
return help_text
class CustomOptionParser(optparse.OptionParser):
def insert_option_group(
self, idx: int, *args: Any, **kwargs: Any
) -> optparse.OptionGroup:
"""Insert an OptionGroup at a given position."""
group = self.add_option_group(*args, **kwargs)
self.option_groups.pop()
self.option_groups.insert(idx, group)
return group
@property
def option_list_all(self) -> List[optparse.Option]:
"""Get a list of all options, including those in option groups."""
res = self.option_list[:]
for i in self.option_groups:
res.extend(i.option_list)
return res
class ConfigOptionParser(CustomOptionParser):
"""Custom option parser which updates its defaults by checking the
configuration files and environmental variables"""
def __init__(
self,
*args: Any,
name: str,
isolated: bool = False,
**kwargs: Any,
) -> None:
self.name = name
self.config = Configuration(isolated)
assert self.name
super().__init__(*args, **kwargs)
def check_default(self, option: optparse.Option, key: str, val: Any) -> Any:
try:
return option.check_value(key, val)
except optparse.OptionValueError as exc:
print(f"An error occurred during configuration: {exc}")
sys.exit(3)
def _get_ordered_configuration_items(self) -> Iterator[Tuple[str, Any]]:
# Configuration gives keys in an unordered manner. Order them.
override_order = ["global", self.name, ":env:"]
# Pool the options into different groups
section_items: Dict[str, List[Tuple[str, Any]]] = {
name: [] for name in override_order
}
for section_key, val in self.config.items():
# ignore empty values
if not val:
logger.debug(
"Ignoring configuration key '%s' as it's value is empty.",
section_key,
)
continue
section, key = section_key.split(".", 1)
if section in override_order:
section_items[section].append((key, val))
# Yield each group in their override order
for section in override_order:
for key, val in section_items[section]:
yield key, val
def _update_defaults(self, defaults: Dict[str, Any]) -> Dict[str, Any]:
"""Updates the given defaults with values from the config files and
the environ. Does a little special handling for certain types of
options (lists)."""
# Accumulate complex default state.
self.values = optparse.Values(self.defaults)
late_eval = set()
# Then set the options with those values
for key, val in self._get_ordered_configuration_items():
# '--' because configuration supports only long names
option = self.get_option("--" + key)
# Ignore options not present in this parser. E.g. non-globals put
# in [global] by users that want them to apply to all applicable
# commands.
if option is None:
continue
assert option.dest is not None
if option.action in ("store_true", "store_false"):
try:
val = strtobool(val)
except ValueError:
self.error(
"{} is not a valid value for {} option, " # noqa
"please specify a boolean value like yes/no, "
"true/false or 1/0 instead.".format(val, key)
)
elif option.action == "count":
with suppress(ValueError):
val = strtobool(val)
with suppress(ValueError):
val = int(val)
if not isinstance(val, int) or val < 0:
self.error(
"{} is not a valid value for {} option, " # noqa
"please instead specify either a non-negative integer "
"or a boolean value like yes/no or false/true "
"which is equivalent to 1/0.".format(val, key)
)
elif option.action == "append":
val = val.split()
val = [self.check_default(option, key, v) for v in val]
elif option.action == "callback":
assert option.callback is not None
late_eval.add(option.dest)
opt_str = option.get_opt_string()
val = option.convert_value(opt_str, val)
# From take_action
args = option.callback_args or ()
kwargs = option.callback_kwargs or {}
option.callback(option, opt_str, val, self, *args, **kwargs)
else:
val = self.check_default(option, key, val)
defaults[option.dest] = val
for key in late_eval:
defaults[key] = getattr(self.values, key)
self.values = None
return defaults
def get_default_values(self) -> optparse.Values:
"""Overriding to make updating the defaults after instantiation of
the option parser possible, _update_defaults() does the dirty work."""
if not self.process_default_values:
# Old, pre-Optik 1.5 behaviour.
return optparse.Values(self.defaults)
# Load the configuration, or error out in case of an error
try:
self.config.load()
except ConfigurationError as err:
self.exit(UNKNOWN_ERROR, str(err))
defaults = self._update_defaults(self.defaults.copy()) # ours
for option in self._get_all_options():
assert option.dest is not None
default = defaults.get(option.dest)
if isinstance(default, str):
opt_str = option.get_opt_string()
defaults[option.dest] = option.check_value(opt_str, default)
return optparse.Values(defaults)
def error(self, msg: str) -> None:
self.print_usage(sys.stderr)
self.exit(UNKNOWN_ERROR, f"{msg}\n")

View File

@@ -1,250 +0,0 @@
import itertools
import sys
from signal import SIGINT, default_int_handler, signal
from typing import Any
from pip._vendor.progress.bar import Bar, FillingCirclesBar, IncrementalBar
from pip._vendor.progress.spinner import Spinner
from pip._internal.utils.compat import WINDOWS
from pip._internal.utils.logging import get_indentation
from pip._internal.utils.misc import format_size
try:
from pip._vendor import colorama
# Lots of different errors can come from this, including SystemError and
# ImportError.
except Exception:
colorama = None
def _select_progress_class(preferred: Bar, fallback: Bar) -> Bar:
encoding = getattr(preferred.file, "encoding", None)
# If we don't know what encoding this file is in, then we'll just assume
# that it doesn't support unicode and use the ASCII bar.
if not encoding:
return fallback
# Collect all of the possible characters we want to use with the preferred
# bar.
characters = [
getattr(preferred, "empty_fill", ""),
getattr(preferred, "fill", ""),
]
characters += list(getattr(preferred, "phases", []))
# Try to decode the characters we're using for the bar using the encoding
# of the given file, if this works then we'll assume that we can use the
# fancier bar and if not we'll fall back to the plaintext bar.
try:
"".join(characters).encode(encoding)
except UnicodeEncodeError:
return fallback
else:
return preferred
_BaseBar: Any = _select_progress_class(IncrementalBar, Bar)
class InterruptibleMixin:
"""
Helper to ensure that self.finish() gets called on keyboard interrupt.
This allows downloads to be interrupted without leaving temporary state
(like hidden cursors) behind.
This class is similar to the progress library's existing SigIntMixin
helper, but as of version 1.2, that helper has the following problems:
1. It calls sys.exit().
2. It discards the existing SIGINT handler completely.
3. It leaves its own handler in place even after an uninterrupted finish,
which will have unexpected delayed effects if the user triggers an
unrelated keyboard interrupt some time after a progress-displaying
download has already completed, for example.
"""
def __init__(self, *args: Any, **kwargs: Any) -> None:
"""
Save the original SIGINT handler for later.
"""
# https://github.com/python/mypy/issues/5887
super().__init__(*args, **kwargs) # type: ignore
self.original_handler = signal(SIGINT, self.handle_sigint)
# If signal() returns None, the previous handler was not installed from
# Python, and we cannot restore it. This probably should not happen,
# but if it does, we must restore something sensible instead, at least.
# The least bad option should be Python's default SIGINT handler, which
# just raises KeyboardInterrupt.
if self.original_handler is None:
self.original_handler = default_int_handler
def finish(self) -> None:
"""
Restore the original SIGINT handler after finishing.
This should happen regardless of whether the progress display finishes
normally, or gets interrupted.
"""
super().finish() # type: ignore
signal(SIGINT, self.original_handler)
def handle_sigint(self, signum, frame): # type: ignore
"""
Call self.finish() before delegating to the original SIGINT handler.
This handler should only be in place while the progress display is
active.
"""
self.finish()
self.original_handler(signum, frame)
class SilentBar(Bar):
def update(self) -> None:
pass
class BlueEmojiBar(IncrementalBar):
suffix = "%(percent)d%%"
bar_prefix = " "
bar_suffix = " "
phases = ("\U0001F539", "\U0001F537", "\U0001F535")
class DownloadProgressMixin:
def __init__(self, *args: Any, **kwargs: Any) -> None:
# https://github.com/python/mypy/issues/5887
super().__init__(*args, **kwargs) # type: ignore
self.message: str = (" " * (get_indentation() + 2)) + self.message
@property
def downloaded(self) -> str:
return format_size(self.index) # type: ignore
@property
def download_speed(self) -> str:
# Avoid zero division errors...
if self.avg == 0.0: # type: ignore
return "..."
return format_size(1 / self.avg) + "/s" # type: ignore
@property
def pretty_eta(self) -> str:
if self.eta: # type: ignore
return f"eta {self.eta_td}" # type: ignore
return ""
def iter(self, it): # type: ignore
for x in it:
yield x
# B305 is incorrectly raised here
# https://github.com/PyCQA/flake8-bugbear/issues/59
self.next(len(x)) # noqa: B305
self.finish()
class WindowsMixin:
def __init__(self, *args: Any, **kwargs: Any) -> None:
# The Windows terminal does not support the hide/show cursor ANSI codes
# even with colorama. So we'll ensure that hide_cursor is False on
# Windows.
# This call needs to go before the super() call, so that hide_cursor
# is set in time. The base progress bar class writes the "hide cursor"
# code to the terminal in its init, so if we don't set this soon
# enough, we get a "hide" with no corresponding "show"...
if WINDOWS and self.hide_cursor: # type: ignore
self.hide_cursor = False
# https://github.com/python/mypy/issues/5887
super().__init__(*args, **kwargs) # type: ignore
# Check if we are running on Windows and we have the colorama module,
# if we do then wrap our file with it.
if WINDOWS and colorama:
self.file = colorama.AnsiToWin32(self.file) # type: ignore
# The progress code expects to be able to call self.file.isatty()
# but the colorama.AnsiToWin32() object doesn't have that, so we'll
# add it.
self.file.isatty = lambda: self.file.wrapped.isatty()
# The progress code expects to be able to call self.file.flush()
# but the colorama.AnsiToWin32() object doesn't have that, so we'll
# add it.
self.file.flush = lambda: self.file.wrapped.flush()
class BaseDownloadProgressBar(WindowsMixin, InterruptibleMixin, DownloadProgressMixin):
file = sys.stdout
message = "%(percent)d%%"
suffix = "%(downloaded)s %(download_speed)s %(pretty_eta)s"
class DefaultDownloadProgressBar(BaseDownloadProgressBar, _BaseBar):
pass
class DownloadSilentBar(BaseDownloadProgressBar, SilentBar):
pass
class DownloadBar(BaseDownloadProgressBar, Bar):
pass
class DownloadFillingCirclesBar(BaseDownloadProgressBar, FillingCirclesBar):
pass
class DownloadBlueEmojiProgressBar(BaseDownloadProgressBar, BlueEmojiBar):
pass
class DownloadProgressSpinner(
WindowsMixin, InterruptibleMixin, DownloadProgressMixin, Spinner
):
file = sys.stdout
suffix = "%(downloaded)s %(download_speed)s"
def next_phase(self) -> str:
if not hasattr(self, "_phaser"):
self._phaser = itertools.cycle(self.phases)
return next(self._phaser)
def update(self) -> None:
message = self.message % self
phase = self.next_phase()
suffix = self.suffix % self
line = "".join(
[
message,
" " if message else "",
phase,
" " if suffix else "",
suffix,
]
)
self.writeln(line)
BAR_TYPES = {
"off": (DownloadSilentBar, DownloadSilentBar),
"on": (DefaultDownloadProgressBar, DownloadProgressSpinner),
"ascii": (DownloadBar, DownloadProgressSpinner),
"pretty": (DownloadFillingCirclesBar, DownloadProgressSpinner),
"emoji": (DownloadBlueEmojiProgressBar, DownloadProgressSpinner),
}
def DownloadProgressProvider(progress_bar, max=None): # type: ignore
if max is None or max == 0:
return BAR_TYPES[progress_bar][1]().iter
else:
return BAR_TYPES[progress_bar][0](max=max).iter

View File

@@ -1,453 +0,0 @@
"""Contains the Command base classes that depend on PipSession.
The classes in this module are in a separate module so the commands not
needing download / PackageFinder capability don't unnecessarily import the
PackageFinder machinery and all its vendored dependencies, etc.
"""
import logging
import os
import sys
from functools import partial
from optparse import Values
from typing import Any, List, Optional, Tuple
from pip._internal.cache import WheelCache
from pip._internal.cli import cmdoptions
from pip._internal.cli.base_command import Command
from pip._internal.cli.command_context import CommandContextMixIn
from pip._internal.exceptions import CommandError, PreviousBuildDirError
from pip._internal.index.collector import LinkCollector
from pip._internal.index.package_finder import PackageFinder
from pip._internal.models.selection_prefs import SelectionPreferences
from pip._internal.models.target_python import TargetPython
from pip._internal.network.session import PipSession
from pip._internal.operations.prepare import RequirementPreparer
from pip._internal.req.constructors import (
install_req_from_editable,
install_req_from_line,
install_req_from_parsed_requirement,
install_req_from_req_string,
)
from pip._internal.req.req_file import parse_requirements
from pip._internal.req.req_install import InstallRequirement
from pip._internal.req.req_tracker import RequirementTracker
from pip._internal.resolution.base import BaseResolver
from pip._internal.self_outdated_check import pip_self_version_check
from pip._internal.utils.temp_dir import (
TempDirectory,
TempDirectoryTypeRegistry,
tempdir_kinds,
)
from pip._internal.utils.virtualenv import running_under_virtualenv
logger = logging.getLogger(__name__)
class SessionCommandMixin(CommandContextMixIn):
"""
A class mixin for command classes needing _build_session().
"""
def __init__(self) -> None:
super().__init__()
self._session: Optional[PipSession] = None
@classmethod
def _get_index_urls(cls, options: Values) -> Optional[List[str]]:
"""Return a list of index urls from user-provided options."""
index_urls = []
if not getattr(options, "no_index", False):
url = getattr(options, "index_url", None)
if url:
index_urls.append(url)
urls = getattr(options, "extra_index_urls", None)
if urls:
index_urls.extend(urls)
# Return None rather than an empty list
return index_urls or None
def get_default_session(self, options: Values) -> PipSession:
"""Get a default-managed session."""
if self._session is None:
self._session = self.enter_context(self._build_session(options))
# there's no type annotation on requests.Session, so it's
# automatically ContextManager[Any] and self._session becomes Any,
# then https://github.com/python/mypy/issues/7696 kicks in
assert self._session is not None
return self._session
def _build_session(
self,
options: Values,
retries: Optional[int] = None,
timeout: Optional[int] = None,
) -> PipSession:
assert not options.cache_dir or os.path.isabs(options.cache_dir)
session = PipSession(
cache=(
os.path.join(options.cache_dir, "http") if options.cache_dir else None
),
retries=retries if retries is not None else options.retries,
trusted_hosts=options.trusted_hosts,
index_urls=self._get_index_urls(options),
)
# Handle custom ca-bundles from the user
if options.cert:
session.verify = options.cert
# Handle SSL client certificate
if options.client_cert:
session.cert = options.client_cert
# Handle timeouts
if options.timeout or timeout:
session.timeout = timeout if timeout is not None else options.timeout
# Handle configured proxies
if options.proxy:
session.proxies = {
"http": options.proxy,
"https": options.proxy,
}
# Determine if we can prompt the user for authentication or not
session.auth.prompting = not options.no_input
return session
class IndexGroupCommand(Command, SessionCommandMixin):
"""
Abstract base class for commands with the index_group options.
This also corresponds to the commands that permit the pip version check.
"""
def handle_pip_version_check(self, options: Values) -> None:
"""
Do the pip version check if not disabled.
This overrides the default behavior of not doing the check.
"""
# Make sure the index_group options are present.
assert hasattr(options, "no_index")
if options.disable_pip_version_check or options.no_index:
return
# Otherwise, check if we're using the latest version of pip available.
session = self._build_session(
options, retries=0, timeout=min(5, options.timeout)
)
with session:
pip_self_version_check(session, options)
KEEPABLE_TEMPDIR_TYPES = [
tempdir_kinds.BUILD_ENV,
tempdir_kinds.EPHEM_WHEEL_CACHE,
tempdir_kinds.REQ_BUILD,
]
def warn_if_run_as_root() -> None:
"""Output a warning for sudo users on Unix.
In a virtual environment, sudo pip still writes to virtualenv.
On Windows, users may run pip as Administrator without issues.
This warning only applies to Unix root users outside of virtualenv.
"""
if running_under_virtualenv():
return
if not hasattr(os, "getuid"):
return
# On Windows, there are no "system managed" Python packages. Installing as
# Administrator via pip is the correct way of updating system environments.
#
# We choose sys.platform over utils.compat.WINDOWS here to enable Mypy platform
# checks: https://mypy.readthedocs.io/en/stable/common_issues.html
if sys.platform == "win32" or sys.platform == "cygwin":
return
if sys.platform == "darwin" or sys.platform == "linux":
if os.getuid() != 0:
return
logger.warning(
"Running pip as the 'root' user can result in broken permissions and "
"conflicting behaviour with the system package manager. "
"It is recommended to use a virtual environment instead: "
"https://pip.pypa.io/warnings/venv"
)
def with_cleanup(func: Any) -> Any:
"""Decorator for common logic related to managing temporary
directories.
"""
def configure_tempdir_registry(registry: TempDirectoryTypeRegistry) -> None:
for t in KEEPABLE_TEMPDIR_TYPES:
registry.set_delete(t, False)
def wrapper(
self: RequirementCommand, options: Values, args: List[Any]
) -> Optional[int]:
assert self.tempdir_registry is not None
if options.no_clean:
configure_tempdir_registry(self.tempdir_registry)
try:
return func(self, options, args)
except PreviousBuildDirError:
# This kind of conflict can occur when the user passes an explicit
# build directory with a pre-existing folder. In that case we do
# not want to accidentally remove it.
configure_tempdir_registry(self.tempdir_registry)
raise
return wrapper
class RequirementCommand(IndexGroupCommand):
def __init__(self, *args: Any, **kw: Any) -> None:
super().__init__(*args, **kw)
self.cmd_opts.add_option(cmdoptions.no_clean())
@staticmethod
def determine_resolver_variant(options: Values) -> str:
"""Determines which resolver should be used, based on the given options."""
if "legacy-resolver" in options.deprecated_features_enabled:
return "legacy"
return "2020-resolver"
@classmethod
def make_requirement_preparer(
cls,
temp_build_dir: TempDirectory,
options: Values,
req_tracker: RequirementTracker,
session: PipSession,
finder: PackageFinder,
use_user_site: bool,
download_dir: Optional[str] = None,
) -> RequirementPreparer:
"""
Create a RequirementPreparer instance for the given parameters.
"""
temp_build_dir_path = temp_build_dir.path
assert temp_build_dir_path is not None
resolver_variant = cls.determine_resolver_variant(options)
if resolver_variant == "2020-resolver":
lazy_wheel = "fast-deps" in options.features_enabled
if lazy_wheel:
logger.warning(
"pip is using lazily downloaded wheels using HTTP "
"range requests to obtain dependency information. "
"This experimental feature is enabled through "
"--use-feature=fast-deps and it is not ready for "
"production."
)
else:
lazy_wheel = False
if "fast-deps" in options.features_enabled:
logger.warning(
"fast-deps has no effect when used with the legacy resolver."
)
return RequirementPreparer(
build_dir=temp_build_dir_path,
src_dir=options.src_dir,
download_dir=download_dir,
build_isolation=options.build_isolation,
req_tracker=req_tracker,
session=session,
progress_bar=options.progress_bar,
finder=finder,
require_hashes=options.require_hashes,
use_user_site=use_user_site,
lazy_wheel=lazy_wheel,
in_tree_build="in-tree-build" in options.features_enabled,
)
@classmethod
def make_resolver(
cls,
preparer: RequirementPreparer,
finder: PackageFinder,
options: Values,
wheel_cache: Optional[WheelCache] = None,
use_user_site: bool = False,
ignore_installed: bool = True,
ignore_requires_python: bool = False,
force_reinstall: bool = False,
upgrade_strategy: str = "to-satisfy-only",
use_pep517: Optional[bool] = None,
py_version_info: Optional[Tuple[int, ...]] = None,
) -> BaseResolver:
"""
Create a Resolver instance for the given parameters.
"""
make_install_req = partial(
install_req_from_req_string,
isolated=options.isolated_mode,
use_pep517=use_pep517,
)
resolver_variant = cls.determine_resolver_variant(options)
# The long import name and duplicated invocation is needed to convince
# Mypy into correctly typechecking. Otherwise it would complain the
# "Resolver" class being redefined.
if resolver_variant == "2020-resolver":
import pip._internal.resolution.resolvelib.resolver
return pip._internal.resolution.resolvelib.resolver.Resolver(
preparer=preparer,
finder=finder,
wheel_cache=wheel_cache,
make_install_req=make_install_req,
use_user_site=use_user_site,
ignore_dependencies=options.ignore_dependencies,
ignore_installed=ignore_installed,
ignore_requires_python=ignore_requires_python,
force_reinstall=force_reinstall,
upgrade_strategy=upgrade_strategy,
py_version_info=py_version_info,
)
import pip._internal.resolution.legacy.resolver
return pip._internal.resolution.legacy.resolver.Resolver(
preparer=preparer,
finder=finder,
wheel_cache=wheel_cache,
make_install_req=make_install_req,
use_user_site=use_user_site,
ignore_dependencies=options.ignore_dependencies,
ignore_installed=ignore_installed,
ignore_requires_python=ignore_requires_python,
force_reinstall=force_reinstall,
upgrade_strategy=upgrade_strategy,
py_version_info=py_version_info,
)
def get_requirements(
self,
args: List[str],
options: Values,
finder: PackageFinder,
session: PipSession,
) -> List[InstallRequirement]:
"""
Parse command-line arguments into the corresponding requirements.
"""
requirements: List[InstallRequirement] = []
for filename in options.constraints:
for parsed_req in parse_requirements(
filename,
constraint=True,
finder=finder,
options=options,
session=session,
):
req_to_add = install_req_from_parsed_requirement(
parsed_req,
isolated=options.isolated_mode,
user_supplied=False,
)
requirements.append(req_to_add)
for req in args:
req_to_add = install_req_from_line(
req,
None,
isolated=options.isolated_mode,
use_pep517=options.use_pep517,
user_supplied=True,
)
requirements.append(req_to_add)
for req in options.editables:
req_to_add = install_req_from_editable(
req,
user_supplied=True,
isolated=options.isolated_mode,
use_pep517=options.use_pep517,
)
requirements.append(req_to_add)
# NOTE: options.require_hashes may be set if --require-hashes is True
for filename in options.requirements:
for parsed_req in parse_requirements(
filename, finder=finder, options=options, session=session
):
req_to_add = install_req_from_parsed_requirement(
parsed_req,
isolated=options.isolated_mode,
use_pep517=options.use_pep517,
user_supplied=True,
)
requirements.append(req_to_add)
# If any requirement has hash options, enable hash checking.
if any(req.has_hash_options for req in requirements):
options.require_hashes = True
if not (args or options.editables or options.requirements):
opts = {"name": self.name}
if options.find_links:
raise CommandError(
"You must give at least one requirement to {name} "
'(maybe you meant "pip {name} {links}"?)'.format(
**dict(opts, links=" ".join(options.find_links))
)
)
else:
raise CommandError(
"You must give at least one requirement to {name} "
'(see "pip help {name}")'.format(**opts)
)
return requirements
@staticmethod
def trace_basic_info(finder: PackageFinder) -> None:
"""
Trace basic information about the provided objects.
"""
# Display where finder is looking for packages
search_scope = finder.search_scope
locations = search_scope.get_formatted_locations()
if locations:
logger.info(locations)
def _build_package_finder(
self,
options: Values,
session: PipSession,
target_python: Optional[TargetPython] = None,
ignore_requires_python: Optional[bool] = None,
) -> PackageFinder:
"""
Create a package finder appropriate to this requirement command.
:param ignore_requires_python: Whether to ignore incompatible
"Requires-Python" values in links. Defaults to False.
"""
link_collector = LinkCollector.create(session, options=options)
selection_prefs = SelectionPreferences(
allow_yanked=True,
format_control=options.format_control,
allow_all_prereleases=options.pre,
prefer_binary=options.prefer_binary,
ignore_requires_python=ignore_requires_python,
)
return PackageFinder.create(
link_collector=link_collector,
selection_prefs=selection_prefs,
target_python=target_python,
)

View File

@@ -1,157 +0,0 @@
import contextlib
import itertools
import logging
import sys
import time
from typing import IO, Iterator
from pip._vendor.progress import HIDE_CURSOR, SHOW_CURSOR
from pip._internal.utils.compat import WINDOWS
from pip._internal.utils.logging import get_indentation
logger = logging.getLogger(__name__)
class SpinnerInterface:
def spin(self) -> None:
raise NotImplementedError()
def finish(self, final_status: str) -> None:
raise NotImplementedError()
class InteractiveSpinner(SpinnerInterface):
def __init__(
self,
message: str,
file: IO[str] = None,
spin_chars: str = "-\\|/",
# Empirically, 8 updates/second looks nice
min_update_interval_seconds: float = 0.125,
):
self._message = message
if file is None:
file = sys.stdout
self._file = file
self._rate_limiter = RateLimiter(min_update_interval_seconds)
self._finished = False
self._spin_cycle = itertools.cycle(spin_chars)
self._file.write(" " * get_indentation() + self._message + " ... ")
self._width = 0
def _write(self, status: str) -> None:
assert not self._finished
# Erase what we wrote before by backspacing to the beginning, writing
# spaces to overwrite the old text, and then backspacing again
backup = "\b" * self._width
self._file.write(backup + " " * self._width + backup)
# Now we have a blank slate to add our status
self._file.write(status)
self._width = len(status)
self._file.flush()
self._rate_limiter.reset()
def spin(self) -> None:
if self._finished:
return
if not self._rate_limiter.ready():
return
self._write(next(self._spin_cycle))
def finish(self, final_status: str) -> None:
if self._finished:
return
self._write(final_status)
self._file.write("\n")
self._file.flush()
self._finished = True
# Used for dumb terminals, non-interactive installs (no tty), etc.
# We still print updates occasionally (once every 60 seconds by default) to
# act as a keep-alive for systems like Travis-CI that take lack-of-output as
# an indication that a task has frozen.
class NonInteractiveSpinner(SpinnerInterface):
def __init__(self, message: str, min_update_interval_seconds: float = 60.0) -> None:
self._message = message
self._finished = False
self._rate_limiter = RateLimiter(min_update_interval_seconds)
self._update("started")
def _update(self, status: str) -> None:
assert not self._finished
self._rate_limiter.reset()
logger.info("%s: %s", self._message, status)
def spin(self) -> None:
if self._finished:
return
if not self._rate_limiter.ready():
return
self._update("still running...")
def finish(self, final_status: str) -> None:
if self._finished:
return
self._update(f"finished with status '{final_status}'")
self._finished = True
class RateLimiter:
def __init__(self, min_update_interval_seconds: float) -> None:
self._min_update_interval_seconds = min_update_interval_seconds
self._last_update: float = 0
def ready(self) -> bool:
now = time.time()
delta = now - self._last_update
return delta >= self._min_update_interval_seconds
def reset(self) -> None:
self._last_update = time.time()
@contextlib.contextmanager
def open_spinner(message: str) -> Iterator[SpinnerInterface]:
# Interactive spinner goes directly to sys.stdout rather than being routed
# through the logging system, but it acts like it has level INFO,
# i.e. it's only displayed if we're at level INFO or better.
# Non-interactive spinner goes through the logging system, so it is always
# in sync with logging configuration.
if sys.stdout.isatty() and logger.getEffectiveLevel() <= logging.INFO:
spinner: SpinnerInterface = InteractiveSpinner(message)
else:
spinner = NonInteractiveSpinner(message)
try:
with hidden_cursor(sys.stdout):
yield spinner
except KeyboardInterrupt:
spinner.finish("canceled")
raise
except Exception:
spinner.finish("error")
raise
else:
spinner.finish("done")
@contextlib.contextmanager
def hidden_cursor(file: IO[str]) -> Iterator[None]:
# The Windows terminal does not support the hide/show cursor ANSI codes,
# even via colorama. So don't even try.
if WINDOWS:
yield
# We don't want to clutter the output with control characters if we're
# writing to a file, or if the user is running with --quiet.
# See https://github.com/pypa/pip/issues/3418
elif not file.isatty() or logger.getEffectiveLevel() > logging.INFO:
yield
else:
file.write(HIDE_CURSOR)
try:
yield
finally:
file.write(SHOW_CURSOR)

View File

@@ -1,6 +0,0 @@
SUCCESS = 0
ERROR = 1
UNKNOWN_ERROR = 2
VIRTUALENV_NOT_FOUND = 3
PREVIOUS_BUILD_DIR_ERROR = 4
NO_MATCHES_FOUND = 23

View File

@@ -1,112 +0,0 @@
"""
Package containing all pip commands
"""
import importlib
from collections import OrderedDict, namedtuple
from typing import Any, Dict, Optional
from pip._internal.cli.base_command import Command
CommandInfo = namedtuple('CommandInfo', 'module_path, class_name, summary')
# The ordering matters for help display.
# Also, even though the module path starts with the same
# "pip._internal.commands" prefix in each case, we include the full path
# because it makes testing easier (specifically when modifying commands_dict
# in test setup / teardown by adding info for a FakeCommand class defined
# in a test-related module).
# Finally, we need to pass an iterable of pairs here rather than a dict
# so that the ordering won't be lost when using Python 2.7.
commands_dict: Dict[str, CommandInfo] = OrderedDict([
('install', CommandInfo(
'pip._internal.commands.install', 'InstallCommand',
'Install packages.',
)),
('download', CommandInfo(
'pip._internal.commands.download', 'DownloadCommand',
'Download packages.',
)),
('uninstall', CommandInfo(
'pip._internal.commands.uninstall', 'UninstallCommand',
'Uninstall packages.',
)),
('freeze', CommandInfo(
'pip._internal.commands.freeze', 'FreezeCommand',
'Output installed packages in requirements format.',
)),
('list', CommandInfo(
'pip._internal.commands.list', 'ListCommand',
'List installed packages.',
)),
('show', CommandInfo(
'pip._internal.commands.show', 'ShowCommand',
'Show information about installed packages.',
)),
('check', CommandInfo(
'pip._internal.commands.check', 'CheckCommand',
'Verify installed packages have compatible dependencies.',
)),
('config', CommandInfo(
'pip._internal.commands.configuration', 'ConfigurationCommand',
'Manage local and global configuration.',
)),
('search', CommandInfo(
'pip._internal.commands.search', 'SearchCommand',
'Search PyPI for packages.',
)),
('cache', CommandInfo(
'pip._internal.commands.cache', 'CacheCommand',
"Inspect and manage pip's wheel cache.",
)),
('index', CommandInfo(
'pip._internal.commands.index', 'IndexCommand',
"Inspect information available from package indexes.",
)),
('wheel', CommandInfo(
'pip._internal.commands.wheel', 'WheelCommand',
'Build wheels from your requirements.',
)),
('hash', CommandInfo(
'pip._internal.commands.hash', 'HashCommand',
'Compute hashes of package archives.',
)),
('completion', CommandInfo(
'pip._internal.commands.completion', 'CompletionCommand',
'A helper command used for command completion.',
)),
('debug', CommandInfo(
'pip._internal.commands.debug', 'DebugCommand',
'Show information useful for debugging.',
)),
('help', CommandInfo(
'pip._internal.commands.help', 'HelpCommand',
'Show help for commands.',
)),
])
def create_command(name: str, **kwargs: Any) -> Command:
"""
Create an instance of the Command class with the given name.
"""
module_path, class_name, summary = commands_dict[name]
module = importlib.import_module(module_path)
command_class = getattr(module, class_name)
command = command_class(name=name, summary=summary, **kwargs)
return command
def get_similar_commands(name: str) -> Optional[str]:
"""Command name auto-correct."""
from difflib import get_close_matches
name = name.lower()
close_commands = get_close_matches(name, commands_dict.keys())
if close_commands:
return close_commands[0]
else:
return None

View File

@@ -1,216 +0,0 @@
import os
import textwrap
from optparse import Values
from typing import Any, List
import pip._internal.utils.filesystem as filesystem
from pip._internal.cli.base_command import Command
from pip._internal.cli.status_codes import ERROR, SUCCESS
from pip._internal.exceptions import CommandError, PipError
from pip._internal.utils.logging import getLogger
logger = getLogger(__name__)
class CacheCommand(Command):
"""
Inspect and manage pip's wheel cache.
Subcommands:
- dir: Show the cache directory.
- info: Show information about the cache.
- list: List filenames of packages stored in the cache.
- remove: Remove one or more package from the cache.
- purge: Remove all items from the cache.
``<pattern>`` can be a glob expression or a package name.
"""
ignore_require_venv = True
usage = """
%prog dir
%prog info
%prog list [<pattern>] [--format=[human, abspath]]
%prog remove <pattern>
%prog purge
"""
def add_options(self) -> None:
self.cmd_opts.add_option(
'--format',
action='store',
dest='list_format',
default="human",
choices=('human', 'abspath'),
help="Select the output format among: human (default) or abspath"
)
self.parser.insert_option_group(0, self.cmd_opts)
def run(self, options: Values, args: List[Any]) -> int:
handlers = {
"dir": self.get_cache_dir,
"info": self.get_cache_info,
"list": self.list_cache_items,
"remove": self.remove_cache_items,
"purge": self.purge_cache,
}
if not options.cache_dir:
logger.error("pip cache commands can not "
"function since cache is disabled.")
return ERROR
# Determine action
if not args or args[0] not in handlers:
logger.error(
"Need an action (%s) to perform.",
", ".join(sorted(handlers)),
)
return ERROR
action = args[0]
# Error handling happens here, not in the action-handlers.
try:
handlers[action](options, args[1:])
except PipError as e:
logger.error(e.args[0])
return ERROR
return SUCCESS
def get_cache_dir(self, options: Values, args: List[Any]) -> None:
if args:
raise CommandError('Too many arguments')
logger.info(options.cache_dir)
def get_cache_info(self, options: Values, args: List[Any]) -> None:
if args:
raise CommandError('Too many arguments')
num_http_files = len(self._find_http_files(options))
num_packages = len(self._find_wheels(options, '*'))
http_cache_location = self._cache_dir(options, 'http')
wheels_cache_location = self._cache_dir(options, 'wheels')
http_cache_size = filesystem.format_directory_size(http_cache_location)
wheels_cache_size = filesystem.format_directory_size(
wheels_cache_location
)
message = textwrap.dedent("""
Package index page cache location: {http_cache_location}
Package index page cache size: {http_cache_size}
Number of HTTP files: {num_http_files}
Wheels location: {wheels_cache_location}
Wheels size: {wheels_cache_size}
Number of wheels: {package_count}
""").format(
http_cache_location=http_cache_location,
http_cache_size=http_cache_size,
num_http_files=num_http_files,
wheels_cache_location=wheels_cache_location,
package_count=num_packages,
wheels_cache_size=wheels_cache_size,
).strip()
logger.info(message)
def list_cache_items(self, options: Values, args: List[Any]) -> None:
if len(args) > 1:
raise CommandError('Too many arguments')
if args:
pattern = args[0]
else:
pattern = '*'
files = self._find_wheels(options, pattern)
if options.list_format == 'human':
self.format_for_human(files)
else:
self.format_for_abspath(files)
def format_for_human(self, files: List[str]) -> None:
if not files:
logger.info('Nothing cached.')
return
results = []
for filename in files:
wheel = os.path.basename(filename)
size = filesystem.format_file_size(filename)
results.append(f' - {wheel} ({size})')
logger.info('Cache contents:\n')
logger.info('\n'.join(sorted(results)))
def format_for_abspath(self, files: List[str]) -> None:
if not files:
return
results = []
for filename in files:
results.append(filename)
logger.info('\n'.join(sorted(results)))
def remove_cache_items(self, options: Values, args: List[Any]) -> None:
if len(args) > 1:
raise CommandError('Too many arguments')
if not args:
raise CommandError('Please provide a pattern')
files = self._find_wheels(options, args[0])
# Only fetch http files if no specific pattern given
if args[0] == '*':
files += self._find_http_files(options)
if not files:
raise CommandError('No matching packages')
for filename in files:
os.unlink(filename)
logger.verbose("Removed %s", filename)
logger.info("Files removed: %s", len(files))
def purge_cache(self, options: Values, args: List[Any]) -> None:
if args:
raise CommandError('Too many arguments')
return self.remove_cache_items(options, ['*'])
def _cache_dir(self, options: Values, subdir: str) -> str:
return os.path.join(options.cache_dir, subdir)
def _find_http_files(self, options: Values) -> List[str]:
http_dir = self._cache_dir(options, 'http')
return filesystem.find_files(http_dir, '*')
def _find_wheels(self, options: Values, pattern: str) -> List[str]:
wheel_dir = self._cache_dir(options, 'wheels')
# The wheel filename format, as specified in PEP 427, is:
# {distribution}-{version}(-{build})?-{python}-{abi}-{platform}.whl
#
# Additionally, non-alphanumeric values in the distribution are
# normalized to underscores (_), meaning hyphens can never occur
# before `-{version}`.
#
# Given that information:
# - If the pattern we're given contains a hyphen (-), the user is
# providing at least the version. Thus, we can just append `*.whl`
# to match the rest of it.
# - If the pattern we're given doesn't contain a hyphen (-), the
# user is only providing the name. Thus, we append `-*.whl` to
# match the hyphen before the version, followed by anything else.
#
# PEP 427: https://www.python.org/dev/peps/pep-0427/
pattern = pattern + ("*.whl" if "-" in pattern else "-*.whl")
return filesystem.find_files(wheel_dir, pattern)

View File

@@ -1,47 +0,0 @@
import logging
from optparse import Values
from typing import Any, List
from pip._internal.cli.base_command import Command
from pip._internal.cli.status_codes import ERROR, SUCCESS
from pip._internal.operations.check import (
check_package_set,
create_package_set_from_installed,
)
from pip._internal.utils.misc import write_output
logger = logging.getLogger(__name__)
class CheckCommand(Command):
"""Verify installed packages have compatible dependencies."""
usage = """
%prog [options]"""
def run(self, options: Values, args: List[Any]) -> int:
package_set, parsing_probs = create_package_set_from_installed()
missing, conflicting = check_package_set(package_set)
for project_name in missing:
version = package_set[project_name].version
for dependency in missing[project_name]:
write_output(
"%s %s requires %s, which is not installed.",
project_name, version, dependency[0],
)
for project_name in conflicting:
version = package_set[project_name].version
for dep_name, dep_version, req in conflicting[project_name]:
write_output(
"%s %s has requirement %s, but you have %s %s.",
project_name, version, req, dep_name, dep_version,
)
if missing or conflicting or parsing_probs:
return ERROR
else:
write_output("No broken requirements found.")
return SUCCESS

View File

@@ -1,91 +0,0 @@
import sys
import textwrap
from optparse import Values
from typing import List
from pip._internal.cli.base_command import Command
from pip._internal.cli.status_codes import SUCCESS
from pip._internal.utils.misc import get_prog
BASE_COMPLETION = """
# pip {shell} completion start{script}# pip {shell} completion end
"""
COMPLETION_SCRIPTS = {
'bash': """
_pip_completion()
{{
COMPREPLY=( $( COMP_WORDS="${{COMP_WORDS[*]}}" \\
COMP_CWORD=$COMP_CWORD \\
PIP_AUTO_COMPLETE=1 $1 2>/dev/null ) )
}}
complete -o default -F _pip_completion {prog}
""",
'zsh': """
function _pip_completion {{
local words cword
read -Ac words
read -cn cword
reply=( $( COMP_WORDS="$words[*]" \\
COMP_CWORD=$(( cword-1 )) \\
PIP_AUTO_COMPLETE=1 $words[1] 2>/dev/null ))
}}
compctl -K _pip_completion {prog}
""",
'fish': """
function __fish_complete_pip
set -lx COMP_WORDS (commandline -o) ""
set -lx COMP_CWORD ( \\
math (contains -i -- (commandline -t) $COMP_WORDS)-1 \\
)
set -lx PIP_AUTO_COMPLETE 1
string split \\ -- (eval $COMP_WORDS[1])
end
complete -fa "(__fish_complete_pip)" -c {prog}
""",
}
class CompletionCommand(Command):
"""A helper command to be used for command completion."""
ignore_require_venv = True
def add_options(self) -> None:
self.cmd_opts.add_option(
'--bash', '-b',
action='store_const',
const='bash',
dest='shell',
help='Emit completion code for bash')
self.cmd_opts.add_option(
'--zsh', '-z',
action='store_const',
const='zsh',
dest='shell',
help='Emit completion code for zsh')
self.cmd_opts.add_option(
'--fish', '-f',
action='store_const',
const='fish',
dest='shell',
help='Emit completion code for fish')
self.parser.insert_option_group(0, self.cmd_opts)
def run(self, options: Values, args: List[str]) -> int:
"""Prints the completion code of the given shell"""
shells = COMPLETION_SCRIPTS.keys()
shell_options = ['--' + shell for shell in sorted(shells)]
if options.shell in shells:
script = textwrap.dedent(
COMPLETION_SCRIPTS.get(options.shell, '').format(
prog=get_prog())
)
print(BASE_COMPLETION.format(script=script, shell=options.shell))
return SUCCESS
else:
sys.stderr.write(
'ERROR: You must pass {}\n' .format(' or '.join(shell_options))
)
return SUCCESS

View File

@@ -1,266 +0,0 @@
import logging
import os
import subprocess
from optparse import Values
from typing import Any, List, Optional
from pip._internal.cli.base_command import Command
from pip._internal.cli.status_codes import ERROR, SUCCESS
from pip._internal.configuration import (
Configuration,
Kind,
get_configuration_files,
kinds,
)
from pip._internal.exceptions import PipError
from pip._internal.utils.logging import indent_log
from pip._internal.utils.misc import get_prog, write_output
logger = logging.getLogger(__name__)
class ConfigurationCommand(Command):
"""
Manage local and global configuration.
Subcommands:
- list: List the active configuration (or from the file specified)
- edit: Edit the configuration file in an editor
- get: Get the value associated with name
- set: Set the name=value
- unset: Unset the value associated with name
- debug: List the configuration files and values defined under them
If none of --user, --global and --site are passed, a virtual
environment configuration file is used if one is active and the file
exists. Otherwise, all modifications happen on the to the user file by
default.
"""
ignore_require_venv = True
usage = """
%prog [<file-option>] list
%prog [<file-option>] [--editor <editor-path>] edit
%prog [<file-option>] get name
%prog [<file-option>] set name value
%prog [<file-option>] unset name
%prog [<file-option>] debug
"""
def add_options(self) -> None:
self.cmd_opts.add_option(
'--editor',
dest='editor',
action='store',
default=None,
help=(
'Editor to use to edit the file. Uses VISUAL or EDITOR '
'environment variables if not provided.'
)
)
self.cmd_opts.add_option(
'--global',
dest='global_file',
action='store_true',
default=False,
help='Use the system-wide configuration file only'
)
self.cmd_opts.add_option(
'--user',
dest='user_file',
action='store_true',
default=False,
help='Use the user configuration file only'
)
self.cmd_opts.add_option(
'--site',
dest='site_file',
action='store_true',
default=False,
help='Use the current environment configuration file only'
)
self.parser.insert_option_group(0, self.cmd_opts)
def run(self, options: Values, args: List[str]) -> int:
handlers = {
"list": self.list_values,
"edit": self.open_in_editor,
"get": self.get_name,
"set": self.set_name_value,
"unset": self.unset_name,
"debug": self.list_config_values,
}
# Determine action
if not args or args[0] not in handlers:
logger.error(
"Need an action (%s) to perform.",
", ".join(sorted(handlers)),
)
return ERROR
action = args[0]
# Determine which configuration files are to be loaded
# Depends on whether the command is modifying.
try:
load_only = self._determine_file(
options, need_value=(action in ["get", "set", "unset", "edit"])
)
except PipError as e:
logger.error(e.args[0])
return ERROR
# Load a new configuration
self.configuration = Configuration(
isolated=options.isolated_mode, load_only=load_only
)
self.configuration.load()
# Error handling happens here, not in the action-handlers.
try:
handlers[action](options, args[1:])
except PipError as e:
logger.error(e.args[0])
return ERROR
return SUCCESS
def _determine_file(self, options: Values, need_value: bool) -> Optional[Kind]:
file_options = [key for key, value in (
(kinds.USER, options.user_file),
(kinds.GLOBAL, options.global_file),
(kinds.SITE, options.site_file),
) if value]
if not file_options:
if not need_value:
return None
# Default to user, unless there's a site file.
elif any(
os.path.exists(site_config_file)
for site_config_file in get_configuration_files()[kinds.SITE]
):
return kinds.SITE
else:
return kinds.USER
elif len(file_options) == 1:
return file_options[0]
raise PipError(
"Need exactly one file to operate upon "
"(--user, --site, --global) to perform."
)
def list_values(self, options: Values, args: List[str]) -> None:
self._get_n_args(args, "list", n=0)
for key, value in sorted(self.configuration.items()):
write_output("%s=%r", key, value)
def get_name(self, options: Values, args: List[str]) -> None:
key = self._get_n_args(args, "get [name]", n=1)
value = self.configuration.get_value(key)
write_output("%s", value)
def set_name_value(self, options: Values, args: List[str]) -> None:
key, value = self._get_n_args(args, "set [name] [value]", n=2)
self.configuration.set_value(key, value)
self._save_configuration()
def unset_name(self, options: Values, args: List[str]) -> None:
key = self._get_n_args(args, "unset [name]", n=1)
self.configuration.unset_value(key)
self._save_configuration()
def list_config_values(self, options: Values, args: List[str]) -> None:
"""List config key-value pairs across different config files"""
self._get_n_args(args, "debug", n=0)
self.print_env_var_values()
# Iterate over config files and print if they exist, and the
# key-value pairs present in them if they do
for variant, files in sorted(self.configuration.iter_config_files()):
write_output("%s:", variant)
for fname in files:
with indent_log():
file_exists = os.path.exists(fname)
write_output("%s, exists: %r",
fname, file_exists)
if file_exists:
self.print_config_file_values(variant)
def print_config_file_values(self, variant: Kind) -> None:
"""Get key-value pairs from the file of a variant"""
for name, value in self.configuration.\
get_values_in_config(variant).items():
with indent_log():
write_output("%s: %s", name, value)
def print_env_var_values(self) -> None:
"""Get key-values pairs present as environment variables"""
write_output("%s:", 'env_var')
with indent_log():
for key, value in sorted(self.configuration.get_environ_vars()):
env_var = f'PIP_{key.upper()}'
write_output("%s=%r", env_var, value)
def open_in_editor(self, options: Values, args: List[str]) -> None:
editor = self._determine_editor(options)
fname = self.configuration.get_file_to_edit()
if fname is None:
raise PipError("Could not determine appropriate file.")
try:
subprocess.check_call([editor, fname])
except subprocess.CalledProcessError as e:
raise PipError(
"Editor Subprocess exited with exit code {}"
.format(e.returncode)
)
def _get_n_args(self, args: List[str], example: str, n: int) -> Any:
"""Helper to make sure the command got the right number of arguments
"""
if len(args) != n:
msg = (
'Got unexpected number of arguments, expected {}. '
'(example: "{} config {}")'
).format(n, get_prog(), example)
raise PipError(msg)
if n == 1:
return args[0]
else:
return args
def _save_configuration(self) -> None:
# We successfully ran a modifying command. Need to save the
# configuration.
try:
self.configuration.save()
except Exception:
logger.exception(
"Unable to save configuration. Please report this as a bug."
)
raise PipError("Internal Error.")
def _determine_editor(self, options: Values) -> str:
if options.editor is not None:
return options.editor
elif "VISUAL" in os.environ:
return os.environ["VISUAL"]
elif "EDITOR" in os.environ:
return os.environ["EDITOR"]
else:
raise PipError("Could not determine editor to use.")

View File

@@ -1,204 +0,0 @@
import locale
import logging
import os
import sys
from optparse import Values
from types import ModuleType
from typing import Any, Dict, List, Optional
import pip._vendor
from pip._vendor.certifi import where
from pip._vendor.packaging.version import parse as parse_version
from pip import __file__ as pip_location
from pip._internal.cli import cmdoptions
from pip._internal.cli.base_command import Command
from pip._internal.cli.cmdoptions import make_target_python
from pip._internal.cli.status_codes import SUCCESS
from pip._internal.configuration import Configuration
from pip._internal.metadata import get_environment
from pip._internal.utils.logging import indent_log
from pip._internal.utils.misc import get_pip_version
logger = logging.getLogger(__name__)
def show_value(name: str, value: Any) -> None:
logger.info('%s: %s', name, value)
def show_sys_implementation() -> None:
logger.info('sys.implementation:')
implementation_name = sys.implementation.name
with indent_log():
show_value('name', implementation_name)
def create_vendor_txt_map() -> Dict[str, str]:
vendor_txt_path = os.path.join(
os.path.dirname(pip_location),
'_vendor',
'vendor.txt'
)
with open(vendor_txt_path) as f:
# Purge non version specifying lines.
# Also, remove any space prefix or suffixes (including comments).
lines = [line.strip().split(' ', 1)[0]
for line in f.readlines() if '==' in line]
# Transform into "module" -> version dict.
return dict(line.split('==', 1) for line in lines) # type: ignore
def get_module_from_module_name(module_name: str) -> ModuleType:
# Module name can be uppercase in vendor.txt for some reason...
module_name = module_name.lower()
# PATCH: setuptools is actually only pkg_resources.
if module_name == 'setuptools':
module_name = 'pkg_resources'
__import__(
f'pip._vendor.{module_name}',
globals(),
locals(),
level=0
)
return getattr(pip._vendor, module_name)
def get_vendor_version_from_module(module_name: str) -> Optional[str]:
module = get_module_from_module_name(module_name)
version = getattr(module, '__version__', None)
if not version:
# Try to find version in debundled module info.
env = get_environment([os.path.dirname(module.__file__)])
dist = env.get_distribution(module_name)
if dist:
version = str(dist.version)
return version
def show_actual_vendor_versions(vendor_txt_versions: Dict[str, str]) -> None:
"""Log the actual version and print extra info if there is
a conflict or if the actual version could not be imported.
"""
for module_name, expected_version in vendor_txt_versions.items():
extra_message = ''
actual_version = get_vendor_version_from_module(module_name)
if not actual_version:
extra_message = ' (Unable to locate actual module version, using'\
' vendor.txt specified version)'
actual_version = expected_version
elif parse_version(actual_version) != parse_version(expected_version):
extra_message = ' (CONFLICT: vendor.txt suggests version should'\
' be {})'.format(expected_version)
logger.info('%s==%s%s', module_name, actual_version, extra_message)
def show_vendor_versions() -> None:
logger.info('vendored library versions:')
vendor_txt_versions = create_vendor_txt_map()
with indent_log():
show_actual_vendor_versions(vendor_txt_versions)
def show_tags(options: Values) -> None:
tag_limit = 10
target_python = make_target_python(options)
tags = target_python.get_tags()
# Display the target options that were explicitly provided.
formatted_target = target_python.format_given()
suffix = ''
if formatted_target:
suffix = f' (target: {formatted_target})'
msg = 'Compatible tags: {}{}'.format(len(tags), suffix)
logger.info(msg)
if options.verbose < 1 and len(tags) > tag_limit:
tags_limited = True
tags = tags[:tag_limit]
else:
tags_limited = False
with indent_log():
for tag in tags:
logger.info(str(tag))
if tags_limited:
msg = (
'...\n'
'[First {tag_limit} tags shown. Pass --verbose to show all.]'
).format(tag_limit=tag_limit)
logger.info(msg)
def ca_bundle_info(config: Configuration) -> str:
levels = set()
for key, _ in config.items():
levels.add(key.split('.')[0])
if not levels:
return "Not specified"
levels_that_override_global = ['install', 'wheel', 'download']
global_overriding_level = [
level for level in levels if level in levels_that_override_global
]
if not global_overriding_level:
return 'global'
if 'global' in levels:
levels.remove('global')
return ", ".join(levels)
class DebugCommand(Command):
"""
Display debug information.
"""
usage = """
%prog <options>"""
ignore_require_venv = True
def add_options(self) -> None:
cmdoptions.add_target_python_options(self.cmd_opts)
self.parser.insert_option_group(0, self.cmd_opts)
self.parser.config.load()
def run(self, options: Values, args: List[str]) -> int:
logger.warning(
"This command is only meant for debugging. "
"Do not use this with automation for parsing and getting these "
"details, since the output and options of this command may "
"change without notice."
)
show_value('pip version', get_pip_version())
show_value('sys.version', sys.version)
show_value('sys.executable', sys.executable)
show_value('sys.getdefaultencoding', sys.getdefaultencoding())
show_value('sys.getfilesystemencoding', sys.getfilesystemencoding())
show_value(
'locale.getpreferredencoding', locale.getpreferredencoding(),
)
show_value('sys.platform', sys.platform)
show_sys_implementation()
show_value("'cert' config value", ca_bundle_info(self.parser.config))
show_value("REQUESTS_CA_BUNDLE", os.environ.get('REQUESTS_CA_BUNDLE'))
show_value("CURL_CA_BUNDLE", os.environ.get('CURL_CA_BUNDLE'))
show_value("pip._vendor.certifi.where()", where())
show_value("pip._vendor.DEBUNDLED", pip._vendor.DEBUNDLED)
show_vendor_versions()
show_tags(options)
return SUCCESS

View File

@@ -1,139 +0,0 @@
import logging
import os
from optparse import Values
from typing import List
from pip._internal.cli import cmdoptions
from pip._internal.cli.cmdoptions import make_target_python
from pip._internal.cli.req_command import RequirementCommand, with_cleanup
from pip._internal.cli.status_codes import SUCCESS
from pip._internal.req.req_tracker import get_requirement_tracker
from pip._internal.utils.misc import ensure_dir, normalize_path, write_output
from pip._internal.utils.temp_dir import TempDirectory
logger = logging.getLogger(__name__)
class DownloadCommand(RequirementCommand):
"""
Download packages from:
- PyPI (and other indexes) using requirement specifiers.
- VCS project urls.
- Local project directories.
- Local or remote source archives.
pip also supports downloading from "requirements files", which provide
an easy way to specify a whole environment to be downloaded.
"""
usage = """
%prog [options] <requirement specifier> [package-index-options] ...
%prog [options] -r <requirements file> [package-index-options] ...
%prog [options] <vcs project url> ...
%prog [options] <local project path> ...
%prog [options] <archive url/path> ..."""
def add_options(self) -> None:
self.cmd_opts.add_option(cmdoptions.constraints())
self.cmd_opts.add_option(cmdoptions.requirements())
self.cmd_opts.add_option(cmdoptions.build_dir())
self.cmd_opts.add_option(cmdoptions.no_deps())
self.cmd_opts.add_option(cmdoptions.global_options())
self.cmd_opts.add_option(cmdoptions.no_binary())
self.cmd_opts.add_option(cmdoptions.only_binary())
self.cmd_opts.add_option(cmdoptions.prefer_binary())
self.cmd_opts.add_option(cmdoptions.src())
self.cmd_opts.add_option(cmdoptions.pre())
self.cmd_opts.add_option(cmdoptions.require_hashes())
self.cmd_opts.add_option(cmdoptions.progress_bar())
self.cmd_opts.add_option(cmdoptions.no_build_isolation())
self.cmd_opts.add_option(cmdoptions.use_pep517())
self.cmd_opts.add_option(cmdoptions.no_use_pep517())
self.cmd_opts.add_option(cmdoptions.ignore_requires_python())
self.cmd_opts.add_option(
'-d', '--dest', '--destination-dir', '--destination-directory',
dest='download_dir',
metavar='dir',
default=os.curdir,
help=("Download packages into <dir>."),
)
cmdoptions.add_target_python_options(self.cmd_opts)
index_opts = cmdoptions.make_option_group(
cmdoptions.index_group,
self.parser,
)
self.parser.insert_option_group(0, index_opts)
self.parser.insert_option_group(0, self.cmd_opts)
@with_cleanup
def run(self, options: Values, args: List[str]) -> int:
options.ignore_installed = True
# editable doesn't really make sense for `pip download`, but the bowels
# of the RequirementSet code require that property.
options.editables = []
cmdoptions.check_dist_restriction(options)
options.download_dir = normalize_path(options.download_dir)
ensure_dir(options.download_dir)
session = self.get_default_session(options)
target_python = make_target_python(options)
finder = self._build_package_finder(
options=options,
session=session,
target_python=target_python,
ignore_requires_python=options.ignore_requires_python,
)
req_tracker = self.enter_context(get_requirement_tracker())
directory = TempDirectory(
delete=not options.no_clean,
kind="download",
globally_managed=True,
)
reqs = self.get_requirements(args, options, finder, session)
preparer = self.make_requirement_preparer(
temp_build_dir=directory,
options=options,
req_tracker=req_tracker,
session=session,
finder=finder,
download_dir=options.download_dir,
use_user_site=False,
)
resolver = self.make_resolver(
preparer=preparer,
finder=finder,
options=options,
ignore_requires_python=options.ignore_requires_python,
py_version_info=options.python_version,
)
self.trace_basic_info(finder)
requirement_set = resolver.resolve(
reqs, check_supported_wheels=True
)
downloaded: List[str] = []
for req in requirement_set.requirements.values():
if req.satisfied_by is None:
assert req.name is not None
preparer.save_linked_requirement(req)
downloaded.append(req.name)
if downloaded:
write_output('Successfully downloaded %s', ' '.join(downloaded))
return SUCCESS

View File

@@ -1,84 +0,0 @@
import sys
from optparse import Values
from typing import List
from pip._internal.cli import cmdoptions
from pip._internal.cli.base_command import Command
from pip._internal.cli.status_codes import SUCCESS
from pip._internal.operations.freeze import freeze
from pip._internal.utils.compat import stdlib_pkgs
DEV_PKGS = {'pip', 'setuptools', 'distribute', 'wheel'}
class FreezeCommand(Command):
"""
Output installed packages in requirements format.
packages are listed in a case-insensitive sorted order.
"""
usage = """
%prog [options]"""
log_streams = ("ext://sys.stderr", "ext://sys.stderr")
def add_options(self) -> None:
self.cmd_opts.add_option(
'-r', '--requirement',
dest='requirements',
action='append',
default=[],
metavar='file',
help="Use the order in the given requirements file and its "
"comments when generating output. This option can be "
"used multiple times.")
self.cmd_opts.add_option(
'-l', '--local',
dest='local',
action='store_true',
default=False,
help='If in a virtualenv that has global access, do not output '
'globally-installed packages.')
self.cmd_opts.add_option(
'--user',
dest='user',
action='store_true',
default=False,
help='Only output packages installed in user-site.')
self.cmd_opts.add_option(cmdoptions.list_path())
self.cmd_opts.add_option(
'--all',
dest='freeze_all',
action='store_true',
help='Do not skip these packages in the output:'
' {}'.format(', '.join(DEV_PKGS)))
self.cmd_opts.add_option(
'--exclude-editable',
dest='exclude_editable',
action='store_true',
help='Exclude editable package from output.')
self.cmd_opts.add_option(cmdoptions.list_exclude())
self.parser.insert_option_group(0, self.cmd_opts)
def run(self, options: Values, args: List[str]) -> int:
skip = set(stdlib_pkgs)
if not options.freeze_all:
skip.update(DEV_PKGS)
if options.excludes:
skip.update(options.excludes)
cmdoptions.check_list_path_option(options)
for line in freeze(
requirement=options.requirements,
local_only=options.local,
user_only=options.user,
paths=options.path,
isolated=options.isolated_mode,
skip=skip,
exclude_editable=options.exclude_editable,
):
sys.stdout.write(line + '\n')
return SUCCESS

View File

@@ -1,55 +0,0 @@
import hashlib
import logging
import sys
from optparse import Values
from typing import List
from pip._internal.cli.base_command import Command
from pip._internal.cli.status_codes import ERROR, SUCCESS
from pip._internal.utils.hashes import FAVORITE_HASH, STRONG_HASHES
from pip._internal.utils.misc import read_chunks, write_output
logger = logging.getLogger(__name__)
class HashCommand(Command):
"""
Compute a hash of a local package archive.
These can be used with --hash in a requirements file to do repeatable
installs.
"""
usage = '%prog [options] <file> ...'
ignore_require_venv = True
def add_options(self) -> None:
self.cmd_opts.add_option(
'-a', '--algorithm',
dest='algorithm',
choices=STRONG_HASHES,
action='store',
default=FAVORITE_HASH,
help='The hash algorithm to use: one of {}'.format(
', '.join(STRONG_HASHES)))
self.parser.insert_option_group(0, self.cmd_opts)
def run(self, options: Values, args: List[str]) -> int:
if not args:
self.parser.print_usage(sys.stderr)
return ERROR
algorithm = options.algorithm
for path in args:
write_output('%s:\n--hash=%s:%s',
path, algorithm, _hash_of_file(path, algorithm))
return SUCCESS
def _hash_of_file(path: str, algorithm: str) -> str:
"""Return the hash digest of a file."""
with open(path, 'rb') as archive:
hash = hashlib.new(algorithm)
for chunk in read_chunks(archive):
hash.update(chunk)
return hash.hexdigest()

View File

@@ -1,41 +0,0 @@
from optparse import Values
from typing import List
from pip._internal.cli.base_command import Command
from pip._internal.cli.status_codes import SUCCESS
from pip._internal.exceptions import CommandError
class HelpCommand(Command):
"""Show help for commands"""
usage = """
%prog <command>"""
ignore_require_venv = True
def run(self, options: Values, args: List[str]) -> int:
from pip._internal.commands import (
commands_dict,
create_command,
get_similar_commands,
)
try:
# 'pip help' with no args is handled by pip.__init__.parseopt()
cmd_name = args[0] # the command we need help for
except IndexError:
return SUCCESS
if cmd_name not in commands_dict:
guess = get_similar_commands(cmd_name)
msg = [f'unknown command "{cmd_name}"']
if guess:
msg.append(f'maybe you meant "{guess}"')
raise CommandError(' - '.join(msg))
command = create_command(cmd_name)
command.parser.print_help()
return SUCCESS

Some files were not shown because too many files have changed in this diff Show More