Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
113 commits
Select commit Hold shift + click to select a range
5cbe640
added linting and unit testing workflow
flavius-t May 18, 2022
fb460d2
workflow fix
flavius-t May 18, 2022
1ecd1a6
add venv activation between steps
flavius-t May 18, 2022
8146e3f
initial tc module commit
flavius-t May 18, 2022
39c654f
update workflow
flavius-t May 18, 2022
5afb0a2
workflow fix
flavius-t May 18, 2022
860adeb
workflow fix
flavius-t May 18, 2022
4b21513
add self-hosted workflow runner
flavius-t May 20, 2022
e717c0f
remove setup-python from self-hosted workflow
flavius-t May 20, 2022
56fd203
linting stringency changes
flavius-t May 20, 2022
fc1e715
Merge branch 'TC' of github.com:osensa/edgepi-python-sdk into TC
flavius-t May 20, 2022
bec60bc
fix workflow import errors
flavius-t May 20, 2022
a7413d6
activate virtual env
flavius-t May 20, 2022
c5ff819
initial tc module structure
flavius-t May 21, 2022
35e1973
refactor pylint workflow
flavius-t May 24, 2022
3d8bda7
ignore trailing-whitespace
flavius-t May 24, 2022
9b177af
add pylint ignores
flavius-t May 24, 2022
81a77a4
fix lint errors
flavius-t May 24, 2022
693c650
update docstrings
flavius-t May 24, 2022
3e9be2e
tc module structure update
flavius-t May 27, 2022
b871a29
fix update command opcodes
flavius-t May 27, 2022
af3d655
Merge pull request #19 from osensa/DAC
flavius-t May 27, 2022
09a2694
add opcode to register mapping
flavius-t May 27, 2022
4d5b01c
add collective configuration method
flavius-t May 27, 2022
0af7d50
add method for generating cr0 write command
flavius-t May 28, 2022
1393b3c
refactor update code generate methods
flavius-t May 30, 2022
3b92b17
debug refactoring
flavius-t May 30, 2022
16a9b1c
spi transfer issue debugging, and mock transfer
flavius-t Jun 1, 2022
ddfd084
refactor mock spi transfer to library
flavius-t Jun 1, 2022
986762b
add gpiozero requirement until spi transfer fixed
flavius-t Jun 1, 2022
a2a650c
refactor register reading
flavius-t Jun 1, 2022
145ac0f
refactor set_config with helper methods
flavius-t Jun 2, 2022
eae6e3f
add update code generation for cr1
flavius-t Jun 3, 2022
ca9601f
refactor unit testing workflow
flavius-t Jun 3, 2022
92e9c5e
change workflows to dev branch only
flavius-t Jun 3, 2022
ff5e724
add temperature sampling
flavius-t Jun 3, 2022
0ef31b4
abstract out register value updates
flavius-t Jun 8, 2022
5310cef
unit tests, negative temperature sampling bug fix
flavius-t Jun 9, 2022
1bcf9d2
add incompatible opcode mask check
flavius-t Jun 9, 2022
37d6dda
add change flags for register updates
flavius-t Jun 9, 2022
194214d
remove magic numbers
flavius-t Jun 9, 2022
3503dff
refactor temperature conversion
flavius-t Jun 9, 2022
67c3e50
expand opcode unit tests
flavius-t Jun 9, 2022
08009d2
add unit test documentation
flavius-t Jun 9, 2022
f692845
add debug message to custom error
flavius-t Jun 9, 2022
83eef24
clean up comments
flavius-t Jun 9, 2022
44cd397
expand apply_opcode unit testing
flavius-t Jun 9, 2022
8409093
remove redundant dictionary assignment
flavius-t Jun 9, 2022
9f8e352
fix incompatible mask checking bug
flavius-t Jun 10, 2022
21aa258
pull request fixes
flavius-t Jun 10, 2022
a627801
replace bitwise ops with bitstring pack
flavius-t Jun 10, 2022
3375cc6
add bitstring to requirements
flavius-t Jun 10, 2022
c41d45d
Revert "add bitstring to requirements"
flavius-t Jun 10, 2022
8702ba8
add bitstring to package dependencies
flavius-t Jun 10, 2022
554f30b
add package install documentation
flavius-t Jun 11, 2022
ddf69b4
add exceptions testing for code_to_temp
flavius-t Jun 13, 2022
54750d0
add edge-cases to code_to_temp unit testing
flavius-t Jun 13, 2022
1151edd
Update thermocouple.md
flavius-t Jun 13, 2022
3434afa
add_change_flags unit tests
flavius-t Jun 13, 2022
1e228a7
input validation, unit testing for apply_opcodes
flavius-t Jun 13, 2022
200f423
refactor filter utility function
flavius-t Jun 13, 2022
6d4dc56
unit test filter_dict
flavius-t Jun 13, 2022
afb0d97
update documentation
flavius-t Jun 13, 2022
72bdc18
unit test negative_temp_check
flavius-t Jun 13, 2022
3356a41
cleanup outdated comments
flavius-t Jun 13, 2022
3d9791a
Update thermocouple.md
flavius-t Jun 14, 2022
360e412
update documentation
flavius-t Jun 14, 2022
f656b0d
closes #25
flavius-t Jun 14, 2022
e40e5fd
update documentation
flavius-t Jun 14, 2022
31c4396
refactor register value map formatting
flavius-t Jun 15, 2022
7810fda
move filter_dict to utilities module
flavius-t Jun 15, 2022
6014098
Update and rename thermocouple.md to README.md
flavius-t Jun 15, 2022
82e0a65
rename read_temps
flavius-t Jun 15, 2022
6abeafe
add publishing workflows
flavius-t Jun 15, 2022
6ccd7de
Update README.md
flavius-t Jun 15, 2022
4706d34
Update README.md
flavius-t Jun 15, 2022
b8043fd
Update README.md
flavius-t Jun 16, 2022
e04099f
Merge pull request #23 from osensa/abstract-config
flavius-t Jun 16, 2022
7035b89
add self-hosted workflow runner
flavius-t May 20, 2022
80c8866
remove setup-python from self-hosted workflow
flavius-t May 20, 2022
1651fc8
fix workflow import errors
flavius-t May 20, 2022
2373581
activate virtual env
flavius-t May 20, 2022
b1a96de
initial tc module structure
flavius-t May 21, 2022
8707153
refactor pylint workflow
flavius-t May 24, 2022
259d598
ignore trailing-whitespace
flavius-t May 24, 2022
c2189c9
add pylint ignores
flavius-t May 24, 2022
155cdc8
fix lint errors
flavius-t May 24, 2022
cccfb32
update docstrings
flavius-t May 24, 2022
78d5b33
tc module structure update
flavius-t May 27, 2022
1016f7e
add opcode to register mapping
flavius-t May 27, 2022
b5cc1ad
add collective configuration method
flavius-t May 27, 2022
d4bc2a0
add method for generating cr0 write command
flavius-t May 28, 2022
90d3f48
refactor update code generate methods
flavius-t May 30, 2022
a7a7f4d
debug refactoring
flavius-t May 30, 2022
b4ed79d
spi transfer issue debugging, and mock transfer
flavius-t Jun 1, 2022
f7dc2ab
refactor mock spi transfer to library
flavius-t Jun 1, 2022
061c89b
add gpiozero requirement until spi transfer fixed
flavius-t Jun 1, 2022
c7de215
refactor register reading
flavius-t Jun 1, 2022
2a4a4a7
refactor set_config with helper methods
flavius-t Jun 2, 2022
9c7ab98
add update code generation for cr1
flavius-t Jun 3, 2022
f5cefe0
refactor unit testing workflow
flavius-t Jun 3, 2022
0028994
change workflows to dev branch only
flavius-t Jun 3, 2022
0f2897e
add temperature sampling
flavius-t Jun 3, 2022
0752a8e
Merge branch 'dev' of github.com:osensa/edgepi-python-sdk into TC
flavius-t Jun 16, 2022
b01af9d
abstract out hardware from edgepi_tc tests
flavius-t Jun 16, 2022
110aecb
update requirements
flavius-t Jun 16, 2022
4ce46f7
Update README.md
flavius-t Jun 16, 2022
cc3c062
update README
flavius-t Jun 20, 2022
ff8b06a
update package version
flavius-t Jun 20, 2022
1f10130
Update README.md
flavius-t Jun 20, 2022
e832a84
Update README.md
flavius-t Jun 20, 2022
5e10ef2
Update README.md
flavius-t Jun 20, 2022
00b0630
Publish SDK (#184)
flavius-t Dec 14, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# .coveragerc to control pytest-cov code coverage testing

[run]
branch = True
source = src/edgepi

[report]
show_missing = True
skip_empty = True

[xml]
output = test_cov/coverage.xml
33 changes: 33 additions & 0 deletions .github/workflows/build-and-publish-PyPI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# This workflow will build and publish the package to PyPI upon push or merge to main branch

name: Build and Publish to PyPI

on:
push:
branches:
- 'main'

jobs:
build-and-publish:
name: Build and publish Package to PyPI
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.10'
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements_build.txt ]; then python -m pip install -r requirements_build.txt; fi
- name: Build Package
run: |
python -m build
- name: Publish Package to PyPI
uses: pypa/gh-action-pypi-publish@v1.5.0
with:
# TODO: add PyPI user password or access token
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
35 changes: 35 additions & 0 deletions .github/workflows/build-and-publish-TestPyPI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# This workflow will build and publish the package to TestPyPI upon push or merge to dev branch

name: Build and Publish to TestPyPI

on:
push:
branches:
- 'staging'

jobs:
build-and-publish:
name: Build and publish Package to TestPyPI
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.10'
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements_build.txt ]; then python -m pip install -r requirements_build.txt; fi
- name: Bump Patch Number
run: |
if [ -f bump_patch.py ]; then python bump_patch.py; fi
- name: Build Package
run: |
python -m build
- name: Publish Distribution to TestPyPI
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
35 changes: 35 additions & 0 deletions .github/workflows/python-integration-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# This workflow will install Python dependencies, run tests using PyTest.

name: PyTest Integration Test

on:
push:
branches:
- 'staging'
pull_request:
branches:
- 'staging'

jobs:
test:
name: Self-Hosted Integration Test
runs-on: self-hosted
strategy:
fail-fast: false
matrix:
python-version: ["3.9"]

steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
python -m venv venv_test
source venv_test/bin/activate
python -m pip install pytest
if [ -f requirements_test.txt ]; then pip install -r requirements_test.txt; fi
- name: Test with pytest
run: |
source venv_test/bin/activate
pytest ./src/tests/integration_tests
39 changes: 39 additions & 0 deletions .github/workflows/python-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# This workflow will lint all files in repo using PyLint.

name: PyLint

on:
push:
branches:
- 'dev'
pull_request:
branches:
- 'dev'

jobs:
lint:
name: Linter
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.9"]

steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
python -m venv venv_test
source venv_test/bin/activate
python -m pip install pylint
if [ -f requirements_test.txt ]; then pip install -r requirements_test.txt; fi
- name: Analysing the code with pylint
run: |
source venv_test/bin/activate
pylint $(git ls-files '*.py')
53 changes: 53 additions & 0 deletions .github/workflows/python-unit-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# This workflow will install Python dependencies, run tests using PyTest.

name: PyTest Unit Test

on:
push:
branches:
- 'dev'
pull_request:
branches:
- 'dev'

jobs:
test:
name: Unit Tests
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.9"]

steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
python -m venv venv_test
source venv_test/bin/activate
python -m pip install pytest
if [ -f requirements_test.txt ]; then pip install -r requirements_test.txt; fi
- name: Test with pytest
run: |
source venv_test/bin/activate
pytest ./src/test_edgepi/unit_tests --cov --cov-report=xml
- name: Code Coverage Summary Report
uses: irongut/CodeCoverageSummary@v1.2.0
with:
filename: test_cov/coverage.xml
badge: true
format: markdown
hide_complexity: true
indicators: true
output: both
- name: Add Coverage PR Comment
uses: marocchino/sticky-pull-request-comment@v2
with:
recreate: true
path: code-coverage-results.md
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -132,3 +132,12 @@ dmypy.json

# Pyre type checker
.pyre/

#Mac OS env file
.DS_store

# local test scripts
src/edgepi/scripts

# hardware test reports
tests/reports
25 changes: 25 additions & 0 deletions .pylintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[MESSAGES CONTROL]

disable=logging-fstring-interpolation,
too-many-locals,
too-many-arguments,
fixme,
too-few-public-methods,
duplicate-code

[LOGGING]

# Format style used to check logging format string. `old` means using %
# formatting, while `new` is for `{}` formatting.
logging-format-style=new

[BASIC]
# exclude docstring requirement for test and private functions
no-docstring-rgx=^test_|^_|^fixture

# Good variable names which should always be accepted, separated by a comma
good-names=fd,ch,dr,tc,i

[REPORTS]

output-format=colorized
Loading