diff --git a/.github/workflows/workflow.yaml b/.github/workflows/workflow.yaml index 55b4965e..14bfc48d 100644 --- a/.github/workflows/workflow.yaml +++ b/.github/workflows/workflow.yaml @@ -60,8 +60,8 @@ jobs: strategy: matrix: - os: [ubuntu-latest, macos-latest] #, windows-latest] - python-version: [3.7, 3.8] + os: [ubuntu-latest, macos-latest, windows-latest] + python-version: [3.6, 3.7, 3.8] timeout-minutes: 30 @@ -87,6 +87,14 @@ jobs: pip install pipenv pip install tox brew install protobuf + - if: matrix.os == 'windows-latest' + name: Install dependencies (windows-latest) + run: | + pip install pipenv + pip install tox + echo "::add-path::C:\Program Files (x86)\Windows Kits\10\bin\10.0.18362.0\x64" + choco install protoc + # python scripts/update_symlinks_cross_platform.py - name: Unit tests run: | tox -e py${{ matrix.python-version }} -- -m 'not integration' diff --git a/AUTHORS.md b/AUTHORS.md index 2f9793a4..5bd0861b 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -5,3 +5,4 @@ This is the official list of Fetch.AI authors for copyright purposes. * Marco Favorito [MarcoFavorito](https://github.com/MarcoFavorito) * David Minarsch [DavidMinarsch](https://github.com/DavidMinarsch) * Diarmid Campbell [dishmop](https://github.com/dishmop) +* Aristotelis Triantafyllidis [Totoual](https://github.com/Totoual) diff --git a/Makefile b/Makefile index aa4338a6..64bb178e 100644 --- a/Makefile +++ b/Makefile @@ -24,11 +24,11 @@ clean-test: find . -name 'log.*.txt' -exec rm -fr {} + lint: - black sandbox scripts simulation/v1 tac templates tests - flake8 sandbox scripts simulation/v1 tac templates tests --exclude=tac/gui/static,tac/gui/templates,.md,tac/*_pb2.py,tac/gui/.visdom_env,tac/__init__.py,scripts/oef/launch.py --ignore=E501,E701,W503 + black sandbox scripts setup.py simulation/v1 tac templates tests + flake8 sandbox scripts setup.py simulation/v1 tac templates tests --exclude=tac/gui/static,tac/gui/templates,.md,tac/*_pb2.py,tac/gui/.visdom_env,tac/__init__.py,scripts/oef/launch.py --ignore=E501,E701,W503 static: - mypy sandbox scripts simulation/v1 tac templates tests --config-file mypy.ini + mypy sandbox scripts setup.py simulation/v1 tac templates tests --config-file mypy.ini test-all: tox diff --git a/mypy.ini b/mypy.ini index 866b8c71..60d2f0bd 100644 --- a/mypy.ini +++ b/mypy.ini @@ -45,5 +45,8 @@ ignore_missing_imports = True [mypy-visdom] ignore_missing_imports = True +[mypy-setuptools] +ignore_missing_imports = True + [mypy-tac/platform/protocols/tac/tac_pb2] ignore_errors = True diff --git a/setup.py b/setup.py index 710d19fa..3ba48818 100644 --- a/setup.py +++ b/setup.py @@ -18,50 +18,56 @@ # limitations under the License. # # ------------------------------------------------------------------------------ -import fileinput + +"""Setup of package.""" + import glob import os -import re -import shutil -import subprocess -import sys -from setuptools import setup, find_packages, Command +from setuptools import setup, find_packages +from typing import Dict PACKAGE_NAME = "tac" here = os.path.abspath(os.path.dirname(__file__)) -about = {} -with open(os.path.join(here, PACKAGE_NAME, '__version__.py'), 'r') as f: +about = {} # type: Dict[str, str] +with open( + os.path.join(here, PACKAGE_NAME, "__version__.py"), "r", encoding="utf-8" +) as f: exec(f.read(), about) -with open('README.md', 'r') as f: +with open("README.md", "r", encoding="utf-8") as f: readme = f.read() -extras = { - "gui": [ - "flask", - "flask_restful", - "wtforms" - ] -} +extras = {"gui": ["flask", "flask_restful", "wtforms"]} setup( - name=about['__title__'], - description=about['__description__'], - version=about['__version__'], - author=about['__author__'], - url=about['__url__'], + name=about["__title__"], + description=about["__description__"], + version=about["__version__"], + author=about["__author__"], + url=about["__url__"], long_description=readme, packages=find_packages(include=["tac*"]), classifiers=[ - 'Development Status :: 2 - Pre-Alpha', - 'Intended Audience :: Developers', - 'Natural Language :: English', - 'License :: OSI Approved :: Apache Software License', - 'Programming Language :: Python :: 3.6', - 'Programming Language :: Python :: 3.7', + "Environment :: Console", + "Environment :: Web Environment", + "Development Status :: 2 - Pre-Alpha", + "Intended Audience :: Developers", + "License :: OSI Approved :: Apache Software License", + "Natural Language :: English", + "Operating System :: MacOS", + "Operating System :: Microsoft", + "Operating System :: Unix", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Topic :: Communications", + "Topic :: Internet", + "Topic :: Scientific/Engineering", + "Topic :: Software Development", + "Topic :: System", ], install_requires=[ "aea", @@ -69,22 +75,27 @@ "colorlog", # TODO 'oef' dependency, to be fixed. "numpy", "python-dateutil", - "visdom" + "visdom", ], tests_require=["tox"], extras_require=extras, zip_safe=False, include_package_data=True, data_files=[ - ("sandbox", ["sandbox/docker-compose.yml", "sandbox/config.json", "sandbox/.env"] - + glob.glob("sandbox/*.py") - + glob.glob("sandbox/*.sh")), + ( + "sandbox", + ["sandbox/docker-compose.yml", "sandbox/config.json", "sandbox/.env"] + + glob.glob("sandbox/*.py") + + glob.glob("sandbox/*.sh"), + ), ("templates/v1", glob.glob("templates/v1/*.py")), ("scripts/oef", glob.glob("scripts/oef/*.json")), ("simulation/v1", glob.glob("simulation/v1/*")), - ("oef_search_pluto_scripts", glob.glob("oef_search_pluto_scripts/*.py") + glob.glob("oef_search_pluto_scripts/*.json")) + ( + "oef_search_pluto_scripts", + glob.glob("oef_search_pluto_scripts/*.py") + + glob.glob("oef_search_pluto_scripts/*.json"), + ), ], - license=about['__license__'], + license=about["__license__"], ) - - diff --git a/tox.ini b/tox.ini index 11b4a64d..a1aa0426 100644 --- a/tox.ini +++ b/tox.ini @@ -3,6 +3,18 @@ envlist = flake8, mypy, py3.7 skipsdist = False ignore_basepython_conflict = True +[testenv:py3.6] +basepython = python3.6 +whitelist_externals = pipenv +deps = + pytest==5.3.5 + pytest-cov==2.8.1 + docker + +commands = + pipenv install + pytest -rfE --doctest-modules tac tests/ --cov-report=html --cov-report=term --cov=tac {posargs} + [testenv:py3.7] basepython = python3.7 whitelist_externals = pipenv @@ -31,16 +43,16 @@ commands = deps = flake8==3.7.9 flake8-docstrings==1.5.0 pydocstyle==3.0.0 -commands = flake8 tac simulation sandbox scripts templates tests --exclude=tac/gui/static,tac/gui/templates,.md,tac/*_pb2.py,tac/gui/.visdom_env,tac/__init__.py,scripts/oef/launch.py --ignore=E501,E701,W503 +commands = flake8 tac simulation sandbox scripts setup.py templates tests --exclude=tac/gui/static,tac/gui/templates,.md,tac/*_pb2.py,tac/gui/.visdom_env,tac/__init__.py,scripts/oef/launch.py --ignore=E501,E701,W503 [testenv:mypy] deps = mypy -commands = mypy sandbox scripts simulation/v1 tac templates tests --config-file mypy.ini +commands = mypy sandbox scripts setup.py simulation/v1 tac templates tests --config-file mypy.ini [testenv:black] deps = black==19.10b0 -commands = black sandbox scripts simulation/v1 tac templates tests +commands = black sandbox scripts setup.py simulation/v1 tac templates tests [testenv:black-check] deps = black==19.10b0 -commands = black sandbox scripts simulation/v1 tac templates tests --check --verbose +commands = black sandbox scripts setup.py simulation/v1 tac templates tests --check --verbose