diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..d04164c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,7 @@ +FROM python:3.6 + +COPY requirements-py3.txt requirements.txt + +RUN set -ex &&\ + apt-get update && apt-get install -y virtualenv &&\ + pip install --upgrade -r requirements.txt diff --git a/bitmath/__init__.py b/bitmath/__init__.py index 6babc18..d24ce58 100644 --- a/bitmath/__init__.py +++ b/bitmath/__init__.py @@ -1341,7 +1341,7 @@ def getsize(path, bestprefix=True, system=NIST): instances back. """ _path = os.path.realpath(path) - size_bytes = os.path.getsize(_path) + size_bytes = os.stat(_path).st_size if bestprefix: return Byte(size_bytes).best_prefix(system=system) else: diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..7c510e3 --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,13 @@ +--- + +version: '3.8' +services: + bitmath: + build: + context: . + dockerfile: Dockerfile + working_dir: /app + volumes: + - .:/app + command: make unittests pycodestyle pyflakes + tty: true