-
-
Notifications
You must be signed in to change notification settings - Fork 247
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* a big repo cleanup * fix permissions * try to fix osx * fix syntax, add doc * fix test * fix formatting * fix formatting * fix crash * trying to fix travis issues * fix tests, more cleanup, fix other builds * replace all server starting with multiprocess * fix containers Co-authored-by: Gijs Molenaar <[email protected]>
- Loading branch information
1 parent
8a30a90
commit 302233b
Showing
40 changed files
with
1,129 additions
and
694 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.gitignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,3 +50,4 @@ doc/_build/ | |
.virtualenv3/ | ||
.venv/ | ||
.venv3/ | ||
venv/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,12 @@ | ||
#!/bin/bash | ||
#!/usr/bin/env bash | ||
|
||
set -x | ||
set -v | ||
set -e | ||
|
||
if [ "$TRAVIS_OS_NAME" = "osx" ]; then | ||
brew install snap7 | ||
pip install nose mock coverage | ||
pip3 install nose mock coverage | ||
fi | ||
|
||
if [ "$TRAVIS_OS_NAME" = "linux" ]; then | ||
sudo apt-get update -qq | ||
sudo apt-get install -y software-properties-common | ||
sudo add-apt-repository -y ppa:gijzelaar/snap7 | ||
sudo apt-get update -qq | ||
sudo apt-get install -y libsnap7-dev libsnap71 | ||
echo "nothing" | ||
fi | ||
|
||
pip${PYENV} install -r test/requirements.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
FROM ubuntu:20.04 | ||
|
||
RUN apt-get update -qq | ||
RUN apt-get install -y software-properties-common | ||
RUN add-apt-repository -y ppa:gijzelaar/snap7 | ||
RUN apt-get update -qq | ||
RUN apt-get install -y libsnap7-dev libsnap7-1 python3-venv make | ||
ADD . /code | ||
WORKDIR /code | ||
ENV PATH="/code/venv/bin:$PATH" | ||
RUN make doc | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -v | ||
set -e | ||
|
||
|
||
if [ "$TRAVIS_OS_NAME" = "osx" ]; then | ||
make setup | ||
fi | ||
|
||
if [ "$TRAVIS_OS_NAME" = "linux" ]; then | ||
docker build . -f .travis/${TARGET}.docker -t python-snap7/${TARGET} | ||
fi | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
FROM ubuntu:20.04 | ||
|
||
RUN apt-get update -qq | ||
RUN apt-get install -y software-properties-common | ||
RUN add-apt-repository -y ppa:gijzelaar/snap7 | ||
RUN apt-get update -qq | ||
RUN apt-get install -y libsnap7-dev libsnap7-1 python3-venv make | ||
ADD . /code | ||
WORKDIR /code | ||
RUN make mypy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
FROM ubuntu:20.04 | ||
|
||
RUN apt-get update -qq | ||
RUN apt-get install -y software-properties-common | ||
RUN add-apt-repository -y ppa:gijzelaar/snap7 | ||
RUN apt-get update -qq | ||
RUN apt-get install -y libsnap7-dev libsnap7-1 python3-venv make | ||
ADD . /code | ||
WORKDIR /code | ||
RUN make pycodestyle |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,13 @@ | ||
#!/bin/bash | ||
#!/usr/bin/env bash | ||
|
||
set -x | ||
set -v | ||
set -e | ||
|
||
if [ "$TRAVIS_OS_NAME" = "linux" ]; then | ||
NOSETESTS=${VIRTUAL_ENV}/bin/nosetests | ||
else | ||
NOSETESTS="python${PYENV} -m nose" | ||
if [ "$TRAVIS_OS_NAME" = "osx" ]; then | ||
source venv/bin/activate | ||
make test | ||
fi | ||
|
||
PYTHONPATH=. | ||
|
||
${NOSETESTS} --with-coverage test/test_server.py | ||
${NOSETESTS} --with-coverage test/test_client.py | ||
${NOSETESTS} --with-coverage test/test_client_async.py | ||
${NOSETESTS} --with-coverage test/test_util.py | ||
sudo ${NOSETESTS} --with-coverage test/test_partner.py | ||
if [ "$TRAVIS_OS_NAME" = "linux" ] && [ "$NOSCRIPT" != "true" ]; then | ||
docker run python-snap7/${TARGET} make test | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
FROM ubuntu:18.04 | ||
|
||
RUN apt-get update -qq | ||
RUN apt-get install -y software-properties-common | ||
RUN add-apt-repository -y ppa:gijzelaar/snap7 | ||
RUN apt-get update -qq | ||
RUN apt-get install -y libsnap7-dev libsnap7-1 python3-venv make sudo | ||
ADD . /code | ||
WORKDIR /code | ||
RUN make test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
FROM ubuntu:20.04 | ||
|
||
RUN apt-get update -qq | ||
RUN apt-get install -y software-properties-common | ||
RUN add-apt-repository -y ppa:gijzelaar/snap7 | ||
RUN apt-get update -qq | ||
RUN apt-get install -y libsnap7-dev libsnap7-1 python3-venv make sudo | ||
ADD . /code | ||
WORKDIR /code | ||
RUN make test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# developer file, not intented for installing python-snap7 | ||
|
||
.PHONY: test | ||
|
||
allll: test | ||
|
||
venv/: | ||
python3 -m venv venv | ||
venv/bin/pip install --upgrade pip wheel | ||
|
||
venv/installed: venv/ | ||
venv/bin/pip install -e . | ||
touch venv/installed | ||
|
||
setup: venv/installed | ||
|
||
venv/bin/pytest: venv/ | ||
venv/bin/pip install -e ".[test]" | ||
|
||
venv/bin/sphinx-build: venv/ | ||
venv/bin/pip install -e ".[doc]" | ||
|
||
doc: venv/bin/sphinx-build | ||
cd doc && make html | ||
|
||
pycodestyle: venv/bin/pytest | ||
venv/bin/pycodestyle snap7 test | ||
|
||
mypy: venv/bin/pytest | ||
venv/bin/mypy snap7 test | ||
|
||
test: venv/bin/pytest | ||
venv/bin/pytest test/test_server.py test/test_client.py test/test_util.py | ||
sudo venv/bin/pytest test/test_partner.py # run this as last to prevent pytest cache dir creates as root | ||
|
||
docker-doc: | ||
docker build . -f .travis/doc.docker -t doc | ||
|
||
docker-mypy: | ||
docker build . -f .travis/mypy.docker -t mypy | ||
|
||
docker-pycodestyle: | ||
docker build . -f .travis/pycodestyle.docker -t pycodestyle | ||
|
||
docker-ubuntu1804: | ||
docker build . -f .travis/ubuntu1804.docker -t ubuntu1804 | ||
|
||
docker-ubuntu2004: | ||
docker build . -f .travis/ubuntu2004.docker -t ubuntu2004 | ||
|
||
dockers: docker-doc docker-mypy docker-pycodestyle docker-ubuntu1804 docker-ubuntu2004 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,11 @@ | ||
#!/bin/sh | ||
#!/usr/bin/env bash | ||
|
||
set -v | ||
set -e | ||
|
||
export PYTHONPATH=. | ||
echo "Running test_partner.py ----------------------------------------------\n\n" | ||
sudo nosetests test/test_partner.py | ||
echo "Running test_server.py ----------------------------------------------\n\n" | ||
sudo venv/bin/nosetests test/test_partner.py | ||
nosetests test/test_server.py | ||
echo "Running test_client.py ----------------------------------------------\n\n" | ||
nosetests test/test_client.py | ||
echo "Running test_util.py ----------------------------------------------\n\n" | ||
nosetests test/test_util.py | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[pycodestyle] | ||
ignore = E501,E402,W391,W292,W503 |
Oops, something went wrong.