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

feat: check for and list valid versions and targets programmatically in phylum-init #74

Merged
merged 5 commits into from Jul 14, 2022

Conversation

maxrake
Copy link
Contributor

@maxrake maxrake commented Jul 12, 2022

This PR takes on two issues and is relevant now that phylum-dev/cli#528 has been merged into the CLI, adding a new supported platform. The next release of the CLI, with this new supported platform, will cause the phylum-init script to be out of date. Instead of updating the static collection of supported platforms, this PR will help to ensure the synchronization is maintained for any changes going forward. Changes include:

  • Check for valid versions by using the GitHub API to compare against actual releases
    • Supported target triples programmatically generated based on the results
    • Users will be told when the version provided as an option is not valid
    • Removed SUPPORTED_TARGET_TRIPLES static collection
  • Add --list-releases and --list-targets options
    • These are mutually exclusive options
    • Listing Rust target triples are for a specific release version
  • Format and refactor throughout

Closes #24
Closes #26

Checklist

  • Does this PR have an associated issue (i.e., closes #<issueNum> in description above)?
  • Have you ensured that you have met the expected acceptance criteria?
  • Have you created sufficient tests?
  • Have you updated all affected documentation?

Testing Screenshots

image

…in `phylum-init`

* Check for valid versions by using the GitHub API to compare against actual releases
  * Supported target triples programmatically generated based on the results
  * Users will be told when the version provided as an option is not valid
  * Removed `SUPPORTED_TARGET_TRIPLES` static collection
* Add `--list-releases` and `--list-targets` options
  * These are mutually exclusive options
  * Listing Rust target triples are for a specific release version
* Format and refactor throughout
  * Stop using `.get` method on `importlib_metadata.metadata()` results
    * See python/importlib_metadata#384
  * Add constant for `MIN_SUPPORTED_CLI_VERSION`
@maxrake maxrake requested a review from a team as a code owner July 12, 2022 19:44
@maxrake maxrake self-assigned this Jul 12, 2022
@maxrake maxrake requested a review from cd-work July 12, 2022 19:44
cd-work
cd-work previously approved these changes Jul 13, 2022
kylewillmon
kylewillmon previously approved these changes Jul 13, 2022
src/phylum/init/cli.py Outdated Show resolved Hide resolved
src/phylum/init/cli.py Outdated Show resolved Hide resolved
@maxrake maxrake dismissed stale reviews from kylewillmon and cd-work via 5c8af78 July 13, 2022 18:44
@maxrake maxrake merged commit 7066565 into main Jul 14, 2022
@maxrake maxrake deleted the api_lists branch July 14, 2022 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants