-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from NexSabre/add-download-action
Add an option to download a package locally
- Loading branch information
Showing
8 changed files
with
59 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
# 1.1 | ||
- Add an option to download latest package locally | ||
|
||
# 1.0 | ||
- Introduce refactored code | ||
- Better messages | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
1.0 | ||
1.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from pip2spack.actions.action import Action | ||
from pip2spack.framework.messages import Messages | ||
from pip2spack.core.pypi_package import PyPiPackage | ||
from pip2spack.core.verification import Verification | ||
|
||
|
||
class DownloadAction(Action): | ||
ACTION = "download" | ||
PARAM_NAME = "ACTION" | ||
|
||
def fill_parser_arguments(self): | ||
self.parser.add_argument('name', type=str, nargs='+', help='Package name on the pypi.org') | ||
|
||
def process_action(self, configuration): | ||
ready_packages = Verification(configuration.name).available_packages | ||
self.download(ready_packages) | ||
|
||
@staticmethod | ||
def download(ready_packages): | ||
for key, value in ready_packages.items(): | ||
Messages.info(f"Download latest package for the {key}") | ||
|
||
d_package = PyPiPackage(value) | ||
d_package.download_versions() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters