mirror of
https://github.com/python-kasa/python-kasa.git
synced 2024-12-22 19:23:34 +00:00
created a docker file to aid dev setup (#99)
* created a docker file to aid dev setup * fixed review comments in README and Dockerfile * review comments to simplify the docker run command
This commit is contained in:
parent
b80923061f
commit
95b743f11d
50
Dockerfile
Normal file
50
Dockerfile
Normal file
@ -0,0 +1,50 @@
|
||||
####################################################
|
||||
# Use python 3.x and the latest version of alpine #
|
||||
####################################################
|
||||
FROM python:3-alpine
|
||||
|
||||
LABEL maintainer=peter@grainger.xyz
|
||||
|
||||
###################################################
|
||||
# Add all system packages relied upon by python #
|
||||
###################################################
|
||||
RUN apk update && \
|
||||
apk add --no-cache gcc \
|
||||
libffi-dev \
|
||||
openssl-dev \
|
||||
libxslt-dev \
|
||||
libxml2-dev \
|
||||
musl-dev \
|
||||
linux-headers
|
||||
|
||||
###################################################
|
||||
# Create somewhere to put the files #
|
||||
###################################################
|
||||
RUN mkdir -p /opt/pyHS100
|
||||
WORKDIR /opt/pyHS100
|
||||
|
||||
###################################################
|
||||
# Requirements file first to help cache #
|
||||
###################################################
|
||||
COPY requirements.txt .
|
||||
RUN pip install -r requirements.txt
|
||||
|
||||
###################################################
|
||||
# Install dev dependancies #
|
||||
###################################################
|
||||
RUN pip install pytest pytest-cov voluptuous typing
|
||||
|
||||
###################################################
|
||||
# Copy over the rest. #
|
||||
###################################################
|
||||
COPY ./ ./
|
||||
|
||||
###################################################
|
||||
# Install everything to the path #
|
||||
###################################################
|
||||
RUN python setup.py install
|
||||
|
||||
###################################################
|
||||
# Run tests #
|
||||
###################################################
|
||||
CMD pytest
|
12
README.md
12
README.md
@ -211,3 +211,15 @@ print(bulb.hsv)
|
||||
if bulb.is_color:
|
||||
bulb.hsv = (180, 100, 100) # set to cyan
|
||||
```
|
||||
|
||||
## Development Setup
|
||||
|
||||
### Docker
|
||||
|
||||
The following assumes you have a working installation of Docker.
|
||||
|
||||
Set up the environment and run the tests on demand.
|
||||
|
||||
```shell
|
||||
docker build . -t pyhs100 && docker run -v $(PWD)/pyHS100/tests:/opt/pyHS100/pyHS100/tests pyhs100 pytest
|
||||
```
|
Loading…
Reference in New Issue
Block a user