diff --git a/.github/workflows/pyinstaller.yaml b/.github/workflows/pyinstaller.yaml index b088f10..a9a8977 100644 --- a/.github/workflows/pyinstaller.yaml +++ b/.github/workflows/pyinstaller.yaml @@ -23,7 +23,8 @@ jobs: url: "https://github.com/upx/upx/releases/download/v4.0.1/upx-4.0.1-win64.zip" pathInArchive: "upx-4.0.1-win64/upx.exe" - - run: pip install flask flask_sqlalchemy flask-login pyjwt gevent protobuf pycryptodome stravalib git+https://github.com/oldnapalm/garmin-uploader.git dnspython git+https://github.com/oldnapalm/pyinstaller.git + - run: pip install -r requirements.txt + - run: pip install dnspython==2.3.0 git+https://github.com/oldnapalm/garmin-uploader.git git+https://github.com/oldnapalm/pyinstaller.git - run: pyinstaller standalone.spec - uses: vimtor/action-zip@v1 diff --git a/Dockerfile b/Dockerfile index 27dbcce..58ad4f1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,10 +3,13 @@ FROM python:3.10-alpine as builder WORKDIR /usr/src/app RUN apk add --no-cache git gcc g++ musl-dev libffi-dev openssl-dev file make -RUN pip install --user flask flask_sqlalchemy flask-login pyjwt gevent protobuf stravalib garmin-uploader requests dnspython pycryptodome RUN git clone --depth 1 https://github.com/zoffline/zwift-offline +COPY requirements.txt requirements.txt +RUN pip install --user --requirement requirements.txt +RUN pip install --user dnspython==2.3.0 git+https://github.com/oldnapalm/garmin-uploader.git + FROM python:3.10-alpine MAINTAINER zoffline diff --git a/README.md b/README.md index 7500d40..0e12b3c 100644 --- a/README.md +++ b/README.md @@ -30,9 +30,9 @@ To install zoffline on Linux, Windows, or macOS: * Install Python 3 (https://www.python.org/downloads/) if not already installed * On Windows, installing Python via the Microsoft Store is highly recommend! If using a Python installer, ensure that in the first Python installer screen "Add Python 3.x to PATH" is checked. -* Install dependencies: flask, flask_sqlalchemy, flask-login, pyjwt, gevent, python-protobuf, pycryptodome, stravalib (optional) - * e.g., on Linux/Mac: ``pip3 install flask flask_sqlalchemy flask-login pyjwt gevent protobuf pycryptodome stravalib`` - * e.g., on Windows in command prompt: ``pip install flask flask_sqlalchemy flask-login pyjwt gevent protobuf pycryptodome stravalib`` +* Install dependencies + * e.g., on Linux/Mac: ``pip3 install -r requirements.txt`` + * e.g., on Windows in command prompt: ``pip install -r requirements.txt`` * You may need to use ``C:\Users\\AppData\Local\Programs\Python\Python\Scripts\pip.exe`` instead of just ``pip`` * Clone or download this repo * If you are not running zoffline on the same PC that Zwift is running: create a ``server-ip.txt`` file in the ``storage`` directory containing the IP address of the PC running zoffline. @@ -361,24 +361,17 @@ Docker * Python 3 (https://www.python.org/downloads/) * On Windows, installing Python via the Microsoft Store is highly recommend! If using a Python installer, ensure that in the first Python installer screen "Add Python 3.x to PATH" is checked. -* Flask (http://flask.pocoo.org/) - * ``pip3 install flask`` +* Flask (https://flask.palletsprojects.com/) * python-protobuf (https://pypi.org/project/protobuf/) - * ``pip3 install protobuf`` * pyJWT (https://pyjwt.readthedocs.io/) - * ``pip3 install pyjwt`` -* Flask-Login (https://flask-login.readthedocs.io/en/latest/) - * ``pip3 install flask-login`` -* Flask-SQLAlchemy (https://flask-sqlalchemy.palletsprojects.com/en/latest/) - * ``pip3 install flask_sqlalchemy`` +* Flask-Login (https://flask-login.readthedocs.io/) +* Flask-SQLAlchemy (https://flask-sqlalchemy.palletsprojects.com/) * gevent (http://www.gevent.org/) - * ``pip3 install gevent`` * pycryptodome (https://pypi.org/project/pycryptodome/) - * ``pip3 install pycryptodome`` * OPTIONAL: stravalib (https://github.com/hozn/stravalib) - * ``pip3 install stravalib`` * OPTIONAL: garmin-uploader (https://github.com/La0/garmin-uploader) - * ``pip3 install garmin-uploader`` +* OPTIONAL: discord.py (https://discordpy.readthedocs.io/) +* OPTIONAL: dnspython (https://www.dnspython.org/) ## Note diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..216e1ae --- /dev/null +++ b/requirements.txt @@ -0,0 +1,8 @@ +flask==2.2.2 +flask-login==0.6.2 +flask_sqlalchemy==3.0.3 +gevent==22.10.2 +protobuf==4.21.12 +pycryptodome==3.17 +pyjwt==2.6.0 +stravalib==1.1.0