-
Notifications
You must be signed in to change notification settings - Fork 1
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
Install phylum #22
Merged
Merged
Install phylum #22
Conversation
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
With this change it is possible to call the package entrypoint as: `python -m phylum_ci`
There is at least a little bit of functionality provided by this package now and v0.1.0 is already taken/used
The PyPI request to take over the `phylum` package name was granted. This change makes use of that name, changing `phylum-ci` and `phylum_ci` to `phylum` everywhere that it makes sense. There are still some instances that should remain `phylum-ci` since that is what the GitHub repository is named.
The plan is to have multiple script entry points. This change accounts for the package structure needed to have them and populates the first one, phylum-install. It also refactors the test package into unit and functional tests.
* Add deps: cryptography, packaging, and pyyaml\n* Rename phylum.install package to phylum.init\n* Add initial functionality to fetch and install the Phylum CLI
The pyyaml dependency fails to install in Python 3.7 environments for Apple Silicon systems. This appears to be due to the default nature in which the sdist is attempted to be installed by Poetry and with the LibYAML c bindings. There is no apparent method to direct Poetry to use the `--without-libyaml` option when building from source. One advantage of switching to ruamel.yaml is that round-tripping is supported, which means order and comments are preserved with loading-modifying-dumping a YAML file.
…he token option Making this change means the script won't fail if the `--token` option is not specified. This means the script can be used to install or re-install on systems that already have a registered user and existing settings.
kylewillmon
previously approved these changes
Apr 22, 2022
…favor of GitHub issues
kylewillmon
requested changes
Apr 25, 2022
kylewillmon
approved these changes
Apr 25, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This PR adds the
phylum-init
script entry point to thephylum
package. The package was renamed fromphylum-ci
tophylum
as a result of a successful PEP 541 Request: phylum to acquire the project name in PyPI. The initial goal, as specified in #5, was to replicate the behavior of the existinginstall-phylum-latest-action
GitHub Action within the Python package. This was achieved and then exceeded a bit. It goes further in thatphylum-init
can be used to install a specified "target triple" and providing a Phylum token is not required. That makes the script usable for both the integrations and just on its own.Performing the Minisign signature verification was not as easy as using an existing python implementation...mostly b/c one does not readily exist as a package on PyPI. A custom implementation was written and annotated to make it abundantly clear that it's not the best option, has a number of assumptions, and should not be used as a library for any other projects.
Here are some potential features to add to the CLI (pulled from comments in the code):
SUPPORTED_TARGET_TRIPLES
--list
option, to show which versions are availableEDIT: These have been turned into issues and removed from the code as comments:
phylum
Python package #23phylum-init
#24phylum-init
#25phylum-init
#26Test coverage is just getting off the ground and, while the structure was added during this PR, the numbers are not where they should be:
Another issue will be used (#11) or created to increase that coverage.
Checklist
Semver-*
label?Issue
Closes #5