Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ground dependencies and remove extras #1314

Merged
merged 15 commits into from
Feb 16, 2023
51 changes: 19 additions & 32 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,67 +19,54 @@
# or pip install -e .
install_requirements = [
"ocean-contracts==1.1.8",
"coloredlogs",
"pyopenssl",
"PyJWT", # not jwt
"PyYAML==5.4.1",
"coloredlogs==15.0.1",
"requests>=2.21.0",
"deprecated",
"pycryptodomex",
"tqdm",
"pytz",
"cryptography",
"scipy",
"pytz", # used minimally and unlikely to change, common dependency
"enforce-typing==1.0.0.post1",
"json-sempai==0.4.0",
"eciespy",
"eciespy==0.3.11",
"eth-brownie==1.19.3",
"yarl==1.8.1",
"bitarray>=2.6.0,<3",
# web3 requires eth-abi, requests, and more,
# brownie requires web3.py, eth-abi, requests, and more,
# so those will be installed too.
# See https://github.com/ethereum/web3.py/blob/master/setup.py
]
# Required to run setup.py:
setup_requirements = ["pytest-runner"]

test_requirements = [
"codacy-coverage",
"coverage",
"docker",
"mccabe",
"pylint",
"pytest",
"pytest-watch",
"Pillow",
"matplotlib",
"codacy-coverage==1.3.11",
"coverage==6.4.4",
"mccabe==0.7.0",
"pytest==6.2.5",
"pytest-watch==4.2.0",
"pytest-env==0.6.2",
"matplotlib", # just used in a readme test and unlikely to change, common dependency
"mkcodes==0.1.1",
"pytest-sugar",
"pytest-sugar==0.9.6",
]

# Possibly required by developers of ocean-lib:
dev_requirements = [
"bumpversion",
"pkginfo",
"twine",
"watchdog",
"bumpversion==0.6.0",
"pkginfo==1.8.3",
"twine==3.7.1",
"watchdog==2.1.9",
"isort==5.12.0",
"flake8==6.0.0",
"black", # need to keep this up to date to brownie
"pre-commit",
# for the following: maybe needed, maybe not
"pytest",
"pre-commit==2.20.0",
"licenseheaders==0.8.8",
"pytest-env",
]

packages = find_namespace_packages(include=["ocean_lib*"], exclude=["*test*"])

setup(
author="leucothia",
author="ocean-core-team",
author_email="[email protected]",
classifiers=[
"Development Status :: 2 - Pre-Alpha",
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Natural Language :: English",
Expand Down
24 changes: 2 additions & 22 deletions tests/resources/helper_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
from typing import Any, Dict, Optional, Tuple, Union

import coloredlogs
import yaml
from brownie import network
from brownie.network import accounts
from enforce_typing import enforce_types
Expand Down Expand Up @@ -121,30 +120,11 @@ def get_another_consumer_ocean_instance(use_provider_mock: bool = False) -> Ocea

@enforce_types
def setup_logging(
default_path: str = "logging.yaml",
default_level=logging.INFO,
env_key: str = "LOG_CFG",
):
"""Logging setup."""
path = default_path
value = os.getenv(env_key, None)
if value:
path = value
if os.path.exists(path):
with open(path, "rt") as file:
try:
config = yaml.safe_load(file.read())
logging.config.dictConfig(config)
coloredlogs.install()
logging.info(f"Logging configuration loaded from file: {path}")
except Exception as ex:
print(ex)
print("Error in Logging Configuration. Using default configs")
logging.basicConfig(level=default_level)
coloredlogs.install(level=default_level)
else:
logging.basicConfig(level=default_level)
coloredlogs.install(level=default_level)
logging.basicConfig(level=default_level)
coloredlogs.install(level=default_level)


@enforce_types
Expand Down