Compare commits
No commits in common. "905241a0688f1cd5a9a127450f32fa54b63a4260" and "ebbd1a2b5b69792687158cf92edf1639ea002945" have entirely different histories.
905241a068
...
ebbd1a2b5b
1
Makefile
1
Makefile
@ -74,6 +74,5 @@ dotfiles_put:
|
|||||||
#commands install -f -p dotfiles -s dotfiles/ -t ~/.config/
|
#commands install -f -p dotfiles -s dotfiles/ -t ~/.config/
|
||||||
|
|
||||||
dotfiles_fetch:
|
dotfiles_fetch:
|
||||||
commands install -f -p ~ -s ~/.config/katerc -t dotfiles
|
|
||||||
commands install -f -p ~ -s ~/.config/Code\ -\ OSS/User/keybindings.json -t dotfiles
|
commands install -f -p ~ -s ~/.config/Code\ -\ OSS/User/keybindings.json -t dotfiles
|
||||||
commands install -f -p ~ -s ~/.config/Code\ -\ OSS/User/settings.json -t dotfiles
|
commands install -f -p ~ -s ~/.config/Code\ -\ OSS/User/settings.json -t dotfiles
|
||||||
|
2
deps/com.github.aiortc.aiortc
vendored
2
deps/com.github.aiortc.aiortc
vendored
@ -1 +1 @@
|
|||||||
Subproject commit 352e3f68754ab93eb8449ee0751b40991f5a6b73
|
Subproject commit e27d400c07ddbe66e1ef73da1a5754c28cfec157
|
@ -3,6 +3,7 @@
|
|||||||
"editor.minimap.autohide": true,
|
"editor.minimap.autohide": true,
|
||||||
"editor.minimap.maxColumn": 80,
|
"editor.minimap.maxColumn": 80,
|
||||||
"editor.minimap.size": "fit",
|
"editor.minimap.size": "fit",
|
||||||
|
"diffEditor.hideUnchangedRegions.enabled": true,
|
||||||
"python.experiments.enabled": false,
|
"python.experiments.enabled": false,
|
||||||
"debugpy.debugJustMyCode": false,
|
"debugpy.debugJustMyCode": false,
|
||||||
"python.REPL.enableREPLSmartSend": false,
|
"python.REPL.enableREPLSmartSend": false,
|
||||||
@ -12,7 +13,7 @@
|
|||||||
"typescript.surveys.enabled": false,
|
"typescript.surveys.enabled": false,
|
||||||
"typescript.suggestionActions.enabled": false,
|
"typescript.suggestionActions.enabled": false,
|
||||||
"typescript.tsserver.enableRegionDiagnostics": false,
|
"typescript.tsserver.enableRegionDiagnostics": false,
|
||||||
"typescript.tsserver.maxTsServerMemory": 0.05,
|
"typescript.tsserver.maxTsServerMemory": 5,
|
||||||
"typescript.tsserver.useSyntaxServer": "never",
|
"typescript.tsserver.useSyntaxServer": "never",
|
||||||
"typescript.tsserver.web.typeAcquisition.enabled": false,
|
"typescript.tsserver.web.typeAcquisition.enabled": false,
|
||||||
"typescript.validate.enable": false,
|
"typescript.validate.enable": false,
|
||||||
@ -79,73 +80,9 @@
|
|||||||
// "<C-a>": false,
|
// "<C-a>": false,
|
||||||
// "<C-f>": false
|
// "<C-f>": false
|
||||||
// },
|
// },
|
||||||
|
|
||||||
|
"// To improve performance",
|
||||||
"extensions.experimental.affinity": {
|
"extensions.experimental.affinity": {
|
||||||
"vscodevim.vim": 1
|
"vscodevim.vim": 1
|
||||||
},
|
},
|
||||||
"diffEditor.experimental.showMoves": true,
|
|
||||||
"diffEditor.hideUnchangedRegions.enabled": true,
|
|
||||||
"python.locator": "native",
|
|
||||||
"python.testing.promptToConfigure": false,
|
|
||||||
"typescript.format.enable": false,
|
|
||||||
"typescript.format.indentSwitchCase": false,
|
|
||||||
"typescript.preferences.renameMatchingJsxTags": false,
|
|
||||||
"typescript.autoClosingTags": false,
|
|
||||||
"typescript.format.insertSpaceAfterCommaDelimiter": false,
|
|
||||||
"typescript.format.insertSpaceAfterKeywordsInControlFlowStatements": false,
|
|
||||||
"typescript.format.insertSpaceAfterOpeningAndBeforeClosingEmptyBraces": false,
|
|
||||||
"docker.enableDockerComposeLanguageService": false,
|
|
||||||
"go.useLanguageServer": false,
|
|
||||||
"search.maxResults": 128,
|
|
||||||
"search.ripgrep.maxThreads": 1,
|
|
||||||
"search.searchEditor.defaultNumberOfContextLines": 7,
|
|
||||||
"search.searchOnType": false,
|
|
||||||
"task.allowAutomaticTasks": "off",
|
|
||||||
"task.autoDetect": "off",
|
|
||||||
"task.quickOpen.detail": false,
|
|
||||||
"task.reconnection": false,
|
|
||||||
"javascript.autoClosingTags": false,
|
|
||||||
"javascript.format.enable": false,
|
|
||||||
"javascript.format.insertSpaceAfterCommaDelimiter": false,
|
|
||||||
"javascript.format.insertSpaceAfterFunctionKeywordForAnonymousFunctions": false,
|
|
||||||
"javascript.format.insertSpaceAfterKeywordsInControlFlowStatements": false,
|
|
||||||
"javascript.format.insertSpaceAfterOpeningAndBeforeClosingEmptyBraces": false,
|
|
||||||
"javascript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces": false,
|
|
||||||
"javascript.format.insertSpaceAfterSemicolonInForStatements": false,
|
|
||||||
"javascript.format.insertSpaceBeforeAndAfterBinaryOperators": false,
|
|
||||||
"javascript.inlayHints.parameterNames.suppressWhenArgumentMatchesName": false,
|
|
||||||
"javascript.inlayHints.variableTypes.suppressWhenTypeMatchesName": false,
|
|
||||||
"javascript.preferences.renameMatchingJsxTags": false,
|
|
||||||
"javascript.preferences.useAliasesForRenames": false,
|
|
||||||
"javascript.suggest.autoImports": false,
|
|
||||||
"javascript.suggest.classMemberSnippets.enabled": false,
|
|
||||||
"javascript.suggest.completeJSDocs": false,
|
|
||||||
"javascript.suggest.enabled": false,
|
|
||||||
"javascript.suggest.includeAutomaticOptionalChainCompletions": false,
|
|
||||||
"javascript.suggest.includeCompletionsForImportStatements": false,
|
|
||||||
"javascript.suggest.jsdoc.generateReturns": false,
|
|
||||||
"javascript.suggest.names": false,
|
|
||||||
"javascript.suggest.paths": false,
|
|
||||||
"javascript.suggestionActions.enabled": false,
|
|
||||||
"javascript.updateImportsOnFileMove.enabled": "never",
|
|
||||||
"javascript.validate.enable": false,
|
|
||||||
"js/ts.implicitProjectConfig.strictFunctionTypes": false,
|
|
||||||
"js/ts.implicitProjectConfig.strictNullChecks": false,
|
|
||||||
"typescript.format.insertSpaceAfterFunctionKeywordForAnonymousFunctions": false,
|
|
||||||
"typescript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces": false,
|
|
||||||
"typescript.format.insertSpaceAfterSemicolonInForStatements": false,
|
|
||||||
"typescript.format.insertSpaceBeforeAndAfterBinaryOperators": false,
|
|
||||||
"typescript.inlayHints.parameterNames.suppressWhenArgumentMatchesName": false,
|
|
||||||
"typescript.inlayHints.variableTypes.suppressWhenTypeMatchesName": false,
|
|
||||||
"typescript.preferences.useAliasesForRenames": false,
|
|
||||||
"typescript.reportStyleChecksAsWarnings": false,
|
|
||||||
"typescript.suggest.autoImports": false,
|
|
||||||
"typescript.suggest.classMemberSnippets.enabled": false,
|
|
||||||
"typescript.suggest.completeJSDocs": false,
|
|
||||||
"typescript.suggest.enabled": false,
|
|
||||||
"typescript.suggest.includeAutomaticOptionalChainCompletions": false,
|
|
||||||
"typescript.suggest.includeCompletionsForImportStatements": false,
|
|
||||||
"typescript.suggest.jsdoc.generateReturns": false,
|
|
||||||
"typescript.suggest.objectLiteralMethodSnippets.enabled": false,
|
|
||||||
"typescript.suggest.paths": false,
|
|
||||||
"typescript.tsc.autoDetect": "off",
|
|
||||||
}
|
}
|
@ -1,261 +0,0 @@
|
|||||||
[BuildConfig]
|
|
||||||
AllowedCommandLines=
|
|
||||||
AutoSwitchToOutput=true
|
|
||||||
BlockedCommandLines=
|
|
||||||
UseDiagnosticsOutput=true
|
|
||||||
|
|
||||||
[CTags]
|
|
||||||
GlobalCommand=ctags -R --c++-types=+px --extra=+q --excmd=pattern --exclude=Makefile --exclude=.
|
|
||||||
GlobalNumTargets=0
|
|
||||||
|
|
||||||
[General]
|
|
||||||
Allow Tab Scrolling=true
|
|
||||||
Auto Hide Tabs=false
|
|
||||||
Close After Last=false
|
|
||||||
Close documents with window=true
|
|
||||||
Cycle To First Tab=true
|
|
||||||
Days Meta Infos=30
|
|
||||||
Diagnostics Limit=12000
|
|
||||||
Diff Show Style=0
|
|
||||||
Elide Tab Text=false
|
|
||||||
Enable Context ToolView=false
|
|
||||||
Expand Tabs=false
|
|
||||||
Icon size for left and right sidebar buttons=32
|
|
||||||
Last Session=calibre
|
|
||||||
Modified Notification=false
|
|
||||||
Mouse back button action=0
|
|
||||||
Mouse forward button action=0
|
|
||||||
Open New Tab To The Right Of Current=true
|
|
||||||
Output History Limit=100
|
|
||||||
Output With Date=false
|
|
||||||
Quickopen Filter Mode=0
|
|
||||||
Quickopen List Mode=true
|
|
||||||
Recent File List Entry Count=10
|
|
||||||
Restore Window Configuration=true
|
|
||||||
SDI Mode=false
|
|
||||||
Save Meta Infos=false
|
|
||||||
Session Manager Sort Column=0
|
|
||||||
Session Manager Sort Order=0
|
|
||||||
Show Full Path in Title=true
|
|
||||||
Show Menu Bar=true
|
|
||||||
Show Status Bar=false
|
|
||||||
Show Symbol In Navigation Bar=true
|
|
||||||
Show Tab Bar=true
|
|
||||||
Show Tabs Close Button=true
|
|
||||||
Show Url Nav Bar=false
|
|
||||||
Show output view for message type=1
|
|
||||||
Show text for left and right sidebar=false
|
|
||||||
Show welcome view for new window=true
|
|
||||||
Startup Session=manual
|
|
||||||
Stash new unsaved files=true
|
|
||||||
Stash unsaved file changes=false
|
|
||||||
Sync section size with tab positions=false
|
|
||||||
Tab Double Click New Document=true
|
|
||||||
Tab Middle Click Close Document=true
|
|
||||||
Tabbar Tab Limit=0
|
|
||||||
|
|
||||||
[KDE]
|
|
||||||
widgetStyle=Fusion
|
|
||||||
|
|
||||||
[KTextEditor Document]
|
|
||||||
Allow End of Line Detection=true
|
|
||||||
Auto Detect Indent=true
|
|
||||||
Auto Reload If State Is In Version Control=true
|
|
||||||
Auto Save=false
|
|
||||||
Auto Save Interval=0
|
|
||||||
Auto Save On Focus Out=false
|
|
||||||
BOM=false
|
|
||||||
Backup Local=false
|
|
||||||
Backup Prefix=
|
|
||||||
Backup Remote=false
|
|
||||||
Backup Suffix=~
|
|
||||||
Camel Cursor=true
|
|
||||||
Encoding=UTF-8
|
|
||||||
End of Line=0
|
|
||||||
Indent On Backspace=true
|
|
||||||
Indent On Tab=true
|
|
||||||
Indent On Text Paste=true
|
|
||||||
Indentation Mode=normal
|
|
||||||
Indentation Width=4
|
|
||||||
Keep Extra Spaces=false
|
|
||||||
Line Length Limit=10000
|
|
||||||
Newline at End of File=true
|
|
||||||
On-The-Fly Spellcheck=false
|
|
||||||
Overwrite Mode=false
|
|
||||||
PageUp/PageDown Moves Cursor=false
|
|
||||||
Remove Spaces=1
|
|
||||||
ReplaceTabsDyn=true
|
|
||||||
Show Spaces=2
|
|
||||||
Show Tabs=true
|
|
||||||
Smart Home=true
|
|
||||||
Swap Directory=
|
|
||||||
Swap File Mode=1
|
|
||||||
Swap Sync Interval=15
|
|
||||||
Tab Handling=2
|
|
||||||
Tab Width=4
|
|
||||||
Trailing Marker Size=1
|
|
||||||
Use Editor Config=true
|
|
||||||
Word Wrap=false
|
|
||||||
Word Wrap Column=80
|
|
||||||
|
|
||||||
[KTextEditor Renderer]
|
|
||||||
Animate Bracket Matching=false
|
|
||||||
Auto Color Theme Selection=false
|
|
||||||
Color Theme=Monokai
|
|
||||||
Line Height Multiplier=1
|
|
||||||
Show Indentation Lines=false
|
|
||||||
Show Whole Bracket Expression=false
|
|
||||||
Text Font=Terminus,11,-1,5,400,0,0,0,0,0,0,0,0,0,0,1
|
|
||||||
Text Font Features=
|
|
||||||
Word Wrap Marker=false
|
|
||||||
|
|
||||||
[KTextEditor View]
|
|
||||||
Allow Mark Menu=true
|
|
||||||
Auto Brackets=true
|
|
||||||
Auto Center Lines=0
|
|
||||||
Auto Completion=true
|
|
||||||
Auto Completion Preselect First Entry=true
|
|
||||||
Backspace Remove Composed Characters=false
|
|
||||||
Bookmark Menu Sorting=0
|
|
||||||
Bracket Match Preview=true
|
|
||||||
Chars To Enclose Selection=<>(){}[]'"
|
|
||||||
Default Mark Type=1
|
|
||||||
Dynamic Word Wrap=true
|
|
||||||
Dynamic Word Wrap Align Indent=80
|
|
||||||
Dynamic Word Wrap At Static Marker=false
|
|
||||||
Dynamic Word Wrap Indicators=1
|
|
||||||
Dynamic Wrap not at word boundaries=false
|
|
||||||
Enable Accessibility=true
|
|
||||||
Enable Tab completion=false
|
|
||||||
Enter To Insert Completion=true
|
|
||||||
Fold First Line=false
|
|
||||||
Folding Bar=true
|
|
||||||
Folding Preview=true
|
|
||||||
Icon Bar=false
|
|
||||||
Input Mode=1
|
|
||||||
Keyword Completion=true
|
|
||||||
Line Modification=true
|
|
||||||
Line Numbers=true
|
|
||||||
Max Clipboard History Entries=20
|
|
||||||
Maximum Search History Size=100
|
|
||||||
Mouse Paste At Cursor Position=false
|
|
||||||
Multiple Cursor Modifier=134217728
|
|
||||||
Persistent Selection=false
|
|
||||||
Scroll Bar Marks=false
|
|
||||||
Scroll Bar Mini Map All=true
|
|
||||||
Scroll Bar Mini Map Width=60
|
|
||||||
Scroll Bar MiniMap=false
|
|
||||||
Scroll Bar Preview=true
|
|
||||||
Scroll Past End=false
|
|
||||||
Search/Replace Flags=140
|
|
||||||
Shoe Line Ending Type in Statusbar=false
|
|
||||||
Show Documentation With Completion=true
|
|
||||||
Show File Encoding=true
|
|
||||||
Show Folding Icons On Hover Only=true
|
|
||||||
Show Line Count=true
|
|
||||||
Show Scrollbars=0
|
|
||||||
Show Statusbar Dictionary=true
|
|
||||||
Show Statusbar Highlighting Mode=true
|
|
||||||
Show Statusbar Input Mode=true
|
|
||||||
Show Statusbar Line Column=true
|
|
||||||
Show Statusbar Tab Settings=true
|
|
||||||
Show Word Count=true
|
|
||||||
Smart Copy Cut=true
|
|
||||||
Statusbar Line Column Compact Mode=true
|
|
||||||
Text Drag And Drop=true
|
|
||||||
User Sets Of Chars To Enclose Selection=
|
|
||||||
Vi Input Mode Steal Keys=false
|
|
||||||
Vi Relative Line Numbers=false
|
|
||||||
Word Completion=true
|
|
||||||
Word Completion Minimal Word Length=3
|
|
||||||
Word Completion Remove Tail=true
|
|
||||||
|
|
||||||
[Konsole]
|
|
||||||
AutoSyncronizeMode=0
|
|
||||||
KonsoleEscKeyBehaviour=false
|
|
||||||
KonsoleEscKeyExceptions=vi,vim,nvim,git
|
|
||||||
RemoveExtension=false
|
|
||||||
RunPrefix=
|
|
||||||
SetEditor=false
|
|
||||||
|
|
||||||
[MainWindow]
|
|
||||||
1366x768 screen: Window-Maximized=true
|
|
||||||
ToolBarsMovable=Disabled
|
|
||||||
|
|
||||||
[Printing][HeaderFooter]
|
|
||||||
FooterBackground=211,211,211
|
|
||||||
FooterBackgroundEnabled=false
|
|
||||||
FooterEnabled=true
|
|
||||||
FooterForeground=0,0,0
|
|
||||||
FooterFormatCenter=
|
|
||||||
FooterFormatLeft=
|
|
||||||
FooterFormatRight=%U
|
|
||||||
HeaderBackground=211,211,211
|
|
||||||
HeaderBackgroundEnabled=false
|
|
||||||
HeaderEnabled=true
|
|
||||||
HeaderFooterFont=monospace,10,-1,5,400,0,0,0,1,0,0,0,0,0,0,1
|
|
||||||
HeaderForeground=0,0,0
|
|
||||||
HeaderFormatCenter=%f
|
|
||||||
HeaderFormatLeft=%y
|
|
||||||
HeaderFormatRight=%p
|
|
||||||
|
|
||||||
[Printing][Layout]
|
|
||||||
BackgroundColorEnabled=false
|
|
||||||
BoxColor=invalid
|
|
||||||
BoxEnabled=false
|
|
||||||
BoxMargin=6
|
|
||||||
BoxWidth=1
|
|
||||||
ColorScheme=Printing
|
|
||||||
Font=monospace,10,-1,5,400,0,0,0,1,0,0,0,0,0,0,1
|
|
||||||
|
|
||||||
[Printing][Text]
|
|
||||||
DontPrintFoldedCode=true
|
|
||||||
Legend=false
|
|
||||||
LineNumbers=false
|
|
||||||
|
|
||||||
[Shortcut Schemes]
|
|
||||||
Current Scheme=Default
|
|
||||||
|
|
||||||
[Shortcuts]
|
|
||||||
kate_mdi_focus_toolview_kate_private_plugin_katekonsoleplugin=;\s
|
|
||||||
kate_mdi_sidebar_visibility=;\s
|
|
||||||
kate_mdi_toolview_kate_private_plugin_katekonsoleplugin=;\s
|
|
||||||
kate_mdi_toolview_kateproject=Ctrl+B
|
|
||||||
kate_mdi_toolview_kateprojectinfo=Alt+T
|
|
||||||
|
|
||||||
[debugplugin]
|
|
||||||
DAPConfiguration=
|
|
||||||
|
|
||||||
[filetree]
|
|
||||||
editShade=183,220,246
|
|
||||||
listMode=false
|
|
||||||
middleClickToClose=false
|
|
||||||
shadingEnabled=true
|
|
||||||
showCloseButton=false
|
|
||||||
showFullPathOnRoots=false
|
|
||||||
showToolbar=true
|
|
||||||
sortRole=0
|
|
||||||
viewShade=211,190,222
|
|
||||||
|
|
||||||
[lspclient]
|
|
||||||
AllowedServerCommandLines=/usr/bin/pylsp --check-parent-process
|
|
||||||
AutoHover=true
|
|
||||||
AutoImport=true
|
|
||||||
BlockedServerCommandLines=
|
|
||||||
CompletionDocumentation=true
|
|
||||||
CompletionParens=true
|
|
||||||
Diagnostics=true
|
|
||||||
FormatOnSave=false
|
|
||||||
HighlightGoto=true
|
|
||||||
IncrementalSync=true
|
|
||||||
InlayHints=false
|
|
||||||
Messages=true
|
|
||||||
ReferencesDeclaration=true
|
|
||||||
SemanticHighlighting=true
|
|
||||||
ServerConfiguration=
|
|
||||||
SignatureHelp=true
|
|
||||||
SymbolDetails=false
|
|
||||||
SymbolExpand=true
|
|
||||||
SymbolSort=false
|
|
||||||
SymbolTree=true
|
|
||||||
TypeFormatting=false
|
|
@ -3880,59 +3880,31 @@ class Command(enum.StrEnum):
|
|||||||
backup = 'backup'
|
backup = 'backup'
|
||||||
pip_resolve = 'pip_resolve'
|
pip_resolve = 'pip_resolve'
|
||||||
|
|
||||||
def pip_resolve(
|
def pip_resolve(args: list[str]) -> None:
|
||||||
args: list[str],
|
|
||||||
) -> None:
|
|
||||||
from online.fxreader.pr34.commands_typed.pip import pip_resolve, pip_resolve_t
|
|
||||||
|
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
'-m', '--mode',
|
'-m', '--mode',
|
||||||
choices=[
|
choices=['copy_paste', 'monkey_patch'],
|
||||||
o.value
|
|
||||||
for o in pip_resolve_t.kwargs_t.mode_t
|
|
||||||
],
|
|
||||||
required=True,
|
required=True,
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
|
||||||
'-r', '--requirement',
|
|
||||||
default=[],
|
|
||||||
dest='requirements',
|
|
||||||
type=str,
|
|
||||||
action='append',
|
|
||||||
help=r'''
|
|
||||||
requirement,
|
|
||||||
can be multiple in a single parameter,
|
|
||||||
all of them are to be split by whitespace
|
|
||||||
and printed into a temp file,
|
|
||||||
that is fed into uv pip compile
|
|
||||||
''',
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
options, argv = parser.parse_known_args(args)
|
options, argv = parser.parse_known_args(args)
|
||||||
|
|
||||||
requirements : Optional[list[str]] = []
|
from online.fxreader.pr34.commands_typed.pip import pip_resolve
|
||||||
|
sys.stdout.write('\n'.join([
|
||||||
for o in options.requirements:
|
'#%s\n%s %s' % (
|
||||||
requirements.extend(o.split())
|
o.url,
|
||||||
|
o.constraint,
|
||||||
if len(requirements) == 0:
|
' '.join([
|
||||||
requirements = None
|
'--hash=sha256:%s' % o2
|
||||||
|
for o2 in o.sha256
|
||||||
options.mode = pip_resolve_t.kwargs_t.mode_t(
|
])
|
||||||
options.mode
|
|
||||||
)
|
)
|
||||||
|
for o in pip_resolve(
|
||||||
resolve_res = pip_resolve(
|
|
||||||
argv,
|
argv,
|
||||||
mode=options.mode,
|
mode=options.mode,
|
||||||
requirements=requirements,
|
|
||||||
)
|
)
|
||||||
|
]))
|
||||||
assert not resolve_res.txt is None
|
|
||||||
|
|
||||||
sys.stdout.write(resolve_res.txt)
|
|
||||||
sys.stdout.flush()
|
sys.stdout.flush()
|
||||||
|
|
||||||
def commands_cli(
|
def commands_cli(
|
||||||
|
@ -141,10 +141,7 @@ class CLI(abc.ABC):
|
|||||||
if not d.args is None:
|
if not d.args is None:
|
||||||
cmd.extend(d.args)
|
cmd.extend(d.args)
|
||||||
|
|
||||||
subprocess.check_call(
|
subprocess.check_call(cmd)
|
||||||
cmd,
|
|
||||||
cwd=d.source_path,
|
|
||||||
)
|
|
||||||
else:
|
else:
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
@ -199,7 +196,6 @@ class CLI(abc.ABC):
|
|||||||
force: Optional[bool] = None,
|
force: Optional[bool] = None,
|
||||||
env: Optional[dict[str, str]] = None,
|
env: Optional[dict[str, str]] = None,
|
||||||
mypy: bool = False,
|
mypy: bool = False,
|
||||||
tests: bool = False,
|
|
||||||
) -> None:
|
) -> None:
|
||||||
project = self.projects[project_name]
|
project = self.projects[project_name]
|
||||||
|
|
||||||
@ -216,11 +212,6 @@ class CLI(abc.ABC):
|
|||||||
# assert argv is None or len(argv) == 0
|
# assert argv is None or len(argv) == 0
|
||||||
|
|
||||||
if not project.meson_path is None:
|
if not project.meson_path is None:
|
||||||
if tests:
|
|
||||||
self.meson_test(
|
|
||||||
project_name=project_name,
|
|
||||||
)
|
|
||||||
|
|
||||||
self.meson_install(
|
self.meson_install(
|
||||||
project_name=project_name,
|
project_name=project_name,
|
||||||
force=force,
|
force=force,
|
||||||
@ -266,16 +257,6 @@ class CLI(abc.ABC):
|
|||||||
env=dict(list(os.environ.items())) | env,
|
env=dict(list(os.environ.items())) | env,
|
||||||
)
|
)
|
||||||
|
|
||||||
if tests:
|
|
||||||
subprocess.check_call(
|
|
||||||
[
|
|
||||||
'ninja',
|
|
||||||
'-C',
|
|
||||||
str(project.build_dir / 'pyproject'),
|
|
||||||
'test',
|
|
||||||
]
|
|
||||||
)
|
|
||||||
|
|
||||||
def meson_install(
|
def meson_install(
|
||||||
self,
|
self,
|
||||||
project_name: str,
|
project_name: str,
|
||||||
@ -335,25 +316,6 @@ class CLI(abc.ABC):
|
|||||||
*argv,
|
*argv,
|
||||||
])
|
])
|
||||||
|
|
||||||
def meson_test(
|
|
||||||
self,
|
|
||||||
project_name: str,
|
|
||||||
argv: Optional[list[str]] = None,
|
|
||||||
) -> None:
|
|
||||||
project = self.projects[project_name]
|
|
||||||
|
|
||||||
if argv is None:
|
|
||||||
argv = []
|
|
||||||
|
|
||||||
subprocess.check_call([
|
|
||||||
shutil_which('meson', True,),
|
|
||||||
'test',
|
|
||||||
'-C',
|
|
||||||
project.build_dir / 'meson',
|
|
||||||
*argv,
|
|
||||||
])
|
|
||||||
|
|
||||||
|
|
||||||
def meson_compile(
|
def meson_compile(
|
||||||
self,
|
self,
|
||||||
project_name: str,
|
project_name: str,
|
||||||
|
@ -115,21 +115,8 @@ def env_bootstrap(
|
|||||||
bootstrap_settings: BootstrapSettings,
|
bootstrap_settings: BootstrapSettings,
|
||||||
pyproject: PyProject,
|
pyproject: PyProject,
|
||||||
) -> None:
|
) -> None:
|
||||||
pip_find_links : list[pathlib.Path] = []
|
|
||||||
|
|
||||||
if not pyproject.pip_find_links is None:
|
|
||||||
pip_find_links.extend(pyproject.pip_find_links)
|
|
||||||
|
|
||||||
pip_find_links_args = sum([
|
|
||||||
['-f', str(o),]
|
|
||||||
for o in pip_find_links
|
|
||||||
], [])
|
|
||||||
|
|
||||||
subprocess.check_call([
|
subprocess.check_call([
|
||||||
'uv', 'venv',
|
'uv', 'venv', '--seed', '--offline',
|
||||||
*pip_find_links_args,
|
|
||||||
# '--seed',
|
|
||||||
'--offline',
|
|
||||||
str(bootstrap_settings.env_path)
|
str(bootstrap_settings.env_path)
|
||||||
])
|
])
|
||||||
|
|
||||||
@ -137,18 +124,16 @@ def env_bootstrap(
|
|||||||
'uv',
|
'uv',
|
||||||
'pip',
|
'pip',
|
||||||
'install',
|
'install',
|
||||||
*pip_find_links_args,
|
|
||||||
'-p',
|
'-p',
|
||||||
bootstrap_settings.python_path,
|
bootstrap_settings.python_path,
|
||||||
'--offline',
|
'--offline',
|
||||||
'uv', 'pip',
|
'uv',
|
||||||
])
|
])
|
||||||
|
|
||||||
subprocess.check_call([
|
subprocess.check_call([
|
||||||
bootstrap_settings.python_path,
|
bootstrap_settings.python_path,
|
||||||
'-m',
|
'-m',
|
||||||
'uv', 'pip', 'install',
|
'uv', 'pip', 'install',
|
||||||
*pip_find_links_args,
|
|
||||||
'--offline',
|
'--offline',
|
||||||
'build', 'setuptools', 'meson-python', 'pybind11',
|
'build', 'setuptools', 'meson-python', 'pybind11',
|
||||||
])
|
])
|
||||||
@ -168,6 +153,11 @@ def env_bootstrap(
|
|||||||
# *early_wheels,
|
# *early_wheels,
|
||||||
# ])
|
# ])
|
||||||
|
|
||||||
|
pip_find_links : list[pathlib.Path] = []
|
||||||
|
|
||||||
|
if not pyproject.pip_find_links is None:
|
||||||
|
pip_find_links.extend(pyproject.pip_find_links)
|
||||||
|
|
||||||
if pyproject.early_features:
|
if pyproject.early_features:
|
||||||
early_dependencies = sum([
|
early_dependencies = sum([
|
||||||
pyproject.dependencies[o]
|
pyproject.dependencies[o]
|
||||||
@ -183,7 +173,10 @@ def env_bootstrap(
|
|||||||
bootstrap_settings.python_path,
|
bootstrap_settings.python_path,
|
||||||
'-m',
|
'-m',
|
||||||
'uv', 'pip', 'install',
|
'uv', 'pip', 'install',
|
||||||
*pip_find_links_args,
|
*sum([
|
||||||
|
['-f', str(o),]
|
||||||
|
for o in pip_find_links
|
||||||
|
], []),
|
||||||
# '-f', str(pathlib.Path(__file__).parent / 'deps' / 'dist'),
|
# '-f', str(pathlib.Path(__file__).parent / 'deps' / 'dist'),
|
||||||
'--offline',
|
'--offline',
|
||||||
*early_dependencies,
|
*early_dependencies,
|
||||||
|
@ -1,16 +1,6 @@
|
|||||||
import contextlib
|
import contextlib
|
||||||
import pathlib
|
import pathlib
|
||||||
import sys
|
|
||||||
import enum
|
|
||||||
import dataclasses
|
import dataclasses
|
||||||
import subprocess
|
|
||||||
import tempfile
|
|
||||||
|
|
||||||
import unittest.mock
|
|
||||||
import logging
|
|
||||||
import typing
|
|
||||||
|
|
||||||
if typing.TYPE_CHECKING:
|
|
||||||
import pip._internal.commands.show
|
import pip._internal.commands.show
|
||||||
import pip._internal.commands.download
|
import pip._internal.commands.download
|
||||||
import pip._internal.cli.main_parser
|
import pip._internal.cli.main_parser
|
||||||
@ -21,34 +11,24 @@ if typing.TYPE_CHECKING:
|
|||||||
import pip._internal.resolution.base
|
import pip._internal.resolution.base
|
||||||
import pip._internal.resolution.resolvelib.resolver
|
import pip._internal.resolution.resolvelib.resolver
|
||||||
import pip._internal.operations.prepare
|
import pip._internal.operations.prepare
|
||||||
|
import unittest.mock
|
||||||
|
import logging
|
||||||
|
|
||||||
from typing import (
|
from typing import (Literal,)
|
||||||
Literal, Optional, Iterable, Any,
|
|
||||||
)
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
def pip_show(
|
def pip_show(
|
||||||
argv: list[str],
|
argv: list[str],
|
||||||
) -> list['pip._internal.commands.show._PackageInfo']:
|
) -> list[pip._internal.commands.show._PackageInfo]:
|
||||||
import pip._internal.commands.show
|
|
||||||
return list(
|
return list(
|
||||||
pip._internal.commands.show.search_packages_info(
|
pip._internal.commands.show.search_packages_info(
|
||||||
argv,
|
argv,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class pip_resolve_t:
|
class pip_resolve_t:
|
||||||
class kwargs_t:
|
|
||||||
class mode_t(enum.StrEnum):
|
|
||||||
copy_paste = "copy_paste"
|
|
||||||
monkey_patch = "monkey_patch"
|
|
||||||
uv_pip_freeze = "uv_pip_freeze"
|
|
||||||
uv_pip_compile = "uv_pip_compile"
|
|
||||||
|
|
||||||
@dataclasses.dataclass
|
|
||||||
class res_t:
|
class res_t:
|
||||||
@dataclasses.dataclass
|
@dataclasses.dataclass
|
||||||
class download_info_t:
|
class download_info_t:
|
||||||
@ -56,54 +36,25 @@ class pip_resolve_t:
|
|||||||
sha256: str
|
sha256: str
|
||||||
constraint: str
|
constraint: str
|
||||||
|
|
||||||
txt: Optional[str] = None
|
|
||||||
entries: Optional[list[download_info_t]] = None
|
|
||||||
|
|
||||||
|
|
||||||
def pip_resolve_entries_to_txt(
|
|
||||||
entries: list[pip_resolve_t.res_t.download_info_t]
|
|
||||||
) -> str:
|
|
||||||
return '\n'.join([
|
|
||||||
'#%s\n%s %s' % (
|
|
||||||
o.url,
|
|
||||||
o.constraint,
|
|
||||||
' '.join([
|
|
||||||
'--hash=sha256:%s' % o2
|
|
||||||
for o2 in o.sha256
|
|
||||||
])
|
|
||||||
)
|
|
||||||
for o in entries
|
|
||||||
])
|
|
||||||
|
|
||||||
def pip_resolve(
|
def pip_resolve(
|
||||||
argv: list[str],
|
argv: list[str],
|
||||||
mode: pip_resolve_t.kwargs_t.mode_t,
|
mode: Literal['copy_paste', 'monkey_patch'],
|
||||||
requirements: Optional[list[str]] = None,
|
) -> list[
|
||||||
) -> pip_resolve_t.res_t:
|
pip_resolve_t.res_t.download_info_t
|
||||||
if mode is pip_resolve_t.kwargs_t.mode_t.copy_paste:
|
]:
|
||||||
import pip._internal.commands.show
|
if mode == 'copy_paste':
|
||||||
import pip._internal.commands.download
|
|
||||||
import pip._internal.cli.cmdoptions
|
|
||||||
import pip._internal.cli.main_parser
|
|
||||||
import pip._internal.models.index
|
|
||||||
import pip._internal.utils.temp_dir
|
|
||||||
import pip._internal.cli.main
|
|
||||||
import pip._internal.network.download
|
|
||||||
import pip._internal.resolution.base
|
|
||||||
import pip._internal.req.req_install
|
|
||||||
import pip._internal.resolution.resolvelib.resolver
|
|
||||||
import pip._internal.operations.prepare
|
|
||||||
import pip._internal.utils.temp_dir
|
|
||||||
import pip._internal.operations.build.build_tracker
|
|
||||||
import pip._internal.models.direct_url
|
|
||||||
|
|
||||||
with contextlib.ExitStack() as stack:
|
with contextlib.ExitStack() as stack:
|
||||||
stack.enter_context(pip._internal.utils.temp_dir.global_tempdir_manager())
|
stack.enter_context(
|
||||||
|
pip._internal.utils.temp_dir.global_tempdir_manager()
|
||||||
|
)
|
||||||
|
|
||||||
t2 = pip._internal.cli.main_parser.create_main_parser()
|
t2 = pip._internal.cli.main_parser.create_main_parser()
|
||||||
|
|
||||||
t3 = t2.parse_args(["download"])
|
t3 = t2.parse_args(['download'])
|
||||||
t1 = pip._internal.commands.download.DownloadCommand("blah", "shit")
|
t1 = pip._internal.commands.download.DownloadCommand(
|
||||||
|
'blah',
|
||||||
|
'shit'
|
||||||
|
)
|
||||||
|
|
||||||
stack.enter_context(t1.main_context())
|
stack.enter_context(t1.main_context())
|
||||||
|
|
||||||
@ -131,33 +82,28 @@ def pip_resolve(
|
|||||||
options.check_build_deps = None
|
options.check_build_deps = None
|
||||||
options.progress_bar = True
|
options.progress_bar = True
|
||||||
options.require_hashes = None
|
options.require_hashes = None
|
||||||
options.ignore_requires_python = False
|
options.ignore_requires_python = None
|
||||||
#options.cache_dir
|
#options.cache_dir
|
||||||
pip._internal.cli.cmdoptions.check_dist_restriction(options)
|
pip._internal.commands.download.cmdoptions.check_dist_restriction(options)
|
||||||
# t1._in_main_context = True
|
# t1._in_main_context = True
|
||||||
session = t1.get_default_session(options)
|
session = t1.get_default_session(options)
|
||||||
target_python = pip._internal.cli.cmdoptions.make_target_python(options)
|
target_python = pip._internal.commands.download.make_target_python(options)
|
||||||
finder = t1._build_package_finder(
|
finder = t1._build_package_finder(
|
||||||
options=options,
|
options=options,
|
||||||
session=session,
|
session=session,
|
||||||
target_python=target_python,
|
target_python=target_python,
|
||||||
ignore_requires_python=options.ignore_requires_python,
|
ignore_requires_python=options.ignore_requires_python,
|
||||||
)
|
)
|
||||||
build_tracker = t1.enter_context(
|
build_tracker = t1.enter_context(pip._internal.commands.download.get_build_tracker())
|
||||||
pip._internal.operations.build.build_tracker.get_build_tracker()
|
reqs = t1.get_requirements([
|
||||||
)
|
|
||||||
reqs = t1.get_requirements(
|
|
||||||
[
|
|
||||||
#'pip', 'uv', 'ipython',
|
#'pip', 'uv', 'ipython',
|
||||||
*argv,
|
*argv,
|
||||||
],
|
], options, finder, session)
|
||||||
options,
|
pip._internal.commands.download.check_legacy_setup_py_options(options, reqs)
|
||||||
finder,
|
directory = pip._internal.commands.download.TempDirectory(
|
||||||
session,
|
delete=True,
|
||||||
)
|
kind='download',
|
||||||
pip._internal.req.req_install.check_legacy_setup_py_options(options, reqs)
|
globally_managed=True
|
||||||
directory = pip._internal.utils.temp_dir.TempDirectory(
|
|
||||||
delete=True, kind="download", globally_managed=True
|
|
||||||
)
|
)
|
||||||
preparer = t1.make_requirement_preparer(
|
preparer = t1.make_requirement_preparer(
|
||||||
temp_build_dir=directory,
|
temp_build_dir=directory,
|
||||||
@ -180,127 +126,49 @@ def pip_resolve(
|
|||||||
t1.trace_basic_info(finder)
|
t1.trace_basic_info(finder)
|
||||||
requirement_set = resolver.resolve(reqs, check_supported_wheels=True)
|
requirement_set = resolver.resolve(reqs, check_supported_wheels=True)
|
||||||
|
|
||||||
res = pip_resolve_t.res_t()
|
return [
|
||||||
|
|
||||||
res.entries = []
|
|
||||||
|
|
||||||
for k, v in requirement_set.requirements.items():
|
|
||||||
assert not v.download_info is None
|
|
||||||
assert isinstance(
|
|
||||||
v.download_info.info,
|
|
||||||
pip._internal.models.direct_url.ArchiveInfo,
|
|
||||||
)
|
|
||||||
assert not v.download_info.info.hashes is None
|
|
||||||
|
|
||||||
res.entries.append(
|
|
||||||
pip_resolve_t.res_t.download_info_t(
|
pip_resolve_t.res_t.download_info_t(
|
||||||
constraint=k,
|
constraint=k,
|
||||||
sha256=v.download_info.info.hashes["sha256"],
|
sha256=v.download_info.info.hashes['sha256'],
|
||||||
url=v.download_info.url,
|
url=v.download_info.url,
|
||||||
)
|
)
|
||||||
)
|
for k, v in requirement_set.requirements.items()
|
||||||
|
]
|
||||||
res.txt = pip_resolve_entries_to_txt(
|
elif mode == 'monkey_patch':
|
||||||
res.entries
|
|
||||||
)
|
|
||||||
|
|
||||||
return res
|
|
||||||
elif mode is pip_resolve_t.kwargs_t.mode_t.monkey_patch:
|
|
||||||
import pip._internal.commands.show
|
|
||||||
import pip._internal.commands.download
|
|
||||||
import pip._internal.cli.main_parser
|
|
||||||
import pip._internal.models.index
|
|
||||||
import pip._internal.models.link
|
|
||||||
from pip._internal.models.link import (
|
|
||||||
Link,
|
|
||||||
)
|
|
||||||
import pip._internal.utils.temp_dir
|
|
||||||
from pip._internal.metadata.base import (
|
|
||||||
BaseDistribution,
|
|
||||||
)
|
|
||||||
import pip._internal.cli.main
|
|
||||||
import pip._internal.network.download
|
|
||||||
import pip._internal.resolution.base
|
|
||||||
import pip._internal.resolution.resolvelib.resolver
|
|
||||||
import pip._internal.operations.prepare
|
|
||||||
from pip._internal.network.download import (
|
|
||||||
Downloader,
|
|
||||||
)
|
|
||||||
from pip._internal.operations.prepare import (
|
|
||||||
File,
|
|
||||||
)
|
|
||||||
from pip._internal.req.req_set import RequirementSet
|
|
||||||
from pip._internal.utils.hashes import Hashes
|
|
||||||
from pip._internal.req.req_install import InstallRequirement
|
|
||||||
|
|
||||||
downloader_call_def = pip._internal.network.download.Downloader.__call__
|
downloader_call_def = pip._internal.network.download.Downloader.__call__
|
||||||
|
|
||||||
def downloader_call(
|
def downloader_call(*args):
|
||||||
_self: pip._internal.network.download.Downloader,
|
logger.info(dict(
|
||||||
link: pip._internal.models.link.Link,
|
url=args[1].url,
|
||||||
location: str,
|
))
|
||||||
) -> tuple[str, str]:
|
|
||||||
logger.info(
|
|
||||||
dict(
|
|
||||||
url=link.url,
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
return downloader_call_def(
|
return downloader_call_def(*args)
|
||||||
_self,
|
|
||||||
link, location,
|
|
||||||
)
|
|
||||||
|
|
||||||
batch_downloader_call_def = (
|
batch_downloader_call_def = pip._internal.network.download.BatchDownloader.__call__
|
||||||
pip._internal.network.download.BatchDownloader.__call__
|
|
||||||
)
|
|
||||||
|
|
||||||
def batch_downloader_call(
|
def batch_downloader_call(*args):
|
||||||
_self: pip._internal.network.download.BatchDownloader,
|
|
||||||
links: Iterable[pip._internal.models.link.Link],
|
|
||||||
location: str,
|
|
||||||
) -> Iterable[
|
|
||||||
tuple[
|
|
||||||
pip._internal.models.link.Link,
|
|
||||||
tuple[str, str]
|
|
||||||
]
|
|
||||||
]:
|
|
||||||
# print(args)
|
# print(args)
|
||||||
|
|
||||||
logger.info(
|
logger.info(dict(
|
||||||
dict(
|
args=args,
|
||||||
links=links,
|
))
|
||||||
location=location,
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
return [
|
return [
|
||||||
(o, ("/dev/null", ''))
|
(o, ('/dev/null', None))
|
||||||
for o in links
|
for o in args[1]
|
||||||
]
|
]
|
||||||
|
|
||||||
#base_resolver_resolve_def = pip._internal.resolution.base.BaseResolver.resolve
|
#base_resolver_resolve_def = pip._internal.resolution.base.BaseResolver.resolve
|
||||||
base_resolver_resolve_def = (
|
base_resolver_resolve_def = pip._internal.resolution.resolvelib.resolver.Resolver.resolve
|
||||||
pip._internal.resolution.resolvelib.resolver.Resolver.resolve
|
|
||||||
)
|
|
||||||
|
|
||||||
result_requirements : list[
|
result_requirements = []
|
||||||
RequirementSet | InstallRequirement
|
|
||||||
] = []
|
|
||||||
|
|
||||||
def base_resolver_resolve(
|
def base_resolver_resolve(*args, **kwargs):
|
||||||
_self: pip._internal.resolution.resolvelib.resolver.Resolver,
|
|
||||||
root_reqs: list[
|
|
||||||
InstallRequirement,
|
|
||||||
],
|
|
||||||
check_supported_wheels: bool,
|
|
||||||
) -> RequirementSet:
|
|
||||||
# print(args, kwargs)
|
# print(args, kwargs)
|
||||||
|
|
||||||
res = base_resolver_resolve_def(
|
res = base_resolver_resolve_def(
|
||||||
_self,
|
*args,
|
||||||
root_reqs,
|
**kwargs
|
||||||
check_supported_wheels
|
|
||||||
)
|
)
|
||||||
|
|
||||||
result_requirements.append(res)
|
result_requirements.append(res)
|
||||||
@ -309,27 +177,18 @@ def pip_resolve(
|
|||||||
|
|
||||||
get_http_url_def = pip._internal.operations.prepare.get_http_url
|
get_http_url_def = pip._internal.operations.prepare.get_http_url
|
||||||
|
|
||||||
def get_http_url(
|
def get_http_url(link, download, download_dir=None, hashes=None):
|
||||||
link: Link,
|
|
||||||
download: Downloader,
|
logger.info(dict(
|
||||||
download_dir: Optional[str] = None,
|
|
||||||
hashes: Optional[Hashes] = None,
|
|
||||||
) -> File:
|
|
||||||
logger.info(
|
|
||||||
dict(
|
|
||||||
url=link.url,
|
url=link.url,
|
||||||
hashes=hashes,
|
hashes=hashes,
|
||||||
)
|
))
|
||||||
)
|
|
||||||
|
|
||||||
if link.url.endswith(".whl"):
|
if link.url.endswith('.whl'):
|
||||||
print("blah")
|
print('blah')
|
||||||
hashes = None
|
hashes = None
|
||||||
|
|
||||||
return File(
|
return '/dev/null', None
|
||||||
"/dev/null",
|
|
||||||
'',
|
|
||||||
)
|
|
||||||
else:
|
else:
|
||||||
return get_http_url_def(
|
return get_http_url_def(
|
||||||
link,
|
link,
|
||||||
@ -338,35 +197,32 @@ def pip_resolve(
|
|||||||
hashes
|
hashes
|
||||||
)
|
)
|
||||||
|
|
||||||
prepare_linked_requirements_more_def = pip._internal.operations.prepare.RequirementPreparer.prepare_linked_requirements_more
|
prepare_linked_requirements_more_def = \
|
||||||
|
pip._internal.operations.prepare.RequirementPreparer\
|
||||||
|
.prepare_linked_requirements_more
|
||||||
|
|
||||||
def prepare_linked_requirements_more(
|
def prepare_linked_requirements_more(
|
||||||
_self: pip._internal.resolution.resolvelib.resolver.Resolver,
|
_self, reqs, *args, **kwargs
|
||||||
reqs: Iterable[InstallRequirement],
|
):
|
||||||
parallel_builds: bool = False,
|
result_requirements.append(reqs)
|
||||||
) -> None:
|
|
||||||
result_requirements.extend(
|
|
||||||
reqs
|
|
||||||
)
|
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
_complete_partial_requirements_def = pip._internal.operations.prepare.RequirementPreparer._complete_partial_requirements
|
_complete_partial_requirements_def = \
|
||||||
|
pip._internal.operations.prepare.RequirementPreparer\
|
||||||
|
._complete_partial_requirements
|
||||||
|
|
||||||
def _complete_partial_requirements(
|
def _complete_partial_requirements(
|
||||||
_self: pip._internal.resolution.resolvelib.resolver.Resolver,
|
_self, reqs, *args, **kwargs
|
||||||
partially_downloaded_reqs: Iterable[InstallRequirement],
|
):
|
||||||
parallel_builds: bool = False,
|
result_requirements.append(reqs)
|
||||||
) -> None:
|
|
||||||
result_requirements.extend(
|
|
||||||
partially_downloaded_reqs
|
|
||||||
)
|
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
patches : list[Any] = []
|
patches = []
|
||||||
|
|
||||||
patches.append(
|
patches.append(
|
||||||
unittest.mock.patch.object(
|
unittest.mock.patch.object(
|
||||||
pip._internal.network.download.Downloader, "__call__", downloader_call
|
pip._internal.network.download.Downloader,
|
||||||
|
'__call__',
|
||||||
|
downloader_call
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
#patches.append(
|
#patches.append(
|
||||||
@ -383,22 +239,22 @@ def pip_resolve(
|
|||||||
patches.append(
|
patches.append(
|
||||||
unittest.mock.patch.object(
|
unittest.mock.patch.object(
|
||||||
pip._internal.resolution.resolvelib.resolver.Resolver,
|
pip._internal.resolution.resolvelib.resolver.Resolver,
|
||||||
"resolve",
|
'resolve',
|
||||||
base_resolver_resolve,
|
base_resolver_resolve
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
patches.append(
|
patches.append(
|
||||||
unittest.mock.patch.object(
|
unittest.mock.patch.object(
|
||||||
pip._internal.operations.prepare,
|
pip._internal.operations.prepare,
|
||||||
"get_http_url",
|
'get_http_url',
|
||||||
get_http_url,
|
get_http_url,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
patches.append(
|
patches.append(
|
||||||
unittest.mock.patch.object(
|
unittest.mock.patch.object(
|
||||||
pip._internal.operations.prepare.RequirementPreparer,
|
pip._internal.operations.prepare.RequirementPreparer,
|
||||||
"prepare_linked_requirements_more",
|
'prepare_linked_requirements_more',
|
||||||
prepare_linked_requirements_more,
|
prepare_linked_requirements_more
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
#patches.append(
|
#patches.append(
|
||||||
@ -413,17 +269,15 @@ def pip_resolve(
|
|||||||
for p in patches:
|
for p in patches:
|
||||||
stack.enter_context(p)
|
stack.enter_context(p)
|
||||||
|
|
||||||
pip._internal.cli.main.main(
|
pip._internal.cli.main.main([
|
||||||
[
|
'download',
|
||||||
"download",
|
'-q',
|
||||||
"-q",
|
'--no-cache',
|
||||||
"--no-cache",
|
'-d',
|
||||||
"-d",
|
'/dev/null',
|
||||||
"/dev/null",
|
|
||||||
*argv,
|
*argv,
|
||||||
# 'numpy',
|
# 'numpy',
|
||||||
]
|
])
|
||||||
)
|
|
||||||
|
|
||||||
#return sum([
|
#return sum([
|
||||||
# [
|
# [
|
||||||
@ -437,88 +291,13 @@ def pip_resolve(
|
|||||||
# for o in result_requirements
|
# for o in result_requirements
|
||||||
#], [])
|
#], [])
|
||||||
logger.warn(result_requirements)
|
logger.warn(result_requirements)
|
||||||
|
return [
|
||||||
res = pip_resolve_t.res_t()
|
|
||||||
|
|
||||||
res.entries = []
|
|
||||||
|
|
||||||
for o in result_requirements:
|
|
||||||
assert isinstance(o, InstallRequirement)
|
|
||||||
|
|
||||||
sha256_hashes = o.hashes()._allowed["sha256"]
|
|
||||||
assert len(sha256_hashes) == 1
|
|
||||||
assert not o.link is None
|
|
||||||
|
|
||||||
res.entries.append(
|
|
||||||
pip_resolve_t.res_t.download_info_t(
|
pip_resolve_t.res_t.download_info_t(
|
||||||
constraint=str(o.req),
|
constraint=str(o.req),
|
||||||
sha256=sha256_hashes[0],
|
sha256=o.hashes()._allowed['sha256'],
|
||||||
url=o.link.url,
|
url=o.link.url,
|
||||||
)
|
)
|
||||||
)
|
for o in sum(result_requirements, [])
|
||||||
|
]
|
||||||
res.txt = pip_resolve_entries_to_txt(
|
|
||||||
res.entries
|
|
||||||
)
|
|
||||||
|
|
||||||
return res
|
|
||||||
elif mode is pip_resolve_t.kwargs_t.mode_t.uv_pip_freeze:
|
|
||||||
assert len(argv) == 0
|
|
||||||
|
|
||||||
pip_freeze = subprocess.check_output(
|
|
||||||
[
|
|
||||||
sys.executable,
|
|
||||||
"-m",
|
|
||||||
"uv",
|
|
||||||
"pip",
|
|
||||||
"freeze",
|
|
||||||
],
|
|
||||||
).decode('utf-8')
|
|
||||||
pip_compile = subprocess.check_output(
|
|
||||||
[
|
|
||||||
sys.executable, '-m',
|
|
||||||
'uv', 'pip', 'compile',
|
|
||||||
'--generate-hashes',
|
|
||||||
'-',
|
|
||||||
|
|
||||||
],
|
|
||||||
input=pip_freeze.encode('utf-8')
|
|
||||||
).decode('utf-8')
|
|
||||||
|
|
||||||
return pip_resolve_t.res_t(
|
|
||||||
txt=pip_compile,
|
|
||||||
)
|
|
||||||
elif mode is pip_resolve_t.kwargs_t.mode_t.uv_pip_compile:
|
|
||||||
with contextlib.ExitStack() as stack:
|
|
||||||
if not requirements is None:
|
|
||||||
# assert len(argv) == 0
|
|
||||||
|
|
||||||
f = stack.enter_context(
|
|
||||||
tempfile.NamedTemporaryFile(
|
|
||||||
suffix='.txt',
|
|
||||||
)
|
|
||||||
)
|
|
||||||
f.write(
|
|
||||||
('\n'.join(requirements)).encode('utf-8')
|
|
||||||
)
|
|
||||||
f.flush()
|
|
||||||
|
|
||||||
argv.append(f.name)
|
|
||||||
|
|
||||||
if argv[0] == '--':
|
|
||||||
del argv[0]
|
|
||||||
|
|
||||||
pip_compile = subprocess.check_output(
|
|
||||||
[
|
|
||||||
sys.executable, '-m',
|
|
||||||
'uv', 'pip', 'compile',
|
|
||||||
'--generate-hashes',
|
|
||||||
*argv,
|
|
||||||
],
|
|
||||||
).decode('utf-8')
|
|
||||||
|
|
||||||
return pip_resolve_t.res_t(
|
|
||||||
txt=pip_compile,
|
|
||||||
)
|
|
||||||
else:
|
else:
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[project]
|
[project]
|
||||||
name = 'online.fxreader.pr34'
|
name = 'online.fxreader.pr34'
|
||||||
version = '0.1.4.12'
|
version = '0.1.4.9'
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
#"-r requirements.txt",
|
#"-r requirements.txt",
|
||||||
|
1
requirements-archlinux.txt
Normal file
1
requirements-archlinux.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
python-build
|
16
requirements.txt
Normal file
16
requirements.txt
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
ipython
|
||||||
|
jupyter
|
||||||
|
notebook
|
||||||
|
requests
|
||||||
|
pyquery
|
||||||
|
youtube-dl
|
||||||
|
gdown
|
||||||
|
aiohttp
|
||||||
|
mypy
|
||||||
|
ruff
|
||||||
|
cython
|
||||||
|
numpy
|
||||||
|
scoping
|
||||||
|
types-setuptools
|
||||||
|
uvloop
|
||||||
|
pydantic
|
Loading…
Reference in New Issue
Block a user