This repository has been archived by the owner on May 31, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: add workflows * fix: typo fdopen to os.fdopen * fix: null file * fix: parameters test * fix: removing tests parameters * fix: remove tests * fix: remove windows and osx * fix: remove travis * add: test api related #324 * fix: model catalog username * fix: setup secrets
- Loading branch information
Showing
7 changed files
with
95 additions
and
67 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,40 @@ | ||
# This workflow will install Python dependencies, run tests and lint with a single version of Python | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | ||
|
||
name: Python application | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
build: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: [3.7, 3.8, 3.9] | ||
os: [ubuntu-latest] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install flake8 pytest | ||
pip install -r test-requirements.txt | ||
- name: Lint with flake8 | ||
run: | | ||
# stop the build if there are Python syntax errors or undefined names | ||
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | ||
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | ||
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | ||
- name: Test with pytest | ||
run: | | ||
python setup.py install | ||
pytest | ||
env: | ||
MODEL_CATALOG_USERNAME_TEST: ${{ secrets.MODEL_CATALOG_USERNAME_TEST }} | ||
MODEL_CATALOG_PASSWORD_TEST: ${{ secrets.MODEL_CATALOG_PASSWORD_TEST }} |
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,29 @@ | ||
# This workflow will upload a Python Package using Twine when a release is created | ||
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries | ||
|
||
name: Upload Python Package | ||
|
||
on: | ||
release: | ||
types: [created] | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.x' | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install setuptools wheel twine | ||
- name: Build and publish | ||
env: | ||
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} | ||
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | ||
run: | | ||
python setup.py sdist bdist_wheel | ||
twine upload dist/* |
This file was deleted.
Oops, something went wrong.
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 +1 @@ | ||
/dev/null | ||
print('hi') |
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 |
---|---|---|
|
@@ -7,32 +7,33 @@ | |
|
||
def test_configure(): | ||
runner = CliRunner() | ||
model_catalog = os.environ['MODEL_CATALOG_PASSWORD'] | ||
result = runner.invoke(credentials, | ||
["--server", "https://api.models.mint.isi.edu/v1.4.0", | ||
"--username", "[email protected]", | ||
"--git_username", "mintbot", | ||
"--git_token", "asdfsafs", | ||
"--password", model_catalog, | ||
"--dockerhub_username", "a", | ||
"--name", "pedro", | ||
"--profile", "testing"]) | ||
model_catalog_username = os.environ['MODEL_CATALOG_USERNAME_TEST'] | ||
model_catalog_password = os.environ['MODEL_CATALOG_PASSWORD_TEST'] | ||
result = runner.invoke(credentials, [ | ||
"--username", model_catalog_username, | ||
"--git_username", "mintbot", | ||
"--git_token", "asdfsafs", | ||
"--password", model_catalog_password, | ||
"--dockerhub_username", "a", | ||
"--name", "pedro", | ||
"--profile", "testing" | ||
]) | ||
assert result.exit_code == 0 | ||
|
||
|
||
def test_get_api(): | ||
runner = CliRunner() | ||
model_catalog = os.environ['MODEL_CATALOG_PASSWORD'] | ||
result = runner.invoke(credentials, | ||
["--server", "https://api.models.mint.isi.edu/v1.4.0", | ||
"--username", "[email protected]", | ||
"--git_username", "mintbot", | ||
"--git_token", "asdfsafs", | ||
"--password", model_catalog, | ||
"--dockerhub_username", "a", | ||
"--name", "pedro", | ||
"--profile", "testing"]) | ||
model_catalog_username = os.environ['MODEL_CATALOG_USERNAME_TEST'] | ||
model_catalog_password = os.environ['MODEL_CATALOG_PASSWORD_TEST'] | ||
result = runner.invoke(credentials, [ | ||
"--username", model_catalog_username, | ||
"--git_username", "mintbot", | ||
"--git_token", "asdfsafs", | ||
"--password", model_catalog_password, | ||
"--dockerhub_username", "a", | ||
"--name", "pedro", | ||
"--profile", "testing" | ||
]) | ||
assert result.exit_code == 0 | ||
|
||
api = get_api(profile="testing") | ||
assert api |