Skip to content

Commit

Permalink
Merge pull request #7 from brooklyn-data/1.0.0_compatibility
Browse files Browse the repository at this point in the history
Add 1.0.0 compatibility
  • Loading branch information
NiallRees authored Dec 4, 2021
2 parents dc092a9 + 7937d00 commit 7395209
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 2 additions & 0 deletions dbtenv/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ def __init__(self, version: str, source: Optional[str] = None, source_descriptio
version_match = re.match(r'(?P<version>\d+\.\d+\.\d+)(-?(?P<prerelease>[a-z].*))?', self.raw_version)
self.is_semantic = version_match is not None
self.is_stable = version_match is not None and not version_match['prerelease']
self.major_minor_patch = version_match['version'] if version_match is not None else None
self.prerelease = version_match['prerelease'] if version_match is not None else None

# dbt pre-release versions are formatted slightly differently in PyPI and Homebrew.
if version_match and version_match['prerelease']:
Expand Down
13 changes: 12 additions & 1 deletion dbtenv/pip.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,18 @@ class ReleaseDateFilterPyPIRequestHandler(BaseDateFilterPyPIRequestHandler):
# Versions prior to 0.19.1 just specified agate>=1.6, but agate 1.6.2 introduced a dependency on PyICU
# which causes installation problems, so exclude that like versions 0.19.1 and above do.
pip_args.append('agate>=1.6,<1.6.2')
pip_args.append(f'dbt=={self.version.pypi_version}')

# Use correct dbt package name depending on version
if self.version < Version('1.0.0'):
pip_args.append(f'dbt=={self.version.pypi_version}')
else:
# See comment on adapter - dbt-core version coordination
# https://getdbt.slack.com/archives/C02HM9AAXL4/p1637345945047100?thread_ts=1637323222.046100&cid=C02HM9AAXL4
pip_args.append(f'dbt-core=={self.version.pypi_version}')
pip_args.append(f'dbt-postgres~={self.version.major_minor_patch}')
pip_args.append(f'dbt-redshift~={self.version.major_minor_patch}')
pip_args.append(f'dbt-snowflake~={self.version.major_minor_patch}')
pip_args.append(f'dbt-bigquery~={self.version.major_minor_patch}')
logger.info(f"Installing dbt {self.version.pypi_version} from {package_source} into `{self.venv_directory}`.")

logger.debug(f"Running `{pip}` with arguments {pip_args}.")
Expand Down

0 comments on commit 7395209

Please sign in to comment.