Skip to content

Commit

Permalink
Merge pull request #400 from C-Accel-CRIPT/develop
Browse files Browse the repository at this point in the history
Release 2.2.0
  • Loading branch information
nh916 authored Nov 17, 2023
2 parents 8a3aba2 + d42ab8f commit f5126a6
Show file tree
Hide file tree
Showing 88 changed files with 2,448 additions and 1,638 deletions.
3 changes: 1 addition & 2 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

## Changes

## Tests

## Known Issues

## Notes
Expand All @@ -12,3 +10,4 @@

- [ ] My name is on the list of contributors (`CONTRIBUTORS.md`) in the pull request source branch.
- [ ] I have updated the documentation to reflect my changes.
- [ ] My code changes have been verified by automated tests and pass all relevant test scenarios.
4 changes: 2 additions & 2 deletions .github/workflows/build_and_deploy_docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: 3.x
- run: pip install -r requirements_docs.txt
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docs_check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ jobs:

steps:
- name: Checkout Repository
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Set Up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: 3.11

Expand Down
50 changes: 50 additions & 0 deletions .github/workflows/doctest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# check documentation code example with pytest doctest and gives an error if a code example is wrong

name: Doctest
permissions: read-all

on:
push:
branches:
- main
- develop
- trunk-merge/**
pull_request:
branches:
- main
- develop

jobs:
doctest:
strategy:
matrix:
python-version: [3.12]
os: [ubuntu-latest]

runs-on: ${{ matrix.os }}

env:
CRIPT_HOST: https://lb-stage.mycriptapp.org/
CRIPT_TOKEN: 123456789
CRIPT_STORAGE_TOKEN: 987654321
CRIPT_TESTS: False

steps:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Check out code
uses: actions/checkout@v4

- name: Install dependencies
run: |
python${{ matrix.python-version }} -m pip install --upgrade pip
pip install -r requirements_dev.txt
- name: pip install CRIPT Python SDK local package
run: python${{ matrix.python-version }} -m pip install -e .

- name: Run Doctests
run: python${{ matrix.python-version }} -m pytest --doctest-modules src/cript/
6 changes: 3 additions & 3 deletions .github/workflows/mypy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@ jobs:
mypy-test:
strategy:
matrix:
python-version: [3.11]
python-version: [3.12]
os: [ubuntu-latest]

runs-on: ${{ matrix.os }}

steps:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Check out code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Install dependencies
run: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test_coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
python-version: [3.11]
python-version: [3.12]

env:
CRIPT_HOST: https://lb-stage.mycriptapp.org/
Expand All @@ -30,10 +30,10 @@ jobs:
CRIPT_TESTS: False

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: 3.11

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test_examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: [3.11]
python-version: [3.12]

env:
CRIPT_HOST: https://lb-stage.mycriptapp.org/
Expand All @@ -28,7 +28,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:

matrix:
os: [ubuntu-latest, macos-latest]
python-version: [3.7, 3.11]
python-version: [3.8, 3.12]

env:
CRIPT_HOST: https://lb-stage.mycriptapp.org/
Expand All @@ -37,7 +37,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/trunk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Trunk Check
uses: trunk-io/trunk-action@v1
6 changes: 5 additions & 1 deletion .trunk/configs/.cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@
"setuptools",
"miniconda",
"pymdown",
"BCDB"
"BCDB",
"doctest",
"Doctest",
"Doctests",
"linenums"
]
}
22 changes: 11 additions & 11 deletions .trunk/trunk.yaml
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
version: 0.1
cli:
version: 1.14.2
version: 1.15.0
plugins:
sources:
- id: trunk
ref: v1.2.2
ref: v1.2.3
uri: https://github.com/trunk-io/plugins
lint:
enabled:
- bandit@1.7.5
- checkov@2.4.9
- osv-scanner@1.3.6
- trivy@0.44.1
- trufflehog@3.54.0
- osv-scanner@1.4.0
- trivy@0.45.0
- trufflehog@3.56.0
- svgo@3.0.2
- cspell@7.1.1
- cspell@7.3.6
- actionlint@1.6.25
- black@23.7.0
- black@23.9.1
- git-diff-check
- gitleaks@8.18.0
- isort@5.12.0
- markdownlint@0.35.0
- markdownlint@0.36.0
- oxipng@8.0.0
- prettier@3.0.2
- ruff@0.0.286
- prettier@3.0.3
- ruff@0.0.289
- taplo@0.8.1
- yamllint@1.32.0
ignore:
Expand All @@ -40,7 +40,7 @@ lint:

runtimes:
enabled:
- go@1.19.5
- go@1.21.0
- node@18.12.1
- python@3.10.8
actions:
Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![License](./CRIPT_full_logo_colored_transparent.png)](https://github.com/C-Accel-CRIPT/Python-SDK/blob/develop/LICENSE.md)

[![License](https://img.shields.io/github/license/C-Accel-CRIPT/cript?style=flat-square)](https://github.com/C-Accel-CRIPT/Python-SDK/blob/develop/LICENSE.md)
[![Python](https://img.shields.io/badge/Language-Python%203.7+-blue?style=flat-square&logo=python)](https://www.python.org/)
[![Python](https://img.shields.io/badge/Language-Python%203.8+-blue?style=flat-square&logo=python)](https://www.python.org/)
[![Code style is black](https://img.shields.io/badge/Code%20Style-black-000000.svg?style=flat-square&logo=python)](https://github.com/psf/black)
[![Link to CRIPT website](https://img.shields.io/badge/platform-criptapp.org-blueviolet?style=flat-square)](https://criptapp.org/)
[![Using Pytest](https://img.shields.io/badge/Dependencies-pytest-green?style=flat-square&logo=Pytest)](https://docs.pytest.org/en/7.2.x/)
Expand Down Expand Up @@ -36,7 +36,7 @@ The CRIPT Python SDK allows programmatic access to the [CRIPT platform](https://

## Installation

CRIPT Python SDK requires Python 3.7+
CRIPT Python SDK requires Python 3.8+

The latest released of CRIPT Python SDK is available on [Python Package Index (PyPI)](https://pypi.org/project/cript/)

Expand All @@ -48,7 +48,9 @@ pip install cript

## Documentation

To learn more about the CRIPT Python SDK please check the [CRIPT-SDK documentation](https://c-accel-cript.github.io/Python-SDK/)
To learn more about the CRIPT Python SDK please check the [CRIPT Python SDK user documentation](https://c-accel-cript.github.io/Python-SDK/)

To learn more about the internal workings of the CRIPT Python SDK please check the [CRIPT Python SDK internal documentation](https://github.com/C-Accel-CRIPT/Python-SDK/wiki)

---

Expand Down
14 changes: 8 additions & 6 deletions tests/conftest.py → conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@
import os

import pytest
from fixtures.primary_nodes import *
from fixtures.subobjects import *
from fixtures.supporting_nodes import *

import cript
from tests.fixtures.api_fixtures import *
from tests.fixtures.primary_nodes import *
from tests.fixtures.subobjects import *
from tests.fixtures.supporting_nodes import *


def _get_cript_tests_env() -> bool:
Expand Down Expand Up @@ -48,8 +49,6 @@ def cript_api():
"""
storage_token = os.getenv("CRIPT_STORAGE_TOKEN")

assert cript.api.api._global_cached_api is None

with cript.API(host=None, api_token=None, storage_token=storage_token) as api:
# overriding AWS S3 cognito variables to be sure we do not upload test data to production storage
# staging AWS S3 cognito storage variables
Expand All @@ -61,4 +60,7 @@ def cript_api():

yield api

assert cript.api.api._global_cached_api is None

@pytest.fixture(autouse=True)
def inject_doctest_namespace(doctest_namespace, cript_api):
doctest_namespace["api"] = cript_api
Loading

0 comments on commit f5126a6

Please sign in to comment.