Skip to content

Commit

Permalink
cleanup dependencies organization into requirements.txt files
Browse files Browse the repository at this point in the history
  • Loading branch information
Janos Kutscherauer committed Nov 28, 2021
1 parent 9435453 commit 18e5940
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 10 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 mypy
pip install -r tests/requirements.txt
pip install -r requirements.txt
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
Expand Down
4 changes: 1 addition & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ python:
- "3.9"
# command to install dependencies
install:
- pip install flake8
- pip install mypy
- pip install -r tests/requirements.txt
- pip install -r requirements-dev.txt
# check PEP8 coding standard with flake8 and typing with mypy
before_script:
- flake8 .
Expand Down
17 changes: 13 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -291,13 +291,16 @@ Detailed logging of device register operations can be enabled with:
ina = INA219(SHUNT_OHMS, log_level=logging.DEBUG)
```

## Testing
## Development

Install test dependencies first _(recommended to use virtual environments)_:
Install development dependencies first _(recommended to use virtual environments)_. This includes
package dependencies, testing dependencies and static analysis dependencies.
```shell
pip3 install -r tests/requirements.txt
pip3 install -r requirements-dev.txt
```

### Testing

```shell
python3 -m unittest discover -s tests -p 'test_*.py'
```
Expand All @@ -316,7 +319,13 @@ coverage report -m
coverage xml
```

## Coding Standard
### Coding Standard

This library adheres to the _PEP8_ standard and follows the _idiomatic_
style described in the book _Writing Idiomatic Python_ by _Jeff Knupp_.

To perform local linting and type checks, run:
```sh
flake8 .
mypy -p ina219 --strict
```
5 changes: 5 additions & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-r ./requirements.txt
-r ./tests/requirements.txt

flake8
mypy
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Adafruit_GPIO==1.0.1
1 change: 0 additions & 1 deletion tests/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
Adafruit_GPIO==1.0.1
mock==2.0.0
coverage==5.1
codecov>=2.1

0 comments on commit 18e5940

Please sign in to comment.