Skip to content

Commit 9533927

Browse files
committed
Release 2.0.0
1 parent f9c02aa commit 9533927

File tree

3 files changed

+30
-6
lines changed

3 files changed

+30
-6
lines changed

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,24 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1313

1414
### Fixed
1515

16+
## [2.0.0](https://github.com/brooklyn-data/dbtenv/compare/v2.0.0a2...v2.0.0)
17+
18+
### Added
19+
- dbtenv now operates at the adapter-version level, introduced by dbt in version 1.0.0. dbtenv can automatically detect the needed adapter version from `profiles.yml`, or the `--adapter` argument set in a dbt command passed to `dbtenv --execute`.
20+
- The execute command's `--dbt` argument can now take either a dbt version (e.g. 1.0.0) or full pip specifier to use (e.g. dbt-snowflake==1.0.0). dbtenv will attempt to automatically detect the required adapter or version from the environment if not specified.
21+
- dbtenv's version command and config files can now use a dbt version (e.g. 1.0.0) or full pip specifier to use (e.g. dbt-snowflake==1.0.0). dbtenv will attempt to automatically detect the required adapter or version from the environment if not specified.
22+
23+
### Changed
24+
- Dropped support for Homebrew.
25+
- Previously created environments through dbtenv 1.0.0 will be ignored.
26+
- dbtenv's default behaviour is now to install missing dbt adapter versions automatically. It can be disabled by setting the `DBTENV_AUTO_INSTALL` environment variable to `false`.
27+
- Attempting to install a version of dbt which doesn't exist will exit cleanly, and provide a list of available versions for that adapter.
28+
- Failed dbt version installations exit cleanly, removing the created virtual environment.
29+
30+
### Fixed
31+
- Only entries in the environment directory which are dbtenv 2.0.0 environments will be read as installed dbt versions, fixing an issue where dbtenv 1.0.0 environments caused a failure.
32+
- Fixed version command, and all dbtenv config files. These can now take either a dbt version (e.g. 1.0.0) or full pip specifier to use (e.g. dbt-snowflake==1.0.0). dbtenv will attempt to automatically detect the required adapter or version from the environment if not specified.
33+
1634
## [2.0.0a2](https://github.com/brooklyn-data/dbtenv/compare/v2.0.0a1...v2.0.0a2)
1735

1836
### Added

README.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ dbtenv is a version manager for dbt, automatically installing and switching to t
88
1. Install [pipx](https://pypa.github.io/pipx/) if you haven't already.
99
2. Run `pipx install dbtenv`.
1010

11+
## Basic example usage
12+
13+
Run `dbtenv execute -- build` in a dbt project, and dbtenv will automatically download the required adapter and version for the project and run `dbt build`. We recommend [setting up an alias to dbtenv](https://github.com/brooklyn-data/dbtenv#running-dbt-with-dbtenv-more-seamlessly) so that you can run dbt commands as normal but through dbtenv.
14+
1115

1216
## How it works
1317

@@ -28,7 +32,7 @@ Some tips:
2832

2933
### Switching between dbt versions
3034
#### Adapter type
31-
If a dbtenv command is invoked from within a dbt project, dbtenv will try to determine the in-use adapter from the default set for the project's profile in `profiles.yml`. If the `--adapter` argument is set in the dbt command passed to `dbtenv execute`, dbtenv will use that adapter's type instead.
35+
If a dbtenv command is invoked from within a dbt project, dbtenv will try to determine the in-use adapter from the default set for the project's profile in `profiles.yml`. If the `--adapter` argument is set in the dbt command passed to `dbtenv execute`, dbtenv will use that adapter's type instead. If running outside of a dbt project, a pip specifier should be passed to dbtenv execute's `--dbt` argument so that dbtenv knows which adapter to use.
3236

3337
#### dbt version
3438

@@ -37,7 +41,7 @@ dbtenv determines which dbt version to use by trying to read it from the followi
3741
1. The `dbtenv execute` command's optional `--dbt <version>` argument.
3842
2. A `DBT_VERSION` environment variable.
3943
3. A `.dbt_version` file in the dbt project directory.
40-
4. The [dbt version requirements](https://docs.getdbt.com/reference/project-configs/require-dbt-version/) of the dbt project and any dbt packages it uses.
44+
4. The [dbt version requirements](https://docs.getdbt.com/reference/project-configs/require-dbt-version/) of the dbt project.
4145
- If the dbt version requirements specify a range of versions rather than an exact version, then dbtenv will try to read a preferred dbt version from the sources below and will use that version if it's compatible with the requirements.
4246
5. The first `.dbt_version` file found by searching the dbt project's parent directories.
4347
6. The `~/.dbt/version` file.
@@ -47,15 +51,17 @@ dbtenv determines which dbt version to use by trying to read it from the followi
4751
You can:
4852
- Run `dbtenv version` to show which dbt version dbtenv determines dynamically based on the current environment.
4953
- Run `dbtenv which` to show the full path to the executable of the dbt version dbtenv determines dynamically based on the current environment.
50-
- Run `dbtenv version --global <version>` to set the dbt version globally in the `~/.dbt/version` file.
51-
- Run `dbtenv version --local <version>` to set the dbt version for the current directory in a `.dbt_version` file.
54+
- Run `dbtenv version --global <version>` to set the dbt version globally in the `~/.dbt/version` file. The `<version>` can be either a dbt version (e.g. 1.0.0) or full pip specifier (e.g. dbt-snowflake==1.0.0). dbtenv will attempt to automatically detect the required adapter or version from the environment if not specified.
55+
- Run `dbtenv version --local <version>` to set the dbt version for the current directory in a `.dbt_version` file. The `<version>` can be either a dbt version (e.g. 1.0.0) or full pip specifier (e.g. dbt-snowflake==1.0.0). dbtenv will attempt to automatically detect the required adapter or version from the environment if not specified.
5256

5357
### Running dbt through dbtenv
5458
Run `dbtenv execute -- <dbt arguments>` to execute the dbt version determined dynamically based on the current environment, or run `dbtenv execute --dbt <version> -- <dbt arguments>` to execute the specified dbt version.
5559

5660
For example:
5761
- `dbtenv execute -- run` will execute `dbt run` using the version determined dynamically based on the current environment.
58-
- `dbtenv execute --dbt 0.19.0 -- run` will execute `dbt run` using dbt 0.19.0.
62+
- `dbtenv execute --dbt 1.0.0 -- run` will execute `dbt run` using dbt 1.0.0, automatically detecting the required adapter from the default target in `profiles.yml`.
63+
- `dbtenv execute --dbt 1.0.0 -- run --target prod` will execute `dbt run` using dbt 1.0.0, using the required adapter for the 'prod' target in `profiles.yml`.
64+
- `dbtenv execute --dbt 1.0.0==dbt-bigquery -- run` will execute `dbt run` using dbt-bigquery==1.0.0.
5965

6066
**Important:** It's highly recommended to put two dashes with spaces on both sides before the list of dbt arguments (as shown in the examples above) so that dbtenv doesn't try to interpret the dbt arguments itself.
6167

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "dbtenv"
3-
version = "2.0.0a2"
3+
version = "2.0.0"
44
description = "dbtenv is a version manager for dbt, automatically installing and switching to the needed adapter and version of dbt."
55
authors = ["Brooklyn Data Co. <[email protected]>"]
66
keywords = ["dbt"]

0 commit comments

Comments
 (0)