Skip to content

Commit

Permalink
Merge pull request #2586 from SFDO-Tooling/feature/week-17-dep-updates
Browse files Browse the repository at this point in the history
Week 17 Dependency Updates
  • Loading branch information
David Glick authored Apr 29, 2021
2 parents 4a05046 + de2cb84 commit 707d068
Show file tree
Hide file tree
Showing 52 changed files with 243 additions and 212 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ default_language_version:
python: python3
repos:
- repo: https://github.com/ambv/black
rev: 20.8b1
rev: 21.4b2
hooks:
- id: black
- repo: https://github.com/pre-commit/pre-commit-hooks
Expand Down
2 changes: 1 addition & 1 deletion cumulusci/cli/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@


def init_logger(log_requests=False):
""" Initialize the logger """
"""Initialize the logger"""

logger = logging.getLogger(__name__.split(".")[0])
for handler in logger.handlers: # pragma: no cover
Expand Down
2 changes: 1 addition & 1 deletion cumulusci/cli/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def _get_services_config(self, runtime):
)

def list_commands(self, ctx):
""" list the services that can be configured """
"""list the services that can be configured"""
runtime = ctx.obj
services = self._get_services_config(runtime)
return sorted(services.keys())
Expand Down
6 changes: 3 additions & 3 deletions cumulusci/cli/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def is_final_release(version: str) -> bool:


def get_latest_final_version():
""" return the latest version of cumulusci in pypi, be defensive """
"""return the latest version of cumulusci in pypi, be defensive"""
# use the pypi json api https://wiki.python.org/moin/PyPIJSON
res = safe_json_from_response(
requests.get("https://pypi.org/pypi/cumulusci/json", timeout=5)
Expand All @@ -70,7 +70,7 @@ def get_latest_final_version():


def check_latest_version():
""" checks for the latest version of cumulusci from pypi, max once per hour """
"""checks for the latest version of cumulusci from pypi, max once per hour"""
check = True

with timestamp_file() as f:
Expand All @@ -95,5 +95,5 @@ def check_latest_version():


def get_installed_version():
""" returns the version name (e.g. 2.0.0b58) that is installed """
"""returns the version name (e.g. 2.0.0b58) that is installed"""
return pkg_resources.parse_version(__version__)
6 changes: 3 additions & 3 deletions cumulusci/core/config/BaseConfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


class BaseConfig(object):
""" BaseConfig provides a common interface for nested access for all Config objects in CCI. """
"""BaseConfig provides a common interface for nested access for all Config objects in CCI."""

defaults = {}

Expand All @@ -15,11 +15,11 @@ def __init__(self, config=None):
self._load_config()

def _init_logger(self):
""" Initializes self.logger """
"""Initializes self.logger"""
self.logger = logging.getLogger(__name__)

def _load_config(self):
""" Subclasses may override this method to initialize :py:attr:`~config` """
"""Subclasses may override this method to initialize :py:attr:`~config`"""
pass

def __getattr__(self, name):
Expand Down
10 changes: 5 additions & 5 deletions cumulusci/core/config/BaseTaskFlowConfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ def list_infos(infos):


class BaseTaskFlowConfig(BaseConfig):
""" Base class for all configs that contain tasks and flows """
"""Base class for all configs that contain tasks and flows"""

def list_tasks(self):
""" Returns a list of task info dictionaries with keys 'name' and 'description' """
"""Returns a list of task info dictionaries with keys 'name' and 'description'"""
return list_infos(self.tasks)

def get_task(self, name):
""" Returns a TaskConfig """
"""Returns a TaskConfig"""
config = getattr(self, f"tasks__{name}")
if not config:
error_msg = f"Task not found: {name}"
Expand All @@ -40,11 +40,11 @@ def get_task(self, name):
return TaskConfig(config)

def list_flows(self):
""" Returns a list of flow info dictionaries with keys 'name' and 'description' """
"""Returns a list of flow info dictionaries with keys 'name' and 'description'"""
return list_infos(self.flows)

def get_flow(self, name):
""" Returns a FlowConfig """
"""Returns a FlowConfig"""
config = getattr(self, f"flows__{name}")
if not config:
error_msg = f"Flow not found: {name}"
Expand Down
4 changes: 2 additions & 2 deletions cumulusci/core/config/OrgConfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@


class OrgConfig(BaseConfig):
""" Salesforce org configuration (i.e. org credentials) """
"""Salesforce org configuration (i.e. org credentials)"""

# make sure it can be mocked for tests
SalesforceOAuth2 = SalesforceOAuth2
Expand Down Expand Up @@ -162,7 +162,7 @@ def org_id(self):

@property
def username(self):
""" Username for the org connection. """
"""Username for the org connection."""
username = self.config.get("username")
if not username:
username = self.userinfo__preferred_username
Expand Down
8 changes: 4 additions & 4 deletions cumulusci/core/config/ScratchOrgConfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@


class ScratchOrgConfig(SfdxOrgConfig):
""" Salesforce DX Scratch org configuration """
"""Salesforce DX Scratch org configuration"""

@property
def scratch_info(self):
Expand Down Expand Up @@ -50,7 +50,7 @@ def days_alive(self):
return delta.days + 1

def create_org(self):
""" Uses sfdx force:org:create to create the org """
"""Uses sfdx force:org:create to create the org"""
if not self.config_file:
raise ScratchOrgException(
f"Scratch org config {self.name} is missing a config_file"
Expand Down Expand Up @@ -141,7 +141,7 @@ def _choose_devhub(self):
return devhub

def generate_password(self):
"""Generates an org password with the sfdx utility. """
"""Generates an org password with the sfdx utility."""

if self.password_failed:
self.logger.warning("Skipping resetting password since last attempt failed")
Expand Down Expand Up @@ -177,7 +177,7 @@ def can_delete(self):
return bool(self.date_created)

def delete_org(self):
""" Uses sfdx force:org:delete to delete the org """
"""Uses sfdx force:org:delete to delete the org"""
if not self.created:
self.logger.info(
"Skipping org deletion: the scratch org has not been created"
Expand Down
6 changes: 3 additions & 3 deletions cumulusci/core/config/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@


class ConnectedAppOAuthConfig(BaseConfig):
""" Salesforce Connected App OAuth configuration """
"""Salesforce Connected App OAuth configuration"""

pass


class FlowConfig(BaseConfig):
""" A flow with its configuration merged """
"""A flow with its configuration merged"""

pass

Expand All @@ -28,7 +28,7 @@ class ServiceConfig(BaseConfig):


class TaskConfig(BaseConfig):
""" A task with its configuration merged """
"""A task with its configuration merged"""

pass

Expand Down
8 changes: 4 additions & 4 deletions cumulusci/core/config/project_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@


class BaseProjectConfig(BaseTaskFlowConfig):
""" Base class for a project's configuration which extends the global config """
"""Base class for a project's configuration which extends the global config"""

config_filename = "cumulusci.yml"

Expand Down Expand Up @@ -77,7 +77,7 @@ def config_project_local_path(self):
return str(path)

def _load_config(self):
""" Loads the configuration from YAML, if no override config was passed in initially. """
"""Loads the configuration from YAML, if no override config was passed in initially."""

if (
self.config
Expand Down Expand Up @@ -370,7 +370,7 @@ def _get_repo(self):

# TODO: These methods are duplicative with `find_latest_release()`
def get_latest_tag(self, beta=False):
""" Query Github Releases to find the latest production or beta tag """
"""Query Github Releases to find the latest production or beta tag"""
repo = self._get_repo()
if not beta:
try:
Expand All @@ -394,7 +394,7 @@ def _get_latest_tag_for_prefix(self, repo, prefix):
)

def get_latest_version(self, beta=False):
""" Query Github Releases to find the latest production or beta release """
"""Query Github Releases to find the latest production or beta release"""
tag = self.get_latest_tag(beta)
version = self.get_version_for_tag(tag)
if version is not None:
Expand Down
2 changes: 1 addition & 1 deletion cumulusci/core/config/sfdx_org_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ def force_refresh_oauth_token(self):
raise SfdxOrgException(message)

def refresh_oauth_token(self, keychain):
""" Use sfdx force:org:describe to refresh token instead of built in OAuth handling """
"""Use sfdx force:org:describe to refresh token instead of built in OAuth handling"""
if hasattr(self, "_sfdx_info"):
# Cache the sfdx_info for 1 hour to avoid unnecessary calls out to sfdx CLI
delta = datetime.datetime.utcnow() - self._sfdx_info_date
Expand Down
4 changes: 2 additions & 2 deletions cumulusci/core/config/universal_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@


class UniversalConfig(BaseTaskFlowConfig):
""" Base class for the global config which contains all configuration not specific to projects """
"""Base class for the global config which contains all configuration not specific to projects"""

config = None
config_filename = "cumulusci.yml"
Expand Down Expand Up @@ -58,7 +58,7 @@ def config_universal_path(self):
)

def _load_config(self):
""" Loads the local configuration """
"""Loads the local configuration"""
# avoid loading multiple times
if UniversalConfig.config is not None:
return
Expand Down
Loading

0 comments on commit 707d068

Please sign in to comment.