diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a968327d..edc56ce6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -35,7 +35,6 @@ jobs: python-version: 3.8 - name: Install dependencies run: | - pip install -r requirements.txt pip install -r requirements-dev.txt pip install tox - name: Run tests and collect coverage @@ -105,7 +104,6 @@ jobs: - name: Install dependencies and build run: | python -m pip install --upgrade pip - pip install -r requirements.txt pip install setuptools wheel twine python setup.py sdist bdist_wheel - name: Publish distribution 📦 to PyPI diff --git a/.gitignore b/.gitignore index d4a006db..2f7aff65 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,7 @@ htmlcov/ dist/ /build/ *.egg-info/ +.eggs/ .idea/ *.swp *~ diff --git a/Dockerfile b/Dockerfile index ce87be2a..10f5dce5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,10 +13,7 @@ RUN python -m venv /opt/venv # Make sure we use the virtualenv: ENV PATH="/opt/venv/bin:$PATH" -COPY requirements.txt / - -RUN pip install --upgrade pip && \ - pip install -r requirements.txt +RUN pip install --upgrade pip WORKDIR /app diff --git a/README.md b/README.md index b3389be8..a9239778 100644 --- a/README.md +++ b/README.md @@ -71,9 +71,8 @@ pip install squeaknode Or install from source ``` -virtualenv venv +python3 -m venv venv source venv/bin/activate -pip install -r requirements.txt pip install . ``` diff --git a/docs/database-migration.md b/docs/database-migration.md index 66ef2052..104fc50a 100644 --- a/docs/database-migration.md +++ b/docs/database-migration.md @@ -15,9 +15,8 @@ To change any database model, follow these steps. ``` - Run the command to generate a new alembic migration: ``` - virtualenv venv + python3 -m venv venv source venv/bin/activate - pip install -r requirements.txt pip install -e . alembic -c squeaknode/db/alembic.ini revision --autogenerate -m "" ``` diff --git a/docs/development.md b/docs/development.md index c868b5d7..0fb82ba9 100644 --- a/docs/development.md +++ b/docs/development.md @@ -27,9 +27,8 @@ You can also run your own squeaknode on your host machine. - Install squeaknode: ``` - virtualenv venv + python3 -m venv venv source venv/bin/activate - pip install -r requirements.txt pip install . ``` diff --git a/frontend/README.md b/frontend/README.md index a40e5323..c242bdec 100755 --- a/frontend/README.md +++ b/frontend/README.md @@ -9,9 +9,8 @@ ``` - Start the backend with the `SQUEAKNODE_WEBADMIN_ENABLED`, `SQUEAKNODE_WEBADMIN_LOGIN_DISABLED`, and `SQUEAKNODE_WEBADMIN_ALLOW_CORS` environment variables: ``` - virtualenv venv + python3 -m venv venv source venv/bin/activate - pip install -r requirements.txt pip install . SQUEAKNODE_WEBADMIN_ENABLED=TRUE SQUEAKNODE_WEBADMIN_LOGIN_DISABLED=TRUE SQUEAKNODE_WEBADMIN_ALLOW_CORS=TRUE SQUEAKNODE_NETWORK=testnet squeaknode --config config.ini ``` diff --git a/requirements.txt b/requirements.txt index 9f3c6d74..f791a15f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,8 +4,6 @@ flask-cors==3.0.10 flask-login==0.5.0 Flask-WTF==0.15.1 googleapis-common-protos==1.53.0 -grpcio==1.39.0 -grpcio-tools==1.39.0 importlib_resources==1.4.0 mypy-protobuf==2.9 protobuf==3.17.3 diff --git a/setup.py b/setup.py index 7dba46e5..daed3de5 100644 --- a/setup.py +++ b/setup.py @@ -27,7 +27,6 @@ from typing import Tuple import pkg_resources import setuptools.command.build_py import setuptools.command.test -from grpc_tools import protoc from setuptools import Command from setuptools import find_packages from setuptools import setup @@ -48,6 +47,9 @@ class BuildPyCommand(setuptools.command.build_py.build_py): def build_package_protos(package_root, strict_mode=False): + # Import grpc_tools here because it is not available at top of module. + from grpc_tools import protoc + proto_files = [] inclusion_root = os.path.abspath(package_root) for root, _, files in os.walk(inclusion_root): @@ -100,6 +102,7 @@ setup( packages=find_packages(), include_package_data=True, zip_safe=False, + setup_requires=['grpcio-tools==1.39.0', 'wheel==0.37.1'], install_requires=requirements, extras_require={ "test": ["pytest", "coverage"],