-
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.
Adding all kinds of changes. Fixing branch name Updating GHA Adding some more info to project.toml. Okay this is it.
- Loading branch information
Showing
22 changed files
with
644 additions
and
182 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 |
---|---|---|
@@ -0,0 +1,65 @@ | ||
name: Continuous Integration | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
ci: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ["3.10", "3.11", "3.12"] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
# Cache the installation of Poetry itself, e.g. the next step. This prevents the workflow | ||
# from installing Poetry every time, which can be slow. Note the use of the Poetry version | ||
# number in the cache key, and the "-0" suffix: this allows you to invalidate the cache | ||
# manually if/when you want to upgrade Poetry, or if something goes wrong. This could be | ||
# mildly cleaner by using an environment variable, but I don't really care. | ||
- name: cache poetry install | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/.local | ||
key: poetry-1.8.3-0 | ||
|
||
# Install Poetry. You could do this manually, or there are several actions that do this. | ||
# `snok/install-poetry` seems to be minimal yet complete, and really just calls out to | ||
# Poetry's default install script, which feels correct. I pin the Poetry version here | ||
# because Poetry does occasionally change APIs between versions and I don't want my | ||
# actions to break if it does. | ||
# | ||
# The key configuration value here is `virtualenvs-in-project: true`: this creates the | ||
# venv as a `.venv` in your testing directory, which allows the next step to easily | ||
# cache it. | ||
- uses: snok/[email protected] | ||
with: | ||
version: 1.8.3 | ||
virtualenvs-create: true | ||
virtualenvs-in-project: true | ||
|
||
# Cache your dependencies (i.e. all the stuff in your `pyproject.toml`). Note the cache | ||
# key: if you're using multiple Python versions, or multiple OSes, you'd need to include | ||
# them in the cache key. I'm not, so it can be simple and just depend on the poetry.lock. | ||
- name: cache deps | ||
id: cache-deps | ||
uses: actions/cache@v4 | ||
with: | ||
path: .venv | ||
key: pydeps-${{ hashFiles('**/poetry.lock') }} | ||
|
||
# Install dependencies. `--no-root` means "install all dependencies but not the project | ||
# itself", which is what you want to avoid caching _your_ code. The `if` statement | ||
# ensures this only runs on a cache miss. | ||
- run: poetry install --no-interaction --no-root | ||
if: steps.cache-deps.outputs.cache-hit != 'true' | ||
- run: poetry install --no-interaction | ||
- run: poetry run task ci |
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,105 @@ | ||
name: Publish | ||
on: | ||
push: | ||
tags: | ||
- '*' | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
hash: ${{ steps.hash.outputs.hash }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
# Cache the installation of Poetry itself, e.g. the next step. This prevents the workflow | ||
# from installing Poetry every time, which can be slow. Note the use of the Poetry version | ||
# number in the cache key, and the "-0" suffix: this allows you to invalidate the cache | ||
# manually if/when you want to upgrade Poetry, or if something goes wrong. This could be | ||
# mildly cleaner by using an environment variable, but I don't really care. | ||
- name: cache poetry install | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/.local | ||
key: poetry-1.8.3-0 | ||
|
||
# Install Poetry. You could do this manually, or there are several actions that do this. | ||
# `snok/install-poetry` seems to be minimal yet complete, and really just calls out to | ||
# Poetry's default install script, which feels correct. I pin the Poetry version here | ||
# because Poetry does occasionally change APIs between versions and I don't want my | ||
# actions to break if it does. | ||
# | ||
# The key configuration value here is `virtualenvs-in-project: true`: this creates the | ||
# venv as a `.venv` in your testing directory, which allows the next step to easily | ||
# cache it. | ||
- uses: snok/[email protected] | ||
with: | ||
version: 1.8.3 | ||
virtualenvs-create: true | ||
virtualenvs-in-project: true | ||
|
||
# Cache your dependencies (i.e. all the stuff in your `pyproject.toml`). Note the cache | ||
# key: if you're using multiple Python versions, or multiple OSes, you'd need to include | ||
# them in the cache key. I'm not, so it can be simple and just depend on the poetry.lock. | ||
- name: cache deps | ||
id: cache-deps | ||
uses: actions/cache@v4 | ||
with: | ||
path: .venv | ||
key: pydeps-${{ hashFiles('**/poetry.lock') }} | ||
|
||
# Install dependencies. `--no-root` means "install all dependencies but not the project | ||
# itself", which is what you want to avoid caching _your_ code. The `if` statement | ||
# ensures this only runs on a cache miss. | ||
- run: poetry install --no-interaction --no-root | ||
if: steps.cache-deps.outputs.cache-hit != 'true' | ||
- run: poetry install --no-interaction | ||
- run: poetry build | ||
- name: generate hash | ||
id: hash | ||
run: cd dist && echo "hash=$(sha256sum * | base64 -w0)" >> $GITHUB_OUTPUT | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
path: ./dist | ||
provenance: | ||
needs: [build] | ||
permissions: | ||
actions: read | ||
id-token: write | ||
contents: write\ | ||
uses: slsa-framework/slsa-github-generator/.github/workflows/[email protected] | ||
with: | ||
base64-subjects: ${{ needs.build.outputs.hash }} | ||
create-release: | ||
# Upload the sdist, wheels, and provenance to a GitHub release. They remain | ||
# available as build artifacts for a while as well. | ||
needs: [provenance] | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
steps: | ||
- uses: actions/download-artifact@v4 | ||
- name: create release | ||
run: > | ||
gh release create --draft --repo ${{ github.repository }} | ||
${{ github.ref_name }} | ||
*.intoto.jsonl/* artifact/* | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
publish-pypi: | ||
needs: [provenance] | ||
# Wait for approval before attempting to upload to PyPI. This allows reviewing the | ||
# files in the draft release. | ||
environment: | ||
name: publish | ||
url: https://pypi.org/project/assists/${{ github.ref_name }} | ||
runs-on: ubuntu-latest | ||
permissions: | ||
id-token: write | ||
steps: | ||
- uses: actions/download-artifact@v4 | ||
- uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
packages-dir: artifact/ |
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,18 @@ | ||
# See https://pre-commit.com for more information | ||
# See https://pre-commit.com/hooks.html for more hooks | ||
repos: | ||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: v0.6.2 | ||
hooks: | ||
- id: ruff | ||
- id: ruff-format | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v3.2.0 | ||
hooks: | ||
- id: check-merge-conflict | ||
- id: debug-statements | ||
- id: trailing-whitespace | ||
- id: end-of-file-fixer | ||
- id: check-yaml | ||
- id: check-toml | ||
- id: check-added-large-files |
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,130 @@ | ||
# `ast` | ||
|
||
**Usage**: | ||
|
||
```console | ||
$ ast [OPTIONS] COMMAND [ARGS]... | ||
``` | ||
|
||
**Options**: | ||
|
||
* `--install-completion`: Install completion for the current shell. | ||
* `--show-completion`: Show completion for the current shell, to copy it or customize the installation. | ||
* `--help`: Show this message and exit. | ||
|
||
**Commands**: | ||
|
||
* `aws`: AWS related tasks. | ||
* `az`: Azure related tasks. | ||
|
||
## `ast aws` | ||
|
||
AWS related tasks. | ||
|
||
**Usage**: | ||
|
||
```console | ||
$ ast aws [OPTIONS] COMMAND [ARGS]... | ||
``` | ||
|
||
**Options**: | ||
|
||
* `--help`: Show this message and exit. | ||
|
||
**Commands**: | ||
|
||
* `crane`: Login in to ECR with Crane. | ||
* `podman`: Login in to ECR with Podman. | ||
|
||
### `ast aws crane` | ||
|
||
Login in to ECR with Crane. | ||
|
||
**Usage**: | ||
|
||
```console | ||
$ ast aws crane [OPTIONS] REGISTRY | ||
``` | ||
|
||
**Arguments**: | ||
|
||
* `REGISTRY`: The registry to login to. [required] | ||
|
||
**Options**: | ||
|
||
* `--profile TEXT`: The AWS profile to use. | ||
* `--help`: Show this message and exit. | ||
|
||
### `ast aws podman` | ||
|
||
Login in to ECR with Podman. | ||
|
||
**Usage**: | ||
|
||
```console | ||
$ ast aws podman [OPTIONS] REGISTRY | ||
``` | ||
|
||
**Arguments**: | ||
|
||
* `REGISTRY`: The registry to login to. [required] | ||
|
||
**Options**: | ||
|
||
* `--profile TEXT`: The AWS profile to use. | ||
* `--help`: Show this message and exit. | ||
|
||
## `ast az` | ||
|
||
Azure related tasks. | ||
|
||
**Usage**: | ||
|
||
```console | ||
$ ast az [OPTIONS] COMMAND [ARGS]... | ||
``` | ||
|
||
**Options**: | ||
|
||
* `--help`: Show this message and exit. | ||
|
||
**Commands**: | ||
|
||
* `crane`: Login in to ACR with Crane. | ||
* `podman`: Login in to ACR with Podman. | ||
|
||
### `ast az crane` | ||
|
||
Login in to ACR with Crane. | ||
|
||
**Usage**: | ||
|
||
```console | ||
$ ast az crane [OPTIONS] REGISTRY | ||
``` | ||
|
||
**Arguments**: | ||
|
||
* `REGISTRY`: The registry to login to. [required] | ||
|
||
**Options**: | ||
|
||
* `--help`: Show this message and exit. | ||
|
||
### `ast az podman` | ||
|
||
Login in to ACR with Podman. | ||
|
||
**Usage**: | ||
|
||
```console | ||
$ ast az podman [OPTIONS] REGISTRY | ||
``` | ||
|
||
**Arguments**: | ||
|
||
* `REGISTRY`: The registry to login to. [required] | ||
|
||
**Options**: | ||
|
||
* `--help`: Show this message and exit. |
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
Oops, something went wrong.