Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add hab install to download and install required distros #112

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

MHendricks
Copy link
Member

Add the cli command hab install. This resolves the required distros for multiple URI's against a remote download server, downloads and installs any missing distros.

This also re-works how distros are resolved into a DistroFinder class or subclasses. These can be used to customize how distros are resolved by hab. This includes resolving distros from aws s3 buckets.

Checklist

  • I have read the CONTRIBUTING.md document
  • I formatted my changes with black
  • I linted my changes with flake8
  • I have added documentation regarding my changes where necessary
  • Any pre-existing tests continue to pass
  • Additional tests were made covering my changes

Types of Changes

  • Bugfix (change that fixes an issue)
  • New Feature (change that adds functionality)
  • Documentation Update (if none of the other choices apply)

Proposed Changes

@MHendricks MHendricks marked this pull request as draft November 26, 2024 23:44
@MHendricks MHendricks force-pushed the mikeh/download branch 4 times, most recently from 15b5adb to 26f3146 Compare December 6, 2024 20:29
- If a object processed by `hab.utils.dump_object` has a dump method, it
will be called. Verbosity is now passed to dump_object.
- Improvements to Site.dump output including calling dump on file paths.
- `Resolver.resolve_requirements` will now call `Solver.simplify_requirements`
if passed a list automatically.
- `MergeDict.default_format` now recursively formats dictionary values.
- Documentation improvement.
Use the command `tox p` or `tox run-parallel` to enable parallel mode.
@MHendricks MHendricks force-pushed the mikeh/download branch 2 times, most recently from 29367d7 to 988eca6 Compare December 7, 2024 03:00
This class will replace the current code used to find distros. This allows
us to implement sub-classes to change how they are found. For example to
allow us to resolve dependencies hosted on the cloud for download and install.

Add `hab.utils.glob_path` that supports globbing a pathlib.Path object
with glob strings in the path.
These classes allow hab to resolve distros stored as .zip files both locally
and on cloud services (aws s3 buckets).
- Support sidecar .hab.json files next to the distro .zip files for remote
services that don't support reading ranges of a file.
- For services that support reading ranges of files like s3 it can download
the .hab.json file from inside of the remote .zip file without downloading
the entire .zip file first.
- Add `hab.utils.loads_json` that raises the same errors as `load_json_file`
but works on strings instead of files.
- Add `hab install` command that resolves all distros required to resolve
multiple URI's and then download and install any missing distros.
- Distro resolving is now handled by `DistroFinder` or sub-class.
- Site now has a downloads dictionary that configures how `hab install`
can resolve remote distros for installing locally.
- `Resolver.distro_mode_override` with context can be used to change
`Resolver.distro`'s output to the `Site.downloads["distros"] used to find
remote distros to install.
@MHendricks
Copy link
Member Author

I've been thinking about dropping python 3.6 for a while and some tests I'm working on are suffering from packaging.requirements not comparing equal in 3.6 which is making it so I'm likely to drop official support for it in this PR.

This test will break python 3.6 and I'm likely to drop support for 3.6 because of it.
The test fails because identical pathlib requirements don't compare equal in 3.6.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant