Skip to content

Commit

Permalink
Enforce correct python version for testing. (#330)
Browse files Browse the repository at this point in the history
* fix-py-version

* change permissions for workflows

* correctly request python setup

* remove debug info

* flexible versions

* even more flexible

* revert mistake
  • Loading branch information
InnocentBug authored Sep 8, 2023
1 parent b21158d commit 24011d4
Show file tree
Hide file tree
Showing 12 changed files with 33 additions and 17 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/build_and_deploy_docs.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# build docs from master branch and push to gh-pages branch to be deployed to repository GitHub pages

name: Build & Deploy Docs
permissions: read-all

on:
push:
branches:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
# supported CodeQL languages.
#
name: CodeQL
permissions: read-all

on:
push:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# Source repository: https://github.com/actions/dependency-review-action
# Public documentation: https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/about-dependency-review#dependency-review-enforcement
name: Dependency Review

on:
push:
branches:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/docs_check.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# this CI workflow checks the documentation for any broken links or errors within documentation files/configuration
# and reports errors to catch errors and never deploy broken documentation
name: MkDocs CI Check
permissions: read-all

on:
push:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/mypy.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# check code types with mypy to be sure the static types are correct and make sense

name: MyPy Check
permissions: read-all

on:
push:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test_coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# WARNING: this workflow will fail if any of the tests within it fail

name: Test Coverage
permissions: read-all

on:
push:
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/test_examples.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Test Jupyter Notebook
permissions: read-all

on:
push:
Expand Down Expand Up @@ -28,6 +29,10 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: install test dependency
run: python3 -m pip install -r requirements_docs.txt
Expand Down
13 changes: 9 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Runs all the Python SDK tests within the `tests/` directory to check our code

name: Tests
name: CI Tests
permissions: read-all

on:
# trunk-ignore(yamllint/empty-values)
Expand Down Expand Up @@ -37,12 +38,16 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: pip install CRIPT Python SDK local package
run: python3 -m pip install .
run: python${{ matrix.python-version }} -m pip install .

- name: pip install requirements_dev.txt
run: python3 -m pip install -r requirements_dev.txt
run: python${{ matrix.python-version }} -m pip install -r requirements_dev.txt

- name: Run pytest on tests/
run: pytest ./tests/
run: python${{ matrix.python-version }} -m pytest ./tests/
3 changes: 2 additions & 1 deletion .github/workflows/trunk.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI
name: Trunk.io

on:
push:
Expand All @@ -11,6 +11,7 @@ on:
- main
- develop
- "*"
permissions: read-all

jobs:
trunk:
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
requests==2.31.0
jsonschema==4.17.3
jsonschema>=4.17.3
boto3==1.28.39
beartype==0.14.1
17 changes: 8 additions & 9 deletions requirements_dev.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
-r requirements.txt
black==23.7.0
mypy==1.5.1
pytest==7.4.0
pytest-cov==4.1.0
coverage==7.3.0
types-jsonschema==4.17.0.9
types-requests==2.31.0.1
types-boto3==1.0.2
deepdiff==6.3.1
mypy>=1.4.1
pytest>=7.4.0
pytest-cov>=4.1.0
types-jsonschema>=4.17.0.9
types-requests>=2.31.0.1
types-boto3>=1.0.2
deepdiff>=6.3.1
#lint-tools like black are managed by trunk, see .trunk/trunk.yaml
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ python_requires = >=3.7
include_package_data = True
install_requires =
requests==2.31.0
jsonschema==4.17.3
jsonschema>=4.17.3
beartype==0.14.1
boto3==1.28.39

Expand Down

0 comments on commit 24011d4

Please sign in to comment.