Skip to content

Commit

Permalink
Merge pull request #2 from brooklyn-data/fix/missing-versions-dir
Browse files Browse the repository at this point in the history
v1.1.1 to fix error when `~/.dbt/versions` directory doesn't exist yet.
  • Loading branch information
sean-rose authored Jul 15, 2021
2 parents fa45b8a + 88cd1fa commit ff01700
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
9 changes: 6 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,23 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased](https://github.com/brooklyn-data/dbtenv/compare/v1.1.0...HEAD)
## [Unreleased](https://github.com/brooklyn-data/dbtenv/compare/v1.1.1...HEAD)

### Added

### Changed

## [1.1.1](https://github.com/brooklyn-data/dbtenv/compare/v1.1.0...v1.1.1) - 2021-07-15

### Fixed
- Fix error when `~/.dbt/versions` directory doesn't exist yet.

## [1.1.0](https://github.com/brooklyn-data/dbtenv/compare/v1.0.0...v1.1.0) - 2021-07-14

### Added

- Support installation of dbt versions >= 0.20.0 in a Python 3.9 environment.

## [1.0.0](https://github.com/brooklyn-data/dbtenv/releases/tag/v1.0.0) - 2021-04-16

### Added

- Initial release
2 changes: 1 addition & 1 deletion dbtenv/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from typing import Any, List, Optional


__version__ = '1.1.0'
__version__ = '1.1.1'

VENVS_DIRECTORY = os.path.normpath('~/.dbt/versions')

Expand Down
2 changes: 2 additions & 0 deletions dbtenv/pip.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@


def get_installed_pip_dbt_versions(env: Environment) -> List[Version]:
if not os.path.isdir(env.venvs_directory):
return []
with os.scandir(env.venvs_directory) as venvs_dir_scan:
possible_versions = (Version(entry.name) for entry in venvs_dir_scan if entry.is_dir())
return [version for version in possible_versions if PipDbt(env, version).is_installed()]
Expand Down

0 comments on commit ff01700

Please sign in to comment.