├── .gitignore
├── LICENSE
├── README.md
├── boss.json
├── packages
├── P4DLightweightWrappersComponentSuite.groupproj
├── P4DLightweightWrappersComponentSuite.prjmgc
├── P4DPyPackage.dpk
├── P4DPyPackage.dproj
├── dclP4DPyPackage.dpk
└── dclP4DPyPackage.dproj
└── src
├── Manager
├── Cmd
│ ├── Conda
│ │ ├── PyPackage.Manager.Cmd.Conda.Install.pas
│ │ ├── PyPackage.Manager.Cmd.Conda.List.pas
│ │ ├── PyPackage.Manager.Cmd.Conda.Uninstall.pas
│ │ └── PyPackage.Manager.Cmd.Conda.pas
│ ├── Pip
│ │ ├── PyPackage.Manager.Cmd.Pip.Install.pas
│ │ ├── PyPackage.Manager.Cmd.Pip.List.pas
│ │ ├── PyPackage.Manager.Cmd.Pip.Uninstall.pas
│ │ └── PyPackage.Manager.Cmd.Pip.pas
│ ├── PyPackage.Manager.Cmd.Intf.pas
│ └── PyPackage.Manager.Cmd.pas
├── Defs
│ ├── Opts
│ │ ├── Conda
│ │ │ ├── PyPackage.Manager.Defs.Opts.Conda.Create.pas
│ │ │ ├── PyPackage.Manager.Defs.Opts.Conda.Install.pas
│ │ │ ├── PyPackage.Manager.Defs.Opts.Conda.List.pas
│ │ │ └── PyPackage.Manager.Defs.Opts.Conda.Uninstall.pas
│ │ ├── Pip
│ │ │ ├── PyPackage.Manager.Defs.Opts.Pip.Install.pas
│ │ │ ├── PyPackage.Manager.Defs.Opts.Pip.List.pas
│ │ │ └── PyPackage.Manager.Defs.Opts.Pip.Uninstall.pas
│ │ └── PyPackage.Manager.Defs.Opts.pas
│ ├── PyPackage.Manager.Defs.Conda.pas
│ ├── PyPackage.Manager.Defs.Pip.pas
│ └── PyPackage.Manager.Defs.pas
├── PyPackage.Manager.Conda.pas
├── PyPackage.Manager.Intf.pas
├── PyPackage.Manager.ManagerKind.pas
├── PyPackage.Manager.Managers.pas
├── PyPackage.Manager.Pip.pas
└── PyPackage.Manager.pas
├── Model
└── PyPackage.Model.pas
├── PyCommon.pas
├── PyCore.pas
├── PyExceptions.pas
├── PyModule.pas
├── PyPackage.Editors.pas
├── PyPackage.pas
└── PyUtils.pas
/.gitignore:
--------------------------------------------------------------------------------
1 | # Uncomment these types if you want even more clean repository. But be careful.
2 | # It can make harm to an existing project source. Read explanations below.
3 | #
4 | # Resource files are binaries containing manifest, project icon and version info.
5 | # They can not be viewed as text or compared by diff-tools. Consider replacing them with .rc files.
6 | #*.res
7 | #
8 | # Type library file (binary). In old Delphi versions it should be stored.
9 | # Since Delphi 2009 it is produced from .ridl file and can safely be ignored.
10 | #*.tlb
11 | #
12 | # Diagram Portfolio file. Used by the diagram editor up to Delphi 7.
13 | # Uncomment this if you are not using diagrams or use newer Delphi version.
14 | #*.ddp
15 | #
16 | # Visual LiveBindings file. Added in Delphi XE2.
17 | # Uncomment this if you are not using LiveBindings Designer.
18 | #*.vlb
19 | #
20 | # Deployment Manager configuration file for your project. Added in Delphi XE2.
21 | # Uncomment this if it is not mobile development and you do not use remote debug feature.
22 | #*.deployproj
23 | #
24 | # C++ object files produced when C/C++ Output file generation is configured.
25 | # Uncomment this if you are not using external objects (zlib library for example).
26 | #*.obj
27 | #
28 |
29 | # Delphi compiler-generated binaries (safe to delete)
30 | *.exe
31 | *.dll
32 | *.bpl
33 | *.bpi
34 | *.dcp
35 | *.so
36 | *.apk
37 | *.drc
38 | *.map
39 | *.dres
40 | *.rsm
41 | *.tds
42 | *.dcu
43 | *.lib
44 | *.a
45 | *.o
46 | *.ocx
47 | *.res
48 |
49 | # Delphi autogenerated files (duplicated info)
50 | *.cfg
51 | *.hpp
52 | *Resource.rc
53 |
54 | # Delphi local files (user-specific info)
55 | *.local
56 | *.identcache
57 | *.projdata
58 | *.tvsconfig
59 | *.dsk
60 | *AndroidManifest.template.xml
61 |
62 | # Delphi history and backups
63 | __history/
64 | __recovery/
65 | *.~*
66 |
67 | # Castalia statistics file (since XE7 Castalia is distributed with Delphi)
68 | *.stat
69 |
70 | # Boss dependency manager vendor folder https://github.com/HashLoad/boss
71 | modules/
72 |
73 | #Resources dir
74 | resources/
75 |
76 | #Library dir
77 | lib/
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2022 Embarcadero Technologies
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Lightweight-Python-Wrappers
2 | Lightweight Wrappers based on [Python4Delphi](https://github.com/Embarcadero/Python4Delphi) to make it easy to import Python modules into Delphi components.
3 |
4 | This is the foundation of the [Delphi Data Sciences Libraries](https://github.com/Embarcadero/P4D-Data-Sciences) and works with the [Python Enviroments](https://github.com/Embarcadero/PythonEnviroments/).
5 |
6 | This is an early access preview, but you are encouraged to try it out, file bug reports, and add features. [Read more](https://blogs.embarcadero.com/?p=145025) and catch the live stream.
7 |
--------------------------------------------------------------------------------
/boss.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "Lightweight-Python-Wrappers",
3 | "description": "Lightweight Wrappers based on Python4Delphi to make it easy to import Python modules into Delphi components.",
4 | "version": "1.0.0",
5 | "homepage": "https://github.com/Embarcadero/Lightweight-Python-Wrappers",
6 | "mainsrc": "./src",
7 | "projects": [
8 | "./packages/P4DPyPackage.dproj",
9 | "./packages/dclP4DPyPackage.dproj"
10 | ],
11 | "dependencies": {
12 | "https://github.com/embarcadero/pythonenviroments": "^v0.0.1-alpha"
13 | }
14 | }
--------------------------------------------------------------------------------
/packages/P4DLightweightWrappersComponentSuite.groupproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | {912F8EE9-E25B-41C8-83B3-569531100FDE}
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | Default.Personality.12
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/packages/P4DLightweightWrappersComponentSuite.prjmgc:
--------------------------------------------------------------------------------
1 | [Settings]
2 | AutoLibSuffix=0
3 | ClearChildAppSettings=0
4 | ClearChildPackageSettings=0
5 | ClearChildVersionInfo=0
6 | NormalizeDproj=1
7 | SplitDproj=0
8 | EnableMissingPlatforms=1
9 | RemoveUnusedPlatforms=1
10 | RefreshFormType=0
11 | RemoveExcludedPackages=1
12 | RemoveDeployment=1
13 | RemoveUWP=1
14 |
15 |
--------------------------------------------------------------------------------
/packages/P4DPyPackage.dpk:
--------------------------------------------------------------------------------
1 | package P4DPyPackage;
2 |
3 | {$R *.res}
4 | {$IFDEF IMPLICITBUILDING This IFDEF should not be used by users}
5 | {$ALIGN 8}
6 | {$ASSERTIONS ON}
7 | {$BOOLEVAL OFF}
8 | {$DEBUGINFO OFF}
9 | {$EXTENDEDSYNTAX ON}
10 | {$IMPORTEDDATA ON}
11 | {$IOCHECKS ON}
12 | {$LOCALSYMBOLS OFF}
13 | {$LONGSTRINGS ON}
14 | {$OPENSTRINGS ON}
15 | {$OPTIMIZATION ON}
16 | {$OVERFLOWCHECKS OFF}
17 | {$RANGECHECKS OFF}
18 | {$REFERENCEINFO OFF}
19 | {$SAFEDIVIDE OFF}
20 | {$STACKFRAMES OFF}
21 | {$TYPEDADDRESS OFF}
22 | {$VARSTRINGCHECKS ON}
23 | {$WRITEABLECONST OFF}
24 | {$MINENUMSIZE 1}
25 | {$IMAGEBASE $400000}
26 | {$DEFINE RELEASE}
27 | {$ENDIF IMPLICITBUILDING}
28 | {$LIBSUFFIX AUTO}
29 | {$RUNONLY}
30 | {$IMPLICITBUILD ON}
31 |
32 | requires
33 | rtl,
34 | Python,
35 | p4denvironment;
36 |
37 | contains
38 | PyCommon in '..\src\PyCommon.pas',
39 | PyModule in '..\src\PyModule.pas',
40 | PyPackage in '..\src\PyPackage.pas',
41 | PyExceptions in '..\src\PyExceptions.pas',
42 | PyCore in '..\src\PyCore.pas',
43 | PyUtils in '..\src\PyUtils.pas',
44 | PyPackage.Manager.Pip in '..\src\Manager\PyPackage.Manager.Pip.pas',
45 | PyPackage.Manager.Conda in '..\src\Manager\PyPackage.Manager.Conda.pas',
46 | PyPackage.Manager.Defs.Conda in '..\src\Manager\Defs\PyPackage.Manager.Defs.Conda.pas',
47 | PyPackage.Manager.Defs.Pip in '..\src\Manager\Defs\PyPackage.Manager.Defs.Pip.pas',
48 | PyPackage.Manager.Defs in '..\src\Manager\Defs\PyPackage.Manager.Defs.pas',
49 | PyPackage.Manager.Cmd.Intf in '..\src\Manager\Cmd\PyPackage.Manager.Cmd.Intf.pas',
50 | PyPackage.Manager.ManagerKind in '..\src\Manager\PyPackage.Manager.ManagerKind.pas',
51 | PyPackage.Manager.Intf in '..\src\Manager\PyPackage.Manager.Intf.pas',
52 | PyPackage.Manager.Managers in '..\src\Manager\PyPackage.Manager.Managers.pas',
53 | PyPackage.Manager in '..\src\Manager\PyPackage.Manager.pas',
54 | PyPackage.Model in '..\src\Model\PyPackage.Model.pas',
55 | PyPackage.Manager.Cmd.Conda.List in '..\src\Manager\Cmd\Conda\PyPackage.Manager.Cmd.Conda.List.pas',
56 | PyPackage.Manager.Cmd.Conda.Uninstall in '..\src\Manager\Cmd\Conda\PyPackage.Manager.Cmd.Conda.Uninstall.pas',
57 | PyPackage.Manager.Cmd.Conda.Install in '..\src\Manager\Cmd\Conda\PyPackage.Manager.Cmd.Conda.Install.pas',
58 | PyPackage.Manager.Defs.Opts in '..\src\Manager\Defs\Opts\PyPackage.Manager.Defs.Opts.pas',
59 | PyPackage.Manager.Defs.Opts.Pip.Install in '..\src\Manager\Defs\Opts\Pip\PyPackage.Manager.Defs.Opts.Pip.Install.pas',
60 | PyPackage.Manager.Defs.Opts.Pip.Uninstall in '..\src\Manager\Defs\Opts\Pip\PyPackage.Manager.Defs.Opts.Pip.Uninstall.pas',
61 | PyPackage.Manager.Defs.Opts.Conda.Create in '..\src\Manager\Defs\Opts\Conda\PyPackage.Manager.Defs.Opts.Conda.Create.pas',
62 | PyPackage.Manager.Defs.Opts.Conda.Install in '..\src\Manager\Defs\Opts\Conda\PyPackage.Manager.Defs.Opts.Conda.Install.pas',
63 | PyPackage.Manager.Defs.Opts.Conda.List in '..\src\Manager\Defs\Opts\Conda\PyPackage.Manager.Defs.Opts.Conda.List.pas',
64 | PyPackage.Manager.Defs.Opts.Conda.Uninstall in '..\src\Manager\Defs\Opts\Conda\PyPackage.Manager.Defs.Opts.Conda.Uninstall.pas',
65 | PyPackage.Manager.Cmd.Pip.Install in '..\src\Manager\Cmd\Pip\PyPackage.Manager.Cmd.Pip.Install.pas',
66 | PyPackage.Manager.Cmd.Pip.Uninstall in '..\src\Manager\Cmd\Pip\PyPackage.Manager.Cmd.Pip.Uninstall.pas',
67 | PyPackage.Manager.Cmd.Pip in '..\src\Manager\Cmd\Pip\PyPackage.Manager.Cmd.Pip.pas',
68 | PyPackage.Manager.Cmd.Conda in '..\src\Manager\Cmd\Conda\PyPackage.Manager.Cmd.Conda.pas',
69 | PyPackage.Manager.Cmd in '..\src\Manager\Cmd\PyPackage.Manager.Cmd.pas',
70 | PyPackage.Manager.Cmd.Pip.List in '..\src\Manager\Cmd\Pip\PyPackage.Manager.Cmd.Pip.List.pas',
71 | PyPackage.Manager.Defs.Opts.Pip.List in '..\src\Manager\Defs\Opts\Pip\PyPackage.Manager.Defs.Opts.Pip.List.pas';
72 |
73 | end.
74 |
--------------------------------------------------------------------------------
/packages/dclP4DPyPackage.dpk:
--------------------------------------------------------------------------------
1 | package dclP4DPyPackage;
2 |
3 | {$R *.res}
4 | {$IFDEF IMPLICITBUILDING This IFDEF should not be used by users}
5 | {$ALIGN 8}
6 | {$ASSERTIONS ON}
7 | {$BOOLEVAL OFF}
8 | {$DEBUGINFO OFF}
9 | {$EXTENDEDSYNTAX ON}
10 | {$IMPORTEDDATA ON}
11 | {$IOCHECKS ON}
12 | {$LOCALSYMBOLS OFF}
13 | {$LONGSTRINGS ON}
14 | {$OPENSTRINGS ON}
15 | {$OPTIMIZATION ON}
16 | {$OVERFLOWCHECKS OFF}
17 | {$RANGECHECKS OFF}
18 | {$REFERENCEINFO OFF}
19 | {$SAFEDIVIDE OFF}
20 | {$STACKFRAMES OFF}
21 | {$TYPEDADDRESS OFF}
22 | {$VARSTRINGCHECKS ON}
23 | {$WRITEABLECONST OFF}
24 | {$MINENUMSIZE 1}
25 | {$IMAGEBASE $400000}
26 | {$DEFINE RELEASE}
27 | {$ENDIF IMPLICITBUILDING}
28 | {$DESCRIPTION 'P4D AI&ML extension for Python packages'}
29 | {$LIBSUFFIX AUTO}
30 | {$DESIGNONLY}
31 | {$IMPLICITBUILD ON}
32 |
33 | requires
34 | rtl,
35 | designide,
36 | p4dpypackage;
37 |
38 | contains
39 | PyPackage.Editors in '..\src\PyPackage.Editors.pas';
40 |
41 | end.
42 |
--------------------------------------------------------------------------------
/packages/dclP4DPyPackage.dproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | True
4 | Package
5 | Release
6 | None
7 | dclP4DPyPackage.dpk
8 | Win32
9 | {C4C32D67-6742-44C6-A714-965E23585BA2}
10 | dclP4DPyPackage
11 | 20.1
12 | 1
13 |
14 |
15 | true
16 |
17 |
18 | true
19 | Base
20 | true
21 |
22 |
23 | true
24 | Base
25 | true
26 |
27 |
28 | true
29 | Cfg_1
30 | true
31 | true
32 |
33 |
34 | true
35 | Base
36 | true
37 |
38 |
39 | true
40 | Cfg_2
41 | true
42 | true
43 |
44 |
45 | dclP4DPyPackage
46 | ..\lib\$(Platform)\$(Config)
47 | P4D AI&ML extension for Python packages
48 | 00400000
49 | System;Xml;Data;Datasnap;Web;Soap;$(DCC_Namespace)
50 | true
51 | $(Auto)
52 | true
53 | true
54 | CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=;CFBundleName=
55 | 1033
56 |
57 |
58 | Debug
59 | Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)
60 | rtl;P4DPyPackage;$(DCC_UsePackage)
61 | true
62 | CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName)
63 | 1033
64 |
65 |
66 | 0
67 | RELEASE;$(DCC_Define)
68 | false
69 | 0
70 |
71 |
72 | true
73 | CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName)
74 |
75 |
76 | DEBUG;$(DCC_Define)
77 | true
78 | true
79 | false
80 | true
81 |
82 |
83 | true
84 | CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName)
85 |
86 |
87 |
88 | MainSource
89 |
90 |
91 |
92 |
93 |
94 |
95 | Base
96 |
97 |
98 | Cfg_1
99 | Base
100 |
101 |
102 | Cfg_2
103 | Base
104 |
105 |
106 |
107 | Delphi.Personality.12
108 | Package
109 |
110 |
111 |
112 | dclP4DPyPackage.dpk
113 |
114 |
115 |
116 |
117 | False
118 | False
119 | False
120 | False
121 | False
122 | True
123 | False
124 | False
125 | False
126 | False
127 |
128 |
129 | 12
130 |
131 |
132 |
133 |
134 |
--------------------------------------------------------------------------------
/src/Manager/Cmd/Conda/PyPackage.Manager.Cmd.Conda.Install.pas:
--------------------------------------------------------------------------------
1 | (**************************************************************************)
2 | (* *)
3 | (* Module: Unit 'PyPackage.Manager.Cmd.Conda.Install' *)
4 | (* *)
5 | (* Copyright (c) 2021 *)
6 | (* Lucas Moura Belo - lmbelo *)
7 | (* lucas.belo@live.com *)
8 | (* Brazil *)
9 | (* *)
10 | (* Project page: https://github.com/lmbelo/P4D_AI_ML *)
11 | (**************************************************************************)
12 | (* Functionality: PyPackage Cmd layer *)
13 | (* *)
14 | (* *)
15 | (**************************************************************************)
16 | (* This source code is distributed with no WARRANTY, for no reason or use.*)
17 | (* Everyone is allowed to use and change this code free for his own tasks *)
18 | (* and projects, as long as this header and its copyright text is intact. *)
19 | (* For changed versions of this code, which are public distributed the *)
20 | (* following additional conditions have to be fullfilled: *)
21 | (* 1) The header has to contain a comment on the change and the author of *)
22 | (* it. *)
23 | (* 2) A copy of the changed source has to be sent to the above E-Mail *)
24 | (* address or my then valid address, if this is possible to the *)
25 | (* author. *)
26 | (* The second condition has the target to maintain an up to date central *)
27 | (* version of the component. If this condition is not acceptable for *)
28 | (* confidential or legal reasons, everyone is free to derive a component *)
29 | (* or to generate a diff file to my or other original sources. *)
30 | (**************************************************************************)
31 | unit PyPackage.Manager.Cmd.Conda.Install;
32 |
33 | interface
34 |
35 | uses
36 | System.SysUtils, System.Classes, System.Generics.Collections,
37 | PyPackage.Manager.Defs.Opts.Conda.Install;
38 |
39 | type
40 | TPyPackageManagerCmdCondaInstall = class
41 | private
42 | FOpts: TPyPackageManagerDefsOptsCondaInstall;
43 | public
44 | constructor Create(const ADefs: TPyPackageManagerDefsOptsCondaInstall);
45 |
46 | function MakeInstallRevisionCmd: TArray; inline;
47 | function MakeInstallFileCmd: TArray; inline;
48 | function MakeInstallNameCmd: TArray; inline;
49 | function MakeInstallPrefixCmd: TArray; inline;
50 | function MakeInstallChannelCmd: TArray; inline;
51 | function MakeInstallUseLocalCmd: TArray; inline;
52 | function MakeInstallOverrideChannelsCmd: TArray; inline;
53 | function MakeInstallRepoDataCmd: TArray; inline;
54 | function MakeInstallStrictChannelPriorityCmd: TArray; inline;
55 | function MakeInstallNoChannelPriorityCmd: TArray; inline;
56 | function MakeInstallNoDepsCmd: TArray; inline;
57 | function MakeInstallOnlyDepsCmd: TArray; inline;
58 | function MakeInstallNoPinCmd: TArray; inline;
59 | function MakeInstallExperimentalSolverCmd: TArray; inline;
60 | function MakeInstallForceReinstallCmd: TArray; inline;
61 | function MakeInstallNoUpdateDepsCmd: TArray; inline;
62 | function MakeInstallUpdateDepsCmd: TArray; inline;
63 | function MakeInstallSatisfiedSkipSolveCmd: TArray; inline;
64 | function MakeInstallUpdateAllCmd: TArray; inline;
65 | function MakeInstallUpdateSpecsCmd: TArray; inline;
66 | function MakeInstallCopyCmd: TArray; inline;
67 | function MakeInstallMkDirCmd: TArray; inline;
68 | function MakeInstallClobberCmd: TArray; inline;
69 | function MakeInstallUseIndexCacheCmd: TArray; inline;
70 | function MakeInstallInsecureCmd: TArray; inline;
71 | function MakeInstallOfflineCmd: TArray; inline;
72 | function MakeInstallDryRunCmd: TArray; inline;
73 | function MakeInstallJsonCmd: TArray; inline;
74 | function MakeInstallQuietCmd: TArray; inline;
75 | function MakeInstallVerboseCmd: TArray; inline;
76 | function MakeInstallDoNotAskForConfirmationCmd: TArray; inline;
77 | function MakeInstallDownloadOnlyCmd: TArray; inline;
78 | function MakeInstallShowChannelUrlsCmd: TArray; inline;
79 | end;
80 |
81 | implementation
82 |
83 | constructor TPyPackageManagerCmdCondaInstall.Create(
84 | const ADefs: TPyPackageManagerDefsOptsCondaInstall);
85 | begin
86 | FOpts := ADefs;
87 | end;
88 |
89 | function TPyPackageManagerCmdCondaInstall.MakeInstallChannelCmd: TArray;
90 | begin
91 | if not FOpts.Channel.IsEmpty() then
92 | Result := TArray.Create('--channel', FOpts.Channel);
93 | end;
94 |
95 | function TPyPackageManagerCmdCondaInstall.MakeInstallClobberCmd: TArray;
96 | begin
97 | if FOpts.Clobber then
98 | Result := TArray.Create('--clobber');
99 | end;
100 |
101 | function TPyPackageManagerCmdCondaInstall.MakeInstallCopyCmd: TArray;
102 | begin
103 | if FOpts.Copy then
104 | Result := TArray.Create('--copy');
105 | end;
106 |
107 | function TPyPackageManagerCmdCondaInstall.MakeInstallDoNotAskForConfirmationCmd: TArray;
108 | begin
109 | if FOpts.DoNotAskForConfirmation then
110 | Result := TArray.Create('--yes');
111 | end;
112 |
113 | function TPyPackageManagerCmdCondaInstall.MakeInstallDownloadOnlyCmd: TArray;
114 | begin
115 | if FOpts.DownloadOnly then
116 | Result := TArray.Create('--download-only');
117 | end;
118 |
119 | function TPyPackageManagerCmdCondaInstall.MakeInstallDryRunCmd: TArray;
120 | begin
121 | if FOpts.DryRun then
122 | Result := TArray.Create('--dry-run');
123 | end;
124 |
125 | function TPyPackageManagerCmdCondaInstall.MakeInstallExperimentalSolverCmd: TArray;
126 | begin
127 | if not FOpts.ExperimentalSolver.IsEmpty() then
128 | Result := TArray.Create('--experimental-solver', FOpts.ExperimentalSolver);
129 | end;
130 |
131 | function TPyPackageManagerCmdCondaInstall.MakeInstallFileCmd: TArray;
132 | var
133 | LList: TList;
134 | LStr: string;
135 | begin
136 | LList := TList.Create();
137 | try
138 | for LStr in FOpts.Files do
139 | LList.Add('--file=' + LStr);
140 | Result := LList.ToArray();
141 | finally
142 | LList.Free();
143 | end;
144 | end;
145 |
146 | function TPyPackageManagerCmdCondaInstall.MakeInstallForceReinstallCmd: TArray;
147 | begin
148 | if FOpts.ForceReinstall then
149 | Result := TArray.Create('--force-reinstall');
150 | end;
151 |
152 | function TPyPackageManagerCmdCondaInstall.MakeInstallNoUpdateDepsCmd: TArray;
153 | begin
154 | if FOpts.NoUpdateDeps then
155 | Result := TArray.Create('--no-update-deps');
156 | end;
157 |
158 | function TPyPackageManagerCmdCondaInstall.MakeInstallInsecureCmd: TArray;
159 | begin
160 | if FOpts.Insecure then
161 | Result := TArray.Create('--insecure');
162 | end;
163 |
164 | function TPyPackageManagerCmdCondaInstall.MakeInstallJsonCmd: TArray;
165 | begin
166 | if FOpts.Json then
167 | Result := TArray.Create('--json');
168 | end;
169 |
170 | function TPyPackageManagerCmdCondaInstall.MakeInstallMkDirCmd: TArray;
171 | begin
172 | if FOpts.MkDir then
173 | Result := TArray.Create('--mkdir');
174 | end;
175 |
176 | function TPyPackageManagerCmdCondaInstall.MakeInstallNameCmd: TArray;
177 | begin
178 | if not FOpts.Name.IsEmpty() then
179 | Result := TArray.Create('--name', FOpts.Name);
180 | end;
181 |
182 | function TPyPackageManagerCmdCondaInstall.MakeInstallNoChannelPriorityCmd: TArray;
183 | begin
184 | if FOpts.NoChannelPriority then
185 | Result := TArray.Create('--no-channel-priority');
186 | end;
187 |
188 | function TPyPackageManagerCmdCondaInstall.MakeInstallNoDepsCmd: TArray;
189 | begin
190 | if FOpts.NoDeps then
191 | Result := TArray.Create('--no-deps');
192 | end;
193 |
194 | function TPyPackageManagerCmdCondaInstall.MakeInstallNoPinCmd: TArray;
195 | begin
196 | if FOpts.OnlyDeps then
197 | Result := TArray.Create('--no-pin');
198 | end;
199 |
200 | function TPyPackageManagerCmdCondaInstall.MakeInstallOfflineCmd: TArray;
201 | begin
202 | if FOpts.OffLine then
203 | Result := TArray.Create('--offline');
204 | end;
205 |
206 | function TPyPackageManagerCmdCondaInstall.MakeInstallOnlyDepsCmd: TArray;
207 | begin
208 | if FOpts.OnlyDeps then
209 | Result := TArray.Create('--only-deps');
210 | end;
211 |
212 | function TPyPackageManagerCmdCondaInstall.MakeInstallOverrideChannelsCmd: TArray;
213 | begin
214 | if FOpts.OverrideChannels then
215 | Result := TArray.Create('--override-channels');
216 | end;
217 |
218 | function TPyPackageManagerCmdCondaInstall.MakeInstallPrefixCmd: TArray;
219 | begin
220 | if not FOpts.Prefix.IsEmpty() then
221 | Result := TArray.Create('--prefix', FOpts.Prefix);
222 | end;
223 |
224 | function TPyPackageManagerCmdCondaInstall.MakeInstallQuietCmd: TArray;
225 | begin
226 | if FOpts.Quiet then
227 | Result := TArray.Create('--quiet');
228 | end;
229 |
230 | function TPyPackageManagerCmdCondaInstall.MakeInstallRepoDataCmd: TArray;
231 | var
232 | LList: TList;
233 | LStr: string;
234 | begin
235 | LList := TList.Create();
236 | try
237 | for LStr in FOpts.RepoData do begin
238 | LList.Add('--repodata-fn=' + LStr);
239 | end;
240 | Result := LList.ToArray();
241 | finally
242 | LList.Free();
243 | end;
244 | end;
245 |
246 | function TPyPackageManagerCmdCondaInstall.MakeInstallRevisionCmd: TArray;
247 | begin
248 | if not FOpts.Revision.IsEmpty() then
249 | Result := TArray.Create('--revision', FOpts.Revision);
250 | end;
251 |
252 | function TPyPackageManagerCmdCondaInstall.MakeInstallSatisfiedSkipSolveCmd: TArray;
253 | begin
254 | if FOpts.SatisfiedSkipSolve then
255 | Result := TArray.Create('--satisfied-skip-solve');
256 | end;
257 |
258 | function TPyPackageManagerCmdCondaInstall.MakeInstallShowChannelUrlsCmd: TArray;
259 | begin
260 | if FOpts.ShowChannelUrls then
261 | Result := TArray.Create('--show-channel-urls');
262 | end;
263 |
264 | function TPyPackageManagerCmdCondaInstall.MakeInstallStrictChannelPriorityCmd: TArray;
265 | begin
266 | if FOpts.StrictChannelPriority then
267 | Result := TArray.Create('--strict-channel-priority');
268 | end;
269 |
270 | function TPyPackageManagerCmdCondaInstall.MakeInstallUpdateAllCmd: TArray;
271 | begin
272 | if FOpts.UpdateAll then
273 | Result := TArray.Create('--all');
274 | end;
275 |
276 | function TPyPackageManagerCmdCondaInstall.MakeInstallUpdateDepsCmd: TArray;
277 | begin
278 | if FOpts.UpdateDeps then
279 | Result := TArray.Create('--update-deps');
280 | end;
281 |
282 | function TPyPackageManagerCmdCondaInstall.MakeInstallUpdateSpecsCmd: TArray;
283 | begin
284 | if FOpts.UpdateSpecs then
285 | Result := TArray.Create('--update-specs');
286 | end;
287 |
288 | function TPyPackageManagerCmdCondaInstall.MakeInstallUseIndexCacheCmd: TArray;
289 | begin
290 | if FOpts.UseIndexCache then
291 | Result := TArray.Create('--use-index-cache');
292 | end;
293 |
294 | function TPyPackageManagerCmdCondaInstall.MakeInstallUseLocalCmd: TArray;
295 | begin
296 | if not FOpts.UseLocal then
297 | Result := TArray.Create('--use-local');
298 | end;
299 |
300 | function TPyPackageManagerCmdCondaInstall.MakeInstallVerboseCmd: TArray;
301 | var
302 | LList: TList;
303 | LStr: string;
304 | begin
305 | LList := TList.Create();
306 | try
307 | for LStr in FOpts.Verbose do begin
308 | LList.Add(LStr);
309 | end;
310 | finally
311 | LList.Free();
312 | end;
313 | end;
314 |
315 | end.
316 |
--------------------------------------------------------------------------------
/src/Manager/Cmd/Conda/PyPackage.Manager.Cmd.Conda.List.pas:
--------------------------------------------------------------------------------
1 | (**************************************************************************)
2 | (* *)
3 | (* Module: Unit 'PyPackage.Manager.Cmd.Conda.List' *)
4 | (* *)
5 | (* Copyright (c) 2021 *)
6 | (* Lucas Moura Belo - lmbelo *)
7 | (* lucas.belo@live.com *)
8 | (* Brazil *)
9 | (* *)
10 | (* Project page: https://github.com/lmbelo/P4D_AI_ML *)
11 | (**************************************************************************)
12 | (* Functionality: PyPackage Cmd layer *)
13 | (* *)
14 | (* *)
15 | (**************************************************************************)
16 | (* This source code is distributed with no WARRANTY, for no reason or use.*)
17 | (* Everyone is allowed to use and change this code free for his own tasks *)
18 | (* and projects, as long as this header and its copyright text is intact. *)
19 | (* For changed versions of this code, which are public distributed the *)
20 | (* following additional conditions have to be fullfilled: *)
21 | (* 1) The header has to contain a comment on the change and the author of *)
22 | (* it. *)
23 | (* 2) A copy of the changed source has to be sent to the above E-Mail *)
24 | (* address or my then valid address, if this is possible to the *)
25 | (* author. *)
26 | (* The second condition has the target to maintain an up to date central *)
27 | (* version of the component. If this condition is not acceptable for *)
28 | (* confidential or legal reasons, everyone is free to derive a component *)
29 | (* or to generate a diff file to my or other original sources. *)
30 | (**************************************************************************)
31 | unit PyPackage.Manager.Cmd.Conda.List;
32 |
33 | interface
34 |
35 | uses
36 | System.SysUtils, System.Classes, System.Generics.Collections,
37 | PyPackage.Manager.Defs.Opts.Conda.List;
38 |
39 | type
40 | TPyPackageManagerCmdCondaList = class
41 | private
42 | FOpts: TPyPackageManagerDefsOptsCondaList;
43 | public
44 | constructor Create(const AOpts: TPyPackageManagerDefsOptsCondaList);
45 |
46 | // function MakeListRegexCmd: TArray; inline;
47 | function MakeListShowChannelUrlsCmd: TArray; inline;
48 | function MakeListCanonicalCmd: TArray; inline;
49 | function MakeListFullNameCmd: TArray; inline;
50 | function MakeListExplicityCmd: TArray; inline;
51 | function MakeListMd5Cmd: TArray; inline;
52 | function MakeListExportCmd: TArray; inline;
53 | function MakeListRevisionsCmd: TArray; inline;
54 | function MakeListNoPipCmd: TArray; inline;
55 | function MakeListNameCmd: TArray; inline;
56 | function MakeListPrefixCmd: TArray; inline;
57 | function MakeListJsonCmd: TArray; inline;
58 | function MakeListVerboseCmd: TArray; inline;
59 | function MakeListQuietCmd: TArray; inline;
60 | end;
61 |
62 | implementation
63 |
64 | constructor TPyPackageManagerCmdCondaList.Create(
65 | const AOpts: TPyPackageManagerDefsOptsCondaList);
66 | begin
67 | FOpts := AOpts;
68 | end;
69 |
70 | function TPyPackageManagerCmdCondaList.MakeListCanonicalCmd: TArray;
71 | begin
72 | if FOpts.Canonical then
73 | Result := TArray.Create('--canonical');
74 | end;
75 |
76 | function TPyPackageManagerCmdCondaList.MakeListExplicityCmd: TArray;
77 | begin
78 | if FOpts.Explicity then
79 | Result := TArray.Create('--explicit');
80 | end;
81 |
82 | function TPyPackageManagerCmdCondaList.MakeListExportCmd: TArray;
83 | begin
84 | if FOpts.Export then
85 | Result := TArray.Create('--export');
86 | end;
87 |
88 | function TPyPackageManagerCmdCondaList.MakeListFullNameCmd: TArray;
89 | begin
90 | if FOpts.FullName then
91 | Result := TArray.Create('--full-name');
92 | end;
93 |
94 | function TPyPackageManagerCmdCondaList.MakeListJsonCmd: TArray;
95 | begin
96 | if FOpts.Json then
97 | Result := TArray.Create('--json');
98 | end;
99 |
100 | function TPyPackageManagerCmdCondaList.MakeListMd5Cmd: TArray;
101 | begin
102 | if FOpts.Md5 then
103 | Result := TArray.Create('--md5');
104 | end;
105 |
106 | function TPyPackageManagerCmdCondaList.MakeListNameCmd: TArray;
107 | begin
108 | if not FOpts.Name.IsEmpty() then
109 | Result := TArray.Create('--name', FOpts.Name);
110 | end;
111 |
112 | function TPyPackageManagerCmdCondaList.MakeListNoPipCmd: TArray;
113 | begin
114 | if FOpts.NoPip then
115 | Result := TArray.Create('--no-pip');
116 | end;
117 |
118 | function TPyPackageManagerCmdCondaList.MakeListPrefixCmd: TArray;
119 | begin
120 | if not FOpts.Prefix.IsEmpty() then
121 | Result := TArray.Create('--prefix', FOpts.Prefix);
122 | end;
123 |
124 | function TPyPackageManagerCmdCondaList.MakeListQuietCmd: TArray;
125 | begin
126 | if FOpts.Quiet then
127 | Result := TArray.Create('--quiet');
128 | end;
129 |
130 | //function TPyPackageManagerCmdCondaList.MakeListRegexCmd: TArray;
131 | //begin
132 | // if not FDefs.Regex.IsEmpty() then
133 | // Result := TArray.Create(FDefs.Regex);
134 | //end;
135 |
136 | function TPyPackageManagerCmdCondaList.MakeListRevisionsCmd: TArray;
137 | begin
138 | if FOpts.Revisions then
139 | Result := TArray.Create('--revisions');
140 | end;
141 |
142 | function TPyPackageManagerCmdCondaList.MakeListShowChannelUrlsCmd: TArray;
143 | begin
144 | if FOpts.ShowChannelUrls then
145 | Result := TArray.Create('--show-channel-urls');
146 | end;
147 |
148 | function TPyPackageManagerCmdCondaList.MakeListVerboseCmd: TArray;
149 | var
150 | LList: TList;
151 | LStr: string;
152 | begin
153 | LList := TList.Create();
154 | try
155 | for LStr in FOpts.Verbose do begin
156 | LList.Add(LStr);
157 | end;
158 | finally
159 | LList.Free();
160 | end;
161 | end;
162 |
163 | end.
164 |
--------------------------------------------------------------------------------
/src/Manager/Cmd/Conda/PyPackage.Manager.Cmd.Conda.Uninstall.pas:
--------------------------------------------------------------------------------
1 | (**************************************************************************)
2 | (* *)
3 | (* Module: Unit 'PyPackage.Manager.Cmd.Conda.Uninstall' *)
4 | (* *)
5 | (* Copyright (c) 2021 *)
6 | (* Lucas Moura Belo - lmbelo *)
7 | (* lucas.belo@live.com *)
8 | (* Brazil *)
9 | (* *)
10 | (* Project page: https://github.com/lmbelo/P4D_AI_ML *)
11 | (**************************************************************************)
12 | (* Functionality: PyPackage Cmd layer *)
13 | (* *)
14 | (* *)
15 | (**************************************************************************)
16 | (* This source code is distributed with no WARRANTY, for no reason or use.*)
17 | (* Everyone is allowed to use and change this code free for his own tasks *)
18 | (* and projects, as long as this header and its copyright text is intact. *)
19 | (* For changed versions of this code, which are public distributed the *)
20 | (* following additional conditions have to be fullfilled: *)
21 | (* 1) The header has to contain a comment on the change and the author of *)
22 | (* it. *)
23 | (* 2) A copy of the changed source has to be sent to the above E-Mail *)
24 | (* address or my then valid address, if this is possible to the *)
25 | (* author. *)
26 | (* The second condition has the target to maintain an up to date central *)
27 | (* version of the component. If this condition is not acceptable for *)
28 | (* confidential or legal reasons, everyone is free to derive a component *)
29 | (* or to generate a diff file to my or other original sources. *)
30 | (**************************************************************************)
31 | unit PyPackage.Manager.Cmd.Conda.Uninstall;
32 |
33 | interface
34 |
35 | uses
36 | System.SysUtils, System.Classes, System.Generics.Collections,
37 | PyPackage.Manager.Defs.Opts.Conda.Uninstall;
38 |
39 | type
40 | TPyPackageManagerCmdCondaUninstall = class
41 | private
42 | FOpts: TPyPackageManagerDefsOptsCondaUninstall;
43 | public
44 | constructor Create(const ADefs: TPyPackageManagerDefsOptsCondaUninstall);
45 |
46 | function MakeUninstallNameCmd: TArray; inline;
47 | function MakeUninstallPrefixCmd: TArray; inline;
48 | function MakeUninstallChannelCmd: TArray; inline;
49 | function MakeUninstallUseLocalCmd: TArray; inline;
50 | function MakeUninstallOverrideChannelsCmd: TArray; inline;
51 | function MakeUninstallRepodataCmd: TArray; inline;
52 | function MakeUninstallAllCmd: TArray; inline;
53 | function MakeUninstallFeaturesCmd: TArray; inline;
54 | function MakeUninstallForceCmd: TArray; inline;
55 | function MakeUninstallNoPinCmd: TArray; inline;
56 | function MakeUninstallExperimentalSolverCmd: TArray; inline;
57 | function MakeUninstallUseIndexCacheCmd: TArray; inline;
58 | function MakeUninstallInsecureCmd: TArray; inline;
59 | function MakeUninstallOfflineCmd: TArray; inline;
60 | function MakeUninstallDryRunCmd: TArray; inline;
61 | function MakeUninstallJsonCmd: TArray; inline;
62 | function MakeUninstallQuietCmd: TArray; inline;
63 | function MakeUninstallVerboseCmd: TArray; inline;
64 | function MakeUninstallYesCmd: TArray; inline;
65 | end;
66 |
67 | implementation
68 |
69 | constructor TPyPackageManagerCmdCondaUninstall.Create(
70 | const ADefs: TPyPackageManagerDefsOptsCondaUninstall);
71 | begin
72 | FOpts := ADefs;
73 | end;
74 |
75 | function TPyPackageManagerCmdCondaUninstall.MakeUninstallAllCmd: TArray;
76 | begin
77 | if FOpts.All then
78 | Result := TArray.Create('--all');
79 | end;
80 |
81 | function TPyPackageManagerCmdCondaUninstall.MakeUninstallChannelCmd: TArray;
82 | begin
83 | if not FOpts.Channel.IsEmpty() then
84 | Result := TArray.Create('--channel', FOpts.Channel);
85 | end;
86 |
87 | function TPyPackageManagerCmdCondaUninstall.MakeUninstallDryRunCmd: TArray;
88 | begin
89 | if FOpts.DryRun then
90 | Result := TArray.Create('--dry-run');
91 | end;
92 |
93 | function TPyPackageManagerCmdCondaUninstall.MakeUninstallExperimentalSolverCmd: TArray;
94 | begin
95 | if FOpts.ExperimentalSolver then
96 | Result := TArray.Create('--experimental-solver');
97 | end;
98 |
99 | function TPyPackageManagerCmdCondaUninstall.MakeUninstallFeaturesCmd: TArray;
100 | begin
101 | if FOpts.Features then
102 | Result := TArray.Create('--features');
103 | end;
104 |
105 | function TPyPackageManagerCmdCondaUninstall.MakeUninstallForceCmd: TArray;
106 | begin
107 | if FOpts.Force then
108 | Result := TArray.Create('--force');
109 | end;
110 |
111 | function TPyPackageManagerCmdCondaUninstall.MakeUninstallInsecureCmd: TArray;
112 | begin
113 | if FOpts.Insecure then
114 | Result := TArray.Create('--insecure');
115 | end;
116 |
117 | function TPyPackageManagerCmdCondaUninstall.MakeUninstallJsonCmd: TArray;
118 | begin
119 | if FOpts.Json then
120 | Result := TArray.Create('--json');
121 | end;
122 |
123 | function TPyPackageManagerCmdCondaUninstall.MakeUninstallNameCmd: TArray;
124 | begin
125 | if not FOpts.Name.IsEmpty() then
126 | Result := TArray.Create('--name', FOpts.Name);
127 | end;
128 |
129 | function TPyPackageManagerCmdCondaUninstall.MakeUninstallNoPinCmd: TArray;
130 | begin
131 | if FOpts.NoPin then
132 | Result := TArray.Create('--no-pin');
133 | end;
134 |
135 | function TPyPackageManagerCmdCondaUninstall.MakeUninstallOfflineCmd: TArray;
136 | begin
137 | if FOpts.Offline then
138 | Result := TArray.Create('--offline');
139 | end;
140 |
141 | function TPyPackageManagerCmdCondaUninstall.MakeUninstallOverrideChannelsCmd: TArray;
142 | begin
143 | if FOpts.OverrideChannels then
144 | Result := TArray.Create('--override-channels');
145 | end;
146 |
147 | function TPyPackageManagerCmdCondaUninstall.MakeUninstallPrefixCmd: TArray;
148 | begin
149 | if not FOpts.Prefix.IsEmpty() then
150 | Result := TArray.Create('--prefix', FOpts.Prefix);
151 | end;
152 |
153 | function TPyPackageManagerCmdCondaUninstall.MakeUninstallQuietCmd: TArray;
154 | begin
155 | if FOpts.Quiet then
156 | Result := TArray.Create('--quiet');
157 | end;
158 |
159 | function TPyPackageManagerCmdCondaUninstall.MakeUninstallRepodataCmd: TArray;
160 | var
161 | LList: TList;
162 | LStr: string;
163 | begin
164 | LList := TList.Create();
165 | try
166 | for LStr in FOpts.RepoData do begin
167 | LList.Add('--repodata-fn=' + LStr);
168 | end;
169 | Result := LList.ToArray();
170 | finally
171 | LList.Free();
172 | end;
173 | end;
174 |
175 | function TPyPackageManagerCmdCondaUninstall.MakeUninstallUseIndexCacheCmd: TArray;
176 | begin
177 | if FOpts.UseIndexCache then
178 | Result := TArray.Create('--use-index-cache');
179 | end;
180 |
181 | function TPyPackageManagerCmdCondaUninstall.MakeUninstallUseLocalCmd: TArray;
182 | begin
183 | if FOpts.UseLocal then
184 | Result := TArray.Create('--use-local');
185 | end;
186 |
187 | function TPyPackageManagerCmdCondaUninstall.MakeUninstallVerboseCmd: TArray;
188 | var
189 | LList: TList;
190 | LStr: string;
191 | begin
192 | LList := TList.Create();
193 | try
194 | for LStr in FOpts.Verbose do begin
195 | LList.Add(LStr);
196 | end;
197 | finally
198 | LList.Free();
199 | end;
200 | end;
201 |
202 | function TPyPackageManagerCmdCondaUninstall.MakeUninstallYesCmd: TArray;
203 | begin
204 | if FOpts.DoNotAskForConfirmation then
205 | Result := TArray.Create('--yes');
206 | end;
207 |
208 | end.
209 |
--------------------------------------------------------------------------------
/src/Manager/Cmd/Conda/PyPackage.Manager.Cmd.Conda.pas:
--------------------------------------------------------------------------------
1 | (**************************************************************************)
2 | (* *)
3 | (* Module: Unit 'PyPackage.Manager.Cmd.Conda' *)
4 | (* *)
5 | (* Copyright (c) 2021 *)
6 | (* Lucas Moura Belo - lmbelo *)
7 | (* lucas.belo@live.com *)
8 | (* Brazil *)
9 | (* *)
10 | (* Project page: https://github.com/lmbelo/P4D_AI_ML *)
11 | (**************************************************************************)
12 | (* Functionality: PyPackage Cmd layer *)
13 | (* *)
14 | (* *)
15 | (**************************************************************************)
16 | (* This source code is distributed with no WARRANTY, for no reason or use.*)
17 | (* Everyone is allowed to use and change this code free for his own tasks *)
18 | (* and projects, as long as this header and its copyright text is intact. *)
19 | (* For changed versions of this code, which are public distributed the *)
20 | (* following additional conditions have to be fullfilled: *)
21 | (* 1) The header has to contain a comment on the change and the author of *)
22 | (* it. *)
23 | (* 2) A copy of the changed source has to be sent to the above E-Mail *)
24 | (* address or my then valid address, if this is possible to the *)
25 | (* author. *)
26 | (* The second condition has the target to maintain an up to date central *)
27 | (* version of the component. If this condition is not acceptable for *)
28 | (* confidential or legal reasons, everyone is free to derive a component *)
29 | (* or to generate a diff file to my or other original sources. *)
30 | (**************************************************************************)
31 | unit PyPackage.Manager.Cmd.Conda;
32 |
33 | interface
34 |
35 | uses
36 | System.Classes, System.SysUtils, System.Generics.Collections,
37 | PyPackage.Manager.Cmd,
38 | PyPackage.Manager.Cmd.Intf,
39 | PyPackage.Manager.Defs.Opts;
40 |
41 | type
42 | TPyPackageManagerCmdConda = class(TPyPackageManagerCmd, IPyPackageManagerCmdIntf)
43 | private
44 | // function MakePackageCmd: TArray; inline;
45 | public
46 | function BuildInstallCmd(const AOpts: TPyPackageManagerDefsOpts): TArray;
47 | function BuildUninstallCmd(const AOpts: TPyPackageManagerDefsOpts): TArray;
48 | function BuildListCmd(const AOpts: TPyPackageManagerDefsOpts): TArray;
49 | end;
50 |
51 | implementation
52 |
53 | uses
54 | PyPackage.Manager.Cmd.Conda.Install,
55 | PyPackage.Manager.Defs.Opts.Conda.Install,
56 | PyPackage.Manager.Cmd.Conda.Uninstall,
57 | PyPackage.Manager.Defs.Opts.Conda.Uninstall,
58 | PyPackage.Manager.Cmd.Conda.List,
59 | PyPackage.Manager.Defs.Opts.Conda.List;
60 |
61 | { TPyPackageManagerCmdConda }
62 |
63 | //function TPyPackageManagerCmdConda.MakePackageCmd: TArray;
64 | //begin
65 | // var LVersion: string;
66 | // if not Defs.PackageVersion.IsEmpty() then
67 | // LVersion := Defs.PackageVersion
68 | // else
69 | // LVersion := String.Empty;
70 | //
71 | // Result := TArray.Create(Defs.PackageName + LVersion);
72 | //end;
73 |
74 | function TPyPackageManagerCmdConda.BuildInstallCmd(
75 | const AOpts: TPyPackageManagerDefsOpts): TArray;
76 | begin
77 | with TPyPackageManagerCmdCondaInstall.Create(AOpts as TPyPackageManagerDefsOptsCondaInstall) do
78 | try
79 | Result := TArray.Create('install')
80 | + MakeInstallRevisionCmd()
81 | + MakeInstallFileCmd()
82 | + MakeInstallNameCmd()
83 | + MakeInstallPrefixCmd()
84 | + MakeInstallChannelCmd()
85 | + MakeInstallUseLocalCmd()
86 | + MakeInstallOverrideChannelsCmd()
87 | + MakeInstallRepoDataCmd()
88 | + MakeInstallStrictChannelPriorityCmd()
89 | + MakeInstallNoChannelPriorityCmd()
90 | + MakeInstallNoDepsCmd()
91 | + MakeInstallOnlyDepsCmd()
92 | + MakeInstallNoPinCmd()
93 | + MakeInstallExperimentalSolverCmd()
94 | + MakeInstallForceReinstallCmd()
95 | + MakeInstallNoUpdateDepsCmd()
96 | + MakeInstallUpdateDepsCmd()
97 | + MakeInstallSatisfiedSkipSolveCmd()
98 | + MakeInstallUpdateAllCmd()
99 | + MakeInstallUpdateSpecsCmd()
100 | + MakeInstallCopyCmd()
101 | + MakeInstallMkDirCmd()
102 | + MakeInstallClobberCmd()
103 | + MakeInstallUseIndexCacheCmd()
104 | + MakeInstallInsecureCmd()
105 | + MakeInstallOfflineCmd()
106 | + MakeInstallDryRunCmd()
107 | + MakeInstallJsonCmd()
108 | + MakeInstallQuietCmd()
109 | + MakeInstallVerboseCmd()
110 | + MakeInstallDoNotAskForConfirmationCmd()
111 | + MakeInstallDownloadOnlyCmd()
112 | + MakeInstallShowChannelUrlsCmd()
113 | finally
114 | Free();
115 | end;
116 | end;
117 |
118 | function TPyPackageManagerCmdConda.BuildUninstallCmd(
119 | const AOpts: TPyPackageManagerDefsOpts): TArray;
120 | begin
121 | with TPyPackageManagerCmdCondaUninstall.Create(AOpts as TPyPackageManagerDefsOptsCondaUninstall) do
122 | try
123 | Result := TArray.Create('remove')
124 | + MakeUninstallNameCmd()
125 | + MakeUninstallPrefixCmd()
126 | + MakeUninstallChannelCmd()
127 | + MakeUninstallUseLocalCmd()
128 | + MakeUninstallOverrideChannelsCmd()
129 | + MakeUninstallRepodataCmd()
130 | + MakeUninstallAllCmd()
131 | + MakeUninstallFeaturesCmd()
132 | + MakeUninstallForceCmd()
133 | + MakeUninstallNoPinCmd()
134 | + MakeUninstallExperimentalSolverCmd()
135 | + MakeUninstallUseIndexCacheCmd()
136 | + MakeUninstallInsecureCmd()
137 | + MakeUninstallOfflineCmd()
138 | + MakeUninstallDryRunCmd()
139 | + MakeUninstallJsonCmd()
140 | + MakeUninstallQuietCmd()
141 | + MakeUninstallVerboseCmd()
142 | + MakeUninstallYesCmd()
143 | finally
144 | Free();
145 | end;
146 | end;
147 |
148 | function TPyPackageManagerCmdConda.BuildListCmd(
149 | const AOpts: TPyPackageManagerDefsOpts): TArray;
150 | begin
151 | with TPyPackageManagerCmdCondaList.Create(AOpts as TPyPackageManagerDefsOptsCondaList) do
152 | try
153 | Result := TArray.Create('list')
154 | + MakeListShowChannelUrlsCmd()
155 | + MakeListCanonicalCmd()
156 | + MakeListFullNameCmd()
157 | + MakeListExplicityCmd()
158 | + MakeListMd5Cmd()
159 | + MakeListExportCmd()
160 | + MakeListRevisionsCmd()
161 | + MakeListNoPipCmd()
162 | + MakeListNameCmd()
163 | + MakeListPrefixCmd()
164 | + MakeListJsonCmd()
165 | + MakeListVerboseCmd()
166 | + MakeListQuietCmd();
167 | finally
168 | Free();
169 | end;
170 | end;
171 |
172 | end.
173 |
--------------------------------------------------------------------------------
/src/Manager/Cmd/Pip/PyPackage.Manager.Cmd.Pip.Install.pas:
--------------------------------------------------------------------------------
1 | (**************************************************************************)
2 | (* *)
3 | (* Module: Unit 'PyPackage.Manager.Cmd.Pip.Install' *)
4 | (* *)
5 | (* Copyright (c) 2021 *)
6 | (* Lucas Moura Belo - lmbelo *)
7 | (* lucas.belo@live.com *)
8 | (* Brazil *)
9 | (* *)
10 | (* Project page: https://github.com/lmbelo/P4D_AI_ML *)
11 | (**************************************************************************)
12 | (* Functionality: PyPackage Cmd layer *)
13 | (* *)
14 | (* *)
15 | (**************************************************************************)
16 | (* This source code is distributed with no WARRANTY, for no reason or use.*)
17 | (* Everyone is allowed to use and change this code free for his own tasks *)
18 | (* and projects, as long as this header and its copyright text is intact. *)
19 | (* For changed versions of this code, which are public distributed the *)
20 | (* following additional conditions have to be fullfilled: *)
21 | (* 1) The header has to contain a comment on the change and the author of *)
22 | (* it. *)
23 | (* 2) A copy of the changed source has to be sent to the above E-Mail *)
24 | (* address or my then valid address, if this is possible to the *)
25 | (* author. *)
26 | (* The second condition has the target to maintain an up to date central *)
27 | (* version of the component. If this condition is not acceptable for *)
28 | (* confidential or legal reasons, everyone is free to derive a component *)
29 | (* or to generate a diff file to my or other original sources. *)
30 | (**************************************************************************)
31 | unit PyPackage.Manager.Cmd.Pip.Install;
32 |
33 | interface
34 |
35 | uses
36 | System.SysUtils, System.Classes, System.Generics.Collections,
37 | PyPackage.Manager.Defs.Opts.Pip.Install;
38 |
39 | type
40 | TPyPackageManagerCmdPipInstall = class
41 | private
42 | FOpts: TPyPackageManagerDefsOptsPipInstall;
43 | public
44 | constructor Create(const ADefs: TPyPackageManagerDefsOptsPipInstall);
45 |
46 | function MakeInstallRequirementCmd: TArray; inline;
47 | function MakeInstallConstraintCmd: TArray; inline;
48 | function MakeInstallNoDepsCmd: TArray; inline;
49 | function MakeInstallPreCmd: TArray; inline;
50 | function MakeInstallEditableCmd: TArray; inline;
51 | function MakeInstallTargetCmd: TArray; inline;
52 | function MakeInstallPlatformCmd: TArray; inline;
53 | function MakeInstallPythonVersionCmd: TArray; inline;
54 | function MakeIntallPythonImplementationCmd: TArray; inline;
55 | function MakeInstallAbiCmd: TArray; inline;
56 | function MakeInstallUserCmd: TArray; inline;
57 | function MakeInstallRootCmd: TArray; inline;
58 | function MakeInstallPrefixCmd: TArray; inline;
59 | function MakeInstallSrcCmd: TArray; inline;
60 | function MakeInstallUpgradeCmd: TArray; inline;
61 | function MakeInstallUpgradeStrategyCmd: TArray; inline;
62 | function MakeInstallForceReinstallCmd: TArray; inline;
63 | function MakeInstallIgnoreInstalledCmd: TArray; inline;
64 | function MakeInstallIgnoreRequiresPythonCmd: TArray; inline;
65 | function MakeInstallNoBuildIsolationCmd: TArray; inline;
66 | function MakeInstallUsePe517Cmd: TArray; inline;
67 | function MakeInstallOptionCmd: TArray; inline;
68 | function MakeInstallGlobalOptionCmd: TArray; inline;
69 | function MakeInstallCompileCmd: TArray; inline;
70 | function MakeInstallNoCompileCmd: TArray; inline;
71 | function MakeInstallNoWarnScriptLocationCmd: TArray; inline;
72 | function MakeInstallNoWarnConflictsCmd: TArray; inline;
73 | function MakeInstallNoBinaryCmd: TArray; inline;
74 | function MakeInstallOnlyBinaryCmd: TArray; inline;
75 | function MakeInstallPreferBinaryCmd: TArray; inline;
76 | function MakeInstallRequireHashesCmd: TArray; inline;
77 | function MakeInstallProgressBarCmd: TArray; inline;
78 | function MakeInstallNoCleanCmd: TArray; inline;
79 | function MakeInstallIndexUrlCmd: TArray; inline;
80 | function MakeInstallExtraIndexUrlCmd: TArray; inline;
81 | function MakeInstallNoIndexCmd: TArray; inline;
82 | function MakeInstallFindLinksCmd: TArray; inline;
83 | end;
84 |
85 | implementation
86 |
87 | constructor TPyPackageManagerCmdPipInstall.Create(
88 | const ADefs: TPyPackageManagerDefsOptsPipInstall);
89 | begin
90 | FOpts := ADefs;
91 | end;
92 |
93 | function TPyPackageManagerCmdPipInstall.MakeInstallAbiCmd: TArray;
94 | begin
95 | if not FOpts.Abi.IsEmpty() then
96 | Result := TArray