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

Install phylum #22

Merged
merged 27 commits into from
Apr 25, 2022
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
d7f41c3
test: rename test module to be more specific and granular
maxrake Apr 18, 2022
4f58b70
test: rename test module and add package metadata tests
maxrake Apr 18, 2022
f7618bb
refactor: update project description and make more package metadata a…
maxrake Apr 18, 2022
cdd3387
feat: add ability to invoke the package entrypoint as a module
maxrake Apr 18, 2022
6f866bc
feat: add --version option to CLI
maxrake Apr 18, 2022
52dc24e
test: add test for script entry points and refactor test constants out
maxrake Apr 19, 2022
413f644
test: clean up package metadata tests
maxrake Apr 19, 2022
3f42157
build: bump the version to 0.1.1
maxrake Apr 19, 2022
a829e99
refactor: rename phylum-ci package to phylum
maxrake Apr 19, 2022
a508c9c
refactor: allow for multiple script entry points
maxrake Apr 19, 2022
0a87a65
build: add `requests` as a dependency
maxrake Apr 20, 2022
f7506e2
feat: add phylum-init script entry point and initial functionality
maxrake Apr 20, 2022
e50c543
build: swap pyyaml dependency for ruamel.yaml
maxrake Apr 20, 2022
ac97b03
refactor: detect the target triple automatically
maxrake Apr 21, 2022
ee527cb
refactor: pull constants from `get_target_triple` function up and ref…
maxrake Apr 22, 2022
30acd30
feat: verify file downloads with their `.minisig` signature files
maxrake Apr 22, 2022
709c763
style: add signature verification assumptions and format throughout
maxrake Apr 22, 2022
d40b521
refactor: allow for existing tokens and encapsulate the handling of t…
maxrake Apr 22, 2022
fdd24df
docs: add usage information for the `phylum-init` script
maxrake Apr 22, 2022
8c4c3cb
docs: add tip about using poetry to run script entry points
maxrake Apr 22, 2022
15b2abd
build: update to latest current dependencies
maxrake Apr 22, 2022
1eae5b4
docs: add changelog entry
maxrake Apr 22, 2022
0815c8e
fix: account for XDG Base Directory Spec layout for CLI versions > 2.2.0
maxrake Apr 23, 2022
3703086
refactor: remove the `phylum` module shim pointing to `phylum.init`
maxrake Apr 23, 2022
56e7bfb
style: remove the list of possible features from comments in code in …
maxrake Apr 23, 2022
aad40eb
refactor: update option names, help messages, and zip file extraction…
maxrake Apr 23, 2022
08cb36f
refactor: respond to review comments
maxrake Apr 25, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased
### Added
* `phylum-init` script entry point and initial functionality
* Test workflows for local and CI based testing
* Preview and Release workflows for Staging and Production environments
* Phylum analyze workflow for PRs
Expand Down
17 changes: 13 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Look through the GitHub issues for features to work on, which will be labeled wi
### Write Documentation

The `phylum-ci` project could always use more documentation, whether as part of the
official phylum-ci docs, in docstrings, or even on the web in blog posts, articles, and such.
official phylum docs, in docstrings, or even on the web in blog posts, articles, and such.

### Submit Feedback

Expand Down Expand Up @@ -144,11 +144,20 @@ interact with `pytest` by passing additional positional arguments:

```sh
# run a specific test module across all test environments
poetry run tox tests/test_phylum_ci.py
poetry run tox tests/test_package_metadata.py
# run a specific test module across a specific test environment
poetry run tox -e py39 test/test_phylum_ci.py
poetry run tox -e py39 test/test_package_metadata.py
# run a specific test function within a test module, in a specific test environment
poetry run tox -e py310 test/test_phylum_ci.py::test_python_version
poetry run tox -e py310 test/test_package_metadata.py::test_python_version
# passing additional options to pytest requires using the double dash escape
poetry run tox -e py310 -- --help
```

To run a script entry point with the local checkout of the code (in develop mode), use `poetry`:

```sh
# If not done previously, ensure the project is installed by poetry (only required once)
poetry install
# Use the `poetry run` command to ensure the installed project is used
poetry run phylum-init -h
```
40 changes: 29 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# phylum-ci
[![PyPI](https://img.shields.io/pypi/v/phylum-ci)](https://pypi.org/project/phylum-ci/)
![PyPI - Status](https://img.shields.io/pypi/status/phylum-ci)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/phylum-ci)](https://pypi.org/project/phylum-ci/)
[![PyPI](https://img.shields.io/pypi/v/phylum)](https://pypi.org/project/phylum/)
![PyPI - Status](https://img.shields.io/pypi/status/phylum)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/phylum)](https://pypi.org/project/phylum/)
[![GitHub](https://img.shields.io/github/license/phylum-dev/phylum-ci)](https://github.com/phylum-dev/phylum-ci/blob/main/LICENSE)
[![GitHub issues](https://img.shields.io/github/issues/phylum-dev/phylum-ci)](https://github.com/phylum-dev/phylum-ci/issues)
![GitHub last commit](https://img.shields.io/github/last-commit/phylum-dev/phylum-ci)
Expand All @@ -13,32 +13,50 @@ Python package for handling CI and other integrations

### Installation

The `phylum-ci` package is pip installable for the environment of your choice:
The `phylum` Python package is pip installable for the environment of your choice:

```sh
pip install phylum-ci
pip install phylum
```

It can also also be installed in an isolated environment with the excellent [`pipx` tool](https://pypa.github.io/pipx/):

```sh
# Globally install the app(s) on your system in an isolated virtual environment for the package
pipx install phylum-ci
pipx install phylum
# Use the apps from the package in an ephemeral environment
pipx run phylum-ci <options>
pipx run --spec phylum phylum-init <options>
```

It requires Python 3.7+ to run.

### Usage
<!-- TODO: Fill this section in as functionality is added -->
The `phylum-ci` package exposes its functionality with a command line interface (CLI). To view the options available
from the CLI, print the help message:

The `phylum` Python package exposes its functionality with a command line interface (CLI).
To view the options available from the CLI, print the help message from one of the scripts provided as entry points:

```sh
phylum-ci -h
phylum-init -h
```

The functionality can also be accessed by calling the module:

```sh
python -m phylum.init -h
# The top level package is redirected to the phylum.init package:
python -m phylum -h
maxrake marked this conversation as resolved.
Show resolved Hide resolved
```

#### `phylum-init`

The `phylum-init` script can be used to fetch and install the Phylum CLI.
It will attempt to install the latest released version of the CLI but can be specified to fetch a specific version.
It will attempt to automatically determine the correct CLI release, based on the platform where the script is run, but
a specific release target can be specified.
It will accept a Phylum token from an environment variable or specified as an option, but will also function in the case
that no token is provided. This can be because there is already a token set that should continue to be used or because
no token exists and one will need to be manually created or set, after the CLI is installed.

## License

MIT - with complete text available in the [LICENSE](LICENSE) file.
Expand Down
2 changes: 1 addition & 1 deletion docs/release_process.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ approach, an option is exposed to optionally publish the built package to the
environment. For example using `pipx` to run a specific developmental release version:

```sh
pipx run --index-url https://test.pypi.org/simple/ --spec "phylum-ci==0.0.2.dev6" phylum-ci -h
pipx run --index-url https://test.pypi.org/simple/ --spec "phylum==0.0.2.dev6" phylum-init -h
```

Currently this workflow uses the `Staging` environment, as configured in
Expand Down
Loading