Skip to content

Commit c03210f

Browse files
authored
DEVOPS-776 fix: suppress pkg_resources deprecation warning from PyFilesystem (#13)
* DEVOPS-776 fix: suppress pkg_resources deprecation warning and replace fs.path with os.path in GitHubSource * DEVOPS-776 fix: add assertion to ensure commit is not None in fetch method of GitHubSource * DEVOPS-776 fix: raise RuntimeError if commit is None in fetch method of GitHubSource
1 parent 8c4c436 commit c03210f

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

cumulusci/__init__.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
11
import os
22
import sys
3+
import warnings
34
from importlib.metadata import PackageNotFoundError, version
45

6+
# Suppress pkg_resources deprecation warning from PyFilesystem (fs) package
7+
# See: https://github.com/PyFilesystem/pyfilesystem2/issues/577
8+
warnings.filterwarnings(
9+
"ignore",
10+
message="pkg_resources is deprecated as an API",
11+
category=UserWarning,
12+
)
13+
514
from simple_salesforce import api, bulk
615

716
__location__ = os.path.dirname(os.path.realpath(__file__))

cumulusci/core/source/github.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import os
22
import shutil
33

4-
import fs
54
from github3.exceptions import NotFoundError
65

76
from cumulusci.core.exceptions import DependencyResolutionError
@@ -128,8 +127,10 @@ def resolve(self):
128127

129128
def fetch(self):
130129
"""Fetch the archive of the specified commit and construct its project config."""
130+
if self.commit is None:
131+
raise RuntimeError("Cannot fetch: commit has not been resolved")
131132
with self.project_config.open_cache(
132-
fs.path.join("projects", self.repo_name, self.commit)
133+
os.path.join("projects", self.repo_name, self.commit)
133134
) as path:
134135
zf = download_extract_github(
135136
self.gh, self.repo_owner, self.repo_name, ref=self.commit

0 commit comments

Comments
 (0)