This repository has been archived by the owner on Nov 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
221 additions
and
32 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,60 @@ | ||
name: Pre Release CI | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs:git | ||
build-and-test: | ||
name: Build & Test on ${{ matrix.os }}-py${{ matrix.python-version }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macos-latest] | ||
python-version: [3.9, '3.10', 3.11] | ||
defaults: | ||
run: | ||
shell: bash | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install Poetry | ||
uses: snok/install-poetry@v1 | ||
with: | ||
version: 1.3.2 | ||
|
||
- name: Build wheel | ||
run: | | ||
poetry build | ||
- name: Install the wheel | ||
run: | | ||
pip install dist/pinecone_resin*.whl | ||
- name: Create dev requirements file | ||
run: | | ||
poetry export -f requirements.txt --without-hashes --only dev -o only-dev.txt | ||
- name: Install dev requirements | ||
run: | | ||
pip install -r only-dev.txt | ||
- name: Run tests | ||
run: pytest --html=report.html --self-contained-html tests/unit | ||
|
||
- name: Upload pytest reports | ||
if: always() | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: pytest-report-${{ matrix.os }}-py${{ matrix.python-version }} | ||
path: .pytest_cache | ||
|
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
from .data_loader import ( | ||
load_from_path, | ||
CLIError, | ||
IDsNotUniqueError, | ||
DocumentsValidationError | ||
) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import click | ||
from click import ClickException | ||
|
||
from resin_cli.data_loader.data_loader import format_multiline | ||
|
||
|
||
class CLIError(ClickException): | ||
def format_message(self) -> str: | ||
return click.style(format_multiline(self.message), fg='red') | ||
|
||
|
||
class ConfigError(RuntimeError): | ||
pass |