winget-cli

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 145c64cdff5833ba07cca40dee204dcf83b1cba5
parent 57be9d49eda3c2b96e9d4b14fffda4712d562094
Author: fzanollo <fzanollo@users.noreply.github.com>
Date:   Tue,  3 Aug 2021 17:21:41 -0300

Specs for show dependencies' feature #1012 (#1114)

* specs for show dependencies

* #163 - Dependencies with relative paths

Co-authored-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* Typos in show dependencies spec file

Co-authored-by: Josh Soref <2119212+jsoref@users.noreply.github.com>

* change pattern for SHA256 and add new words to expect

* change import output, show all dependencies together

* validate will show dependencies

* change multiple dependencies from oneline to nested one line each

* uninstall will not be covered in this iteration, adding some details about dependencies declaration on manifest

* spellcheck

Co-authored-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Diffstat:
M.github/actions/spelling/expect.txt | 7+++++--
M.github/actions/spelling/patterns.txt | 2+-
Adoc/specs/#1012 - Show dependencies.md | 133+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mdoc/specs/#163 - Dependencies.md | 5++---
4 files changed, 141 insertions(+), 6 deletions(-)

diff --git a/.github/actions/spelling/expect.txt b/.github/actions/spelling/expect.txt @@ -114,12 +114,13 @@ FULLMUTEX FULLWIDTH fundraiser fuzzer +fzanollo gcpi GES GESMBH GHS gity -globals +Globals helplib helplibrary hhx @@ -154,7 +155,7 @@ itr IVector IWeb IZone -JDKs +jdk jfearn JObject jp @@ -213,6 +214,7 @@ netlify Newtonsoft NOEXPAND normer +npp nsis nuffing nullopt @@ -350,4 +352,5 @@ wwinmain WZDNCRFJ XPLATSTR xsi +Zanollo zy diff --git a/.github/actions/spelling/patterns.txt b/.github/actions/spelling/patterns.txt @@ -3,7 +3,7 @@ WinGetDevCLI_8wekyb3d8bbwe _tisf_sqliteReturnValue microsoft\.com/[^])">]* -Sha256: [0-9A-Fa-f]{64} +S[Hh][Aa]256: [0-9A-Fa-f]{64} SHA256::ConvertToBytes\("[0-9A-Fa-f]{64}" # data urls data:[a-zA-Z=;,/0-9+-]+ diff --git a/doc/specs/#1012 - Show dependencies.md b/doc/specs/#1012 - Show dependencies.md @@ -0,0 +1,133 @@ +--- +author: Florencia Zanollo fzanollo/t-fzanollo@microsoft.com +created on: 2021-05-28 +last updated: 2021-05-28 +issue id: 1012 +--- + +# Show dependencies + +For [#1012](https://github.com/microsoft/winget-cli/issues/1012) + +## Abstract +Several packages require other packages as dependencies. The Windows Package Manager should be able to support declared dependencies and, as a first step to manage them, inform the user about any required ones. + +## Solution Design +The Windows Package Manager should be able to report package dependency information for each of the four different types of dependencies declared in the [v1.0 manifest schemas](https://github.com/microsoft/winget-cli/blob/master/schemas/JSON/manifests/v1.0.0/). + +* Windows Features +* Windows Libraries +* Package Dependencies (same source) +* External Dependencies + +Only dependencies declared in the manifest/installer will be shown, not the entire dependency graph. + +### install +The install command will enumerate the dependencies of the package version being installed as follows: +``` +> winget install Notepad++ +Found Notepad++ [Notepad++.Notepad++] +This application is licensed to you by its owner. +Microsoft is not responsible for, nor does it grant any licenses to, third-party packages. +This package requires the following dependencies: + - Windows Feature: + Hyper-V + - Package: + Microsoft.WindowsTerminal +Downloading https://github.com/notepad-plus-plus/notepad-plus-plus/releases/download/v7.9.5/npp.7.9.5.Installer.x64.exe +Successfully verified installer hash +Starting package install... +``` + +### show +The show command will enumerate the dependencies of the package as follows: +``` +> winget show Notepad++ +Found Notepad++ [Notepad++.Notepad++] +Version: 7.9.5 +Publisher: Notepad++ Team +Author: Don Ho +Moniker: notepad++ +Description: Notepad++ is a free (as in “free speech” and also as in “free beer”) source code editor and Notepad replacement that supports several languages. Running in the MS Windows environment, its use is governed by GNU General Public License. +Homepage: https://notepad-plus-plus.org/ +License: GPL-2.0-only +License Url: https://raw.githubusercontent.com/notepad-plus-plus/notepad-plus-plus/v7.9.5/LICENSE +Installer: + Type: Nullsoft + Locale: en-US + Download Url: https://github.com/notepad-plus-plus/notepad-plus-plus/releases/download/v7.9.5/npp.7.9.5.Installer.x64.exe + SHA256: 4881548cd86491b453520e83c19292c93b9c6ce485a1f9eb9301e3913a9baced + Dependencies: + - Windows Feature: + Hyper-V + - Package: + Microsoft.WindowsTerminal +``` + +### upgrade +The upgrade command will enumerate the dependencies of the package as follows: +``` +> winget upgrade Notepad++ +Found Notepad++ [Notepad++.Notepad++] +This application is licensed to you by its owner. +Microsoft is not responsible for, nor does it grant any licenses to, third-party packages. +This package requires the following dependencies: + - Windows Feature: + Hyper-V + - Package: + Microsoft.WindowsTerminal +Successfully verified installer hash +Starting package install... +``` +As of now, it will not try to validate nor install any of the dependencies for any package version. + +### uninstall +Uninstall needs more work as we don't have the actual installer to get the dependencies from. This will not be added in this step. + +### validate +Will gather and report dependencies for all of the installers found. Will not check if they are valid nor if there are duplicates. +``` +Manifest has the following dependencies that were not validated; ensure that they are valid: + - Windows Feature: + Hyper-V + - Package: + Microsoft.WindowsTerminal +Manifest validation succeeded. +``` + +### import +Will gather all the dependencies from the packages included in the import and show them together before starting. +``` +The packages found in this import have the following dependencies: + - Windows Feature: + Hyper-V + Containers + - Windows Libraries: + Microsoft.WinJS + - Package: + Microsoft.WindowsTerminal + - External: + JDK-11.0.10 +Found [Notepad++.Notepad++] +This application is licensed to you by its owner. +Microsoft is not responsible for, nor does it grant any licenses to, third-party packages. +Downloading https://github.com/notepad-plus-plus/notepad-plus-plus/releases/download/v8/npp.8.0.Installer.x64.exe +Successfully verified installer hash +Starting package install... +Successfully installed +Found [plex.Plex] +This application is licensed to you by its owner. +Microsoft is not responsible for, nor does it grant any licenses to, third-party packages. +Successfully verified installer hash +Starting package install... +Successfully installed +``` + +## Capabilities +It's only an informational feature, will not check if the dependency is a valid one, nor if the source is available. +If a dependency is declared more than once (for example when gathering all dependencies in an import) it will only show the highest minimum version needed. + +Keep in mind dependencies can be declared on the root manifest and on each of the installers. If they happen to be declared in both, installer's dependencies will override those of the manifest. With the manifest's dependencies working as a default whenever installer's dependencies are not declared. + +## Future considerations +It may be able to enable/disable this feature using extra options for the command. diff --git a/doc/specs/#163 - Dependencies.md b/doc/specs/#163 - Dependencies.md @@ -58,7 +58,7 @@ These include other packages. The restriction on these dependencies is that they ### External Dependencies These include dependencies from outside of the source the original package is distributed. In some cases suitable items may exist in the same source, but for licensing or personal preference, no explicit package should be required. One example is Java. Many vendors offer JREs and JDKs so it may be more reasonable to have a user informed, and allow the user to confirm the presence of a dependency. - +As a first step the Windows Package Manager should show dependency information to the user, see issue [1012](github.com/microsoft/winget-cli/issues/1012) with [spec](../../dependencies/doc/specs/%231012%20-%20Show%20dependencies.md). ## UI/UX Design @@ -118,4 +118,4 @@ The import command may be able to take advantage of determining all dependencies [Scoop Dependencies](https://scoop.netlify.app/concepts/#dependencies) -[Chocolatey Create Packages](https://docs.chocolatey.org/en-us/create/create-packages)- \ No newline at end of file +[Chocolatey Create Packages](https://docs.chocolatey.org/en-us/create/create-packages)