From 72a2a6e7b618087421bc8f7e3955ee5a051b1152 Mon Sep 17 00:00:00 2001 From: Mike Alfare Date: Thu, 10 Aug 2023 22:44:24 -0400 Subject: [PATCH 01/10] move all config into `pyproject.toml` and `setup.cfg` --- .bumpversion.cfg | 37 ---------- .flake8 | 16 ----- .github/workflows/integration.yml | 18 +++-- .github/workflows/main-branch-tests.yml | 4 +- .github/workflows/main.yml | 37 +++++----- .github/workflows/nightly-release.yml | 23 +++---- .github/workflows/release.yml | 18 ----- .github/workflows/triage-labels.yml | 8 +-- .pre-commit-config.yaml | 89 ++++++++----------------- dbt/adapters/snowflake/__version__.py | 1 - dev-requirements.txt | 30 --------- mypy.ini | 2 - pyproject.toml | 85 +++++++++++++++++++++++ pytest.ini | 10 --- tox.ini => setup.cfg | 20 +++++- setup.py | 89 ------------------------- 16 files changed, 175 insertions(+), 312 deletions(-) delete mode 100644 .bumpversion.cfg delete mode 100644 .flake8 delete mode 100644 dbt/adapters/snowflake/__version__.py delete mode 100644 dev-requirements.txt delete mode 100644 mypy.ini create mode 100644 pyproject.toml delete mode 100644 pytest.ini rename tox.ini => setup.cfg (71%) delete mode 100644 setup.py diff --git a/.bumpversion.cfg b/.bumpversion.cfg deleted file mode 100644 index a2ad4da69..000000000 --- a/.bumpversion.cfg +++ /dev/null @@ -1,37 +0,0 @@ -[bumpversion] -current_version = 1.7.0a1 -parse = (?P[\d]+) # major version number - \.(?P[\d]+) # minor version number - \.(?P[\d]+) # patch version number - (?P # optional pre-release - ex: a1, b2, rc25 - (?Pa|b|rc) # pre-release type - (?P[\d]+) # pre-release version number - )? - ( # optional nightly release indicator - \.(?Pdev[0-9]+) # ex: .dev02142023 - )? # expected matches: `1.15.0`, `1.5.0a11`, `1.5.0a1.dev123`, `1.5.0.dev123457`, expected failures: `1`, `1.5`, `1.5.2-a1`, `text1.5.0` -serialize = - {major}.{minor}.{patch}{prekind}{num}.{nightly} - {major}.{minor}.{patch}.{nightly} - {major}.{minor}.{patch}{prekind}{num} - {major}.{minor}.{patch} -commit = False -tag = False - -[bumpversion:part:prekind] -first_value = a -optional_value = final -values = - a - b - rc - final - -[bumpversion:part:num] -first_value = 1 - -[bumpversion:part:nightly] - -[bumpversion:file:setup.py] - -[bumpversion:file:dbt/adapters/snowflake/__version__.py] diff --git a/.flake8 b/.flake8 deleted file mode 100644 index b08ffcd53..000000000 --- a/.flake8 +++ /dev/null @@ -1,16 +0,0 @@ -[flake8] -select = - E - W - F -ignore = - # makes Flake8 work like black - W503, - W504, - # makes Flake8 work like black - E203, - E741, - E501, -exclude = test -per-file-ignores = - */__init__.py: F401 diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 866c20b07..0db735228 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -89,7 +89,6 @@ jobs: snowflake: - 'dbt/**' - 'tests/**' - - 'dev-requirements.txt' - name: Generate integration test matrix id: generate-matrix uses: actions/github-script@v6 @@ -123,7 +122,7 @@ jobs: env: TOXENV: integration-${{ matrix.adapter }} - PYTEST_ADDOPTS: "-v --color=yes -n4 --csv integration_results.csv" + PYTEST_ADDOPTS: "--csv integration_results.csv" DBT_INVOCATION_ENV: github-actions DD_CIVISIBILITY_AGENTLESS_ENABLED: true DD_API_KEY: ${{ secrets.DATADOG_API_KEY }} @@ -147,20 +146,19 @@ jobs: persist-credentials: false ref: ${{ github.event.pull_request.head.sha }} - - name: Set up Python ${{ matrix.python-version }} + - name: Set up python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - name: Install python dependencies run: | - python -m pip install --user --upgrade pip - python -m pip install tox + python -m pip install --user --upgrade pip + python -m pip install ".[test]" python -m pip --version tox --version - name: Run tox (snowflake) - if: matrix.adapter == 'snowflake' env: SNOWFLAKE_TEST_ACCOUNT: ${{ secrets.SNOWFLAKE_TEST_ACCOUNT }} SNOWFLAKE_TEST_PASSWORD: ${{ secrets.SNOWFLAKE_TEST_PASSWORD }} @@ -179,7 +177,8 @@ jobs: DBT_TEST_USER_3: dbt_test_role_3 run: tox -- --ddtrace - - uses: actions/upload-artifact@v3 + - name: Upload log artifacts + uses: actions/upload-artifact@v3 if: always() with: name: logs @@ -190,7 +189,8 @@ jobs: id: date run: echo "date=$(date +'%Y-%m-%dT%H_%M_%S')" >> $GITHUB_OUTPUT #no colons allowed for artifacts - - uses: actions/upload-artifact@v3 + - name: Upload test artifacts + uses: actions/upload-artifact@v3 if: always() with: name: integration_results_${{ matrix.python-version }}_${{ matrix.os }}_${{ matrix.adapter }}-${{ steps.date.outputs.date }}.csv @@ -198,9 +198,7 @@ jobs: require-label-comment: runs-on: ubuntu-latest - needs: test - permissions: pull-requests: write diff --git a/.github/workflows/main-branch-tests.yml b/.github/workflows/main-branch-tests.yml index 0684b1c2c..d898a6a42 100644 --- a/.github/workflows/main-branch-tests.yml +++ b/.github/workflows/main-branch-tests.yml @@ -25,7 +25,7 @@ permissions: read-all jobs: kick-off-ci: - name: Kick-off CI + name: Run CI runs-on: ubuntu-latest strategy: @@ -39,7 +39,7 @@ jobs: workflow_name: [main.yml, integration.yml] steps: - - name: Call CI workflow for ${{ matrix.branch }} branch + - name: Run CI workflow for ${{ matrix.branch }} branch id: trigger-step uses: aurelien-baudet/workflow-dispatch@v2 with: diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a0d1ba6cb..d6290163c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -37,8 +37,7 @@ defaults: jobs: code-quality: - name: code-quality - + name: Code Quality runs-on: ubuntu-latest steps: @@ -47,7 +46,7 @@ jobs: with: persist-credentials: false - - name: Set up Python + - name: Set up python uses: actions/setup-python@v4 with: python-version: '3.8' @@ -55,7 +54,7 @@ jobs: - name: Install python dependencies run: | python -m pip install --user --upgrade pip - python -m pip install -r dev-requirements.txt + python -m pip install ".[dev]" python -m pip --version pre-commit --version mypy --version @@ -65,8 +64,7 @@ jobs: run: pre-commit run --all-files --show-diff-on-failure unit: - name: unit test / python ${{ matrix.python-version }} - + name: Unit test / python ${{ matrix.python-version }} runs-on: ubuntu-latest strategy: @@ -76,7 +74,7 @@ jobs: env: TOXENV: "unit" - PYTEST_ADDOPTS: "-v --color=yes --csv unit_results.csv" + PYTEST_ADDOPTS: "--csv unit_results.csv" steps: - name: Check out the repository @@ -84,7 +82,7 @@ jobs: with: persist-credentials: false - - name: Set up Python ${{ matrix.python-version }} + - name: Set up python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} @@ -92,7 +90,7 @@ jobs: - name: Install python dependencies run: | python -m pip install --user --upgrade pip - python -m pip install tox + python -m pip install ".[text]" python -m pip --version tox --version @@ -104,15 +102,15 @@ jobs: id: date run: echo "date=$(date +'%Y-%m-%dT%H_%M_%S')" >> $GITHUB_OUTPUT #no colons allowed for artifacts - - uses: actions/upload-artifact@v3 + - name: Upload test artifacts + uses: actions/upload-artifact@v3 if: always() with: name: unit_results_${{ matrix.python-version }}-${{ steps.date.outputs.date }}.csv path: unit_results.csv build: - name: build packages - + name: Build packages runs-on: ubuntu-latest outputs: @@ -124,7 +122,7 @@ jobs: with: persist-credentials: false - - name: Set up Python + - name: Set up python uses: actions/setup-python@v4 with: python-version: '3.8' @@ -156,18 +154,16 @@ jobs: if [[ "$(ls -lh dist/)" == *"a1"* ]]; then export is_alpha=1; fi echo "is_alpha=$is_alpha" >> $GITHUB_OUTPUT - - uses: actions/upload-artifact@v3 + - name: Upload build artifacts + uses: actions/upload-artifact@v3 with: name: dist path: dist/ test-build: - name: verify packages / python ${{ matrix.python-version }} / ${{ matrix.os }} - + name: Verify packages / python ${{ matrix.python-version }} / ${{ matrix.os }} if: needs.build.outputs.is_alpha == 0 - needs: build - runs-on: ${{ matrix.os }} strategy: @@ -177,7 +173,7 @@ jobs: python-version: ['3.8', '3.9', '3.10', '3.11'] steps: - - name: Set up Python ${{ matrix.python-version }} + - name: Set up python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} @@ -188,7 +184,8 @@ jobs: python -m pip install --upgrade wheel python -m pip --version - - uses: actions/download-artifact@v3 + - name: Download build artifacts + uses: actions/download-artifact@v3 with: name: dist path: dist/ diff --git a/.github/workflows/nightly-release.yml b/.github/workflows/nightly-release.yml index 4762d1218..fc3ecba92 100644 --- a/.github/workflows/nightly-release.yml +++ b/.github/workflows/nightly-release.yml @@ -26,7 +26,7 @@ defaults: shell: bash env: - RELEASE_BRANCH: "1.5.latest" + RELEASE_BRANCH: "1.6.latest" jobs: aggregate-release-data: @@ -38,52 +38,52 @@ jobs: release_branch: ${{ steps.release-branch.outputs.name }} steps: - - name: "Checkout ${{ github.repository }} Branch ${{ env.RELEASE_BRANCH }}" + - name: "Checkout ${{ github.repository }} @ ${{ env.RELEASE_BRANCH }}" uses: actions/checkout@v3 with: ref: ${{ env.RELEASE_BRANCH }} - - name: "Resolve Commit To Release" + - name: Resolve commit to release id: resolve-commit-sha run: | commit_sha=$(git rev-parse HEAD) echo "release_commit=$commit_sha" >> $GITHUB_OUTPUT - - name: "Get Current Version Number" + - name: Get current version id: version-number-sources run: | current_version=`awk -F"current_version = " '{print $2}' .bumpversion.cfg | tr '\n' ' '` echo "current_version=$current_version" >> $GITHUB_OUTPUT - - name: "Audit Version And Parse Into Parts" + - name: Audit version and parse into parts id: semver uses: dbt-labs/actions/parse-semver@v1.1.0 with: version: ${{ steps.version-number-sources.outputs.current_version }} - - name: "Get Current Date" + - name: Get current date id: current-date run: echo "date=$(date +'%m%d%Y')" >> $GITHUB_OUTPUT # Bump to the next patch because when this is a previously released patch, the changelog # markdown will already exist and cause a failure in another step - - name: "Bump Patch Number" + - name: Bump patch number id: bump_patch run: | echo "patch=$((${{ steps.semver.outputs.patch }}+1))" >> $GITHUB_OUTPUT - - name: "Generate Nightly Release Version Number" + - name: Generate nightly release version number id: nightly-release-version run: | number="${{ steps.semver.outputs.major }}.${{ steps.semver.outputs.minor }}.${{ steps.bump_patch.outputs.patch }}.dev${{ steps.current-date.outputs.date }}" echo "number=$number" >> $GITHUB_OUTPUT - - name: "Audit Nightly Release Version And Parse Into Parts" + - name: Audit nightly release version and parse into parts uses: dbt-labs/actions/parse-semver@v1.1.0 with: version: ${{ steps.nightly-release-version.outputs.number }} - - name: "Set Release Branch" + - name: Set release branch id: release-branch run: | echo "name=${{ env.RELEASE_BRANCH }}" >> $GITHUB_OUTPUT @@ -93,7 +93,7 @@ jobs: needs: [aggregate-release-data] steps: - - name: "[DEBUG] Log Outputs" + - name: "[DEBUG] log outputs" run: | echo commit_sha : ${{ needs.aggregate-release-data.outputs.commit_sha }} echo version_number: ${{ needs.aggregate-release-data.outputs.version_number }} @@ -101,7 +101,6 @@ jobs: release-github-pypi: needs: [aggregate-release-data] - uses: ./.github/workflows/release.yml with: sha: ${{ needs.aggregate-release-data.outputs.commit_sha }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 88942e251..e375bd6e3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -131,9 +131,7 @@ jobs: bump-version-generate-changelog: name: Bump package version, Generate changelog - uses: dbt-labs/dbt-release/.github/workflows/release-prep.yml@main - with: sha: ${{ inputs.sha }} version_number: ${{ inputs.version_number }} @@ -141,15 +139,12 @@ jobs: env_setup_script_path: ${{ inputs.env_setup_script_path }} test_run: ${{ inputs.test_run }} nightly_release: ${{ inputs.nightly_release }} - secrets: inherit log-outputs-bump-version-generate-changelog: name: "[Log output] Bump package version, Generate changelog" if: ${{ !failure() && !cancelled() }} - needs: [bump-version-generate-changelog] - runs-on: ubuntu-latest steps: @@ -162,9 +157,7 @@ jobs: name: Build, Test, Package if: ${{ !failure() && !cancelled() }} needs: [bump-version-generate-changelog] - uses: dbt-labs/dbt-release/.github/workflows/build.yml@main - with: sha: ${{ needs.bump-version-generate-changelog.outputs.final_sha }} version_number: ${{ inputs.version_number }} @@ -174,7 +167,6 @@ jobs: package_test_command: ${{ inputs.package_test_command }} test_run: ${{ inputs.test_run }} nightly_release: ${{ inputs.nightly_release }} - secrets: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} @@ -182,11 +174,8 @@ jobs: github-release: name: GitHub Release if: ${{ !failure() && !cancelled() }} - needs: [bump-version-generate-changelog, build-test-package] - uses: dbt-labs/dbt-release/.github/workflows/github-release.yml@main - with: sha: ${{ needs.bump-version-generate-changelog.outputs.final_sha }} version_number: ${{ inputs.version_number }} @@ -195,15 +184,11 @@ jobs: pypi-release: name: PyPI Release - needs: [github-release] - uses: dbt-labs/dbt-release/.github/workflows/pypi-release.yml@main - with: version_number: ${{ inputs.version_number }} test_run: ${{ inputs.test_run }} - secrets: PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }} TEST_PYPI_API_TOKEN: ${{ secrets.TEST_PYPI_API_TOKEN }} @@ -211,7 +196,6 @@ jobs: slack-notification: name: Slack Notification if: ${{ failure() && (!inputs.test_run || inputs.nightly_release) }} - needs: [ bump-version-generate-changelog, @@ -219,10 +203,8 @@ jobs: github-release, pypi-release, ] - uses: dbt-labs/dbt-release/.github/workflows/slack-post-notification.yml@main with: status: "failure" - secrets: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_DEV_ADAPTER_ALERTS }} diff --git a/.github/workflows/triage-labels.yml b/.github/workflows/triage-labels.yml index 91f529e3e..1f4cddb20 100644 --- a/.github/workflows/triage-labels.yml +++ b/.github/workflows/triage-labels.yml @@ -1,14 +1,14 @@ # **what?** # When the core team triages, we sometimes need more information from the issue creator. In # those cases we remove the `triage` label and add the `awaiting_response` label. Once we -# recieve a response in the form of a comment, we want the `awaiting_response` label removed -# in favor of the `triage` label so we are aware that the issue needs action. +# receive a response in the form of a comment, we want the `awaiting_response` label removed +# in favor of the `triage` label so that we are aware that the issue needs action. # **why?** -# To help with out team triage issue tracking +# To help out with team triage issue tracking # **when?** -# This will run when a comment is added to an issue and that issue has to `awaiting_response` label. +# This will run when a comment is added to an issue with the `awaiting_response` label. name: Update Triage Label diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3d80b955c..7321d4d8a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,63 +1,32 @@ -# For more on configuring pre-commit hooks (see https://pre-commit.com/) - -# Force all unspecified python hooks to run python 3.8 default_language_version: - python: python3 + python: python3 repos: -- repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 - hooks: - - id: check-yaml - args: [--unsafe] - - id: check-json - - id: end-of-file-fixer - - id: trailing-whitespace - - id: check-case-conflict -- repo: https://github.com/psf/black - rev: 23.1.0 - hooks: - - id: black - additional_dependencies: ['click~=8.1'] - args: - - "--line-length=99" - - "--target-version=py38" - - id: black - alias: black-check - stages: [manual] - additional_dependencies: ['click~=8.1'] - args: - - "--line-length=99" - - "--target-version=py38" - - "--check" - - "--diff" -- repo: https://github.com/pycqa/flake8 - rev: 6.0.0 - hooks: - - id: flake8 - - id: flake8 - alias: flake8-check - stages: [manual] -- repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.1.1 - hooks: - - id: mypy - # N.B.: Mypy is... a bit fragile. - # - # By using `language: system` we run this hook in the local - # environment instead of a pre-commit isolated one. This is needed - # to ensure mypy correctly parses the project. - - # It may cause trouble in that it adds environmental variables out - # of our control to the mix. Unfortunately, there's nothing we can - # do about per pre-commit's author. - # See https://github.com/pre-commit/pre-commit/issues/730 for details. - args: [--show-error-codes, --ignore-missing-imports, --explicit-package-bases] - files: ^dbt/adapters/.* - language: system - - id: mypy - alias: mypy-check - stages: [manual] - args: [--show-error-codes, --pretty, --ignore-missing-imports, --explicit-package-bases] - files: ^dbt/adapters - language: system +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.4.0 + hooks: + - id: check-yaml + args: [--unsafe] + - id: check-json + - id: end-of-file-fixer + - id: trailing-whitespace + - id: check-case-conflict +- repo: https://github.com/psf/black + rev: 23.7.0 + hooks: + - id: black + args: [--line-length=99, --target-version=py38] +- repo: https://github.com/pycqa/flake8 + rev: 6.1.0 + hooks: + - id: flake8 +- repo: https://github.com/pre-commit/mirrors-mypy + rev: v1.4.1 + hooks: + - id: mypy + args: [--show-error-codes, --ignore-missing-imports, --explicit-package-bases] + # By using `language: system` we run this hook in the local + # environment instead of a pre-commit isolated one. + # This is needed to ensure mypy correctly parses the project. + # See https://github.com/pre-commit/pre-commit/issues/730 for details. + language: system diff --git a/dbt/adapters/snowflake/__version__.py b/dbt/adapters/snowflake/__version__.py deleted file mode 100644 index 874bd74c8..000000000 --- a/dbt/adapters/snowflake/__version__.py +++ /dev/null @@ -1 +0,0 @@ -version = "1.7.0a1" diff --git a/dev-requirements.txt b/dev-requirements.txt deleted file mode 100644 index 7307379ec..000000000 --- a/dev-requirements.txt +++ /dev/null @@ -1,30 +0,0 @@ -# install latest changes in dbt-core -# TODO: how to automate switching from develop to version branches? -git+https://github.com/dbt-labs/dbt-core.git#egg=dbt-core&subdirectory=core -git+https://github.com/dbt-labs/dbt-core.git#egg=dbt-tests-adapter&subdirectory=tests/adapter - -# if version 1.x or greater -> pin to major version -# if version 0.x -> pin to minor -black~=23.7 -bumpversion~=0.6.0 -click~=8.1 -ddtrace~=1.17 -flake8~=6.1 -flaky~=3.7 -freezegun~=1.2 -ipdb~=0.13.13 -mypy==1.4.1 # patch updates have historically introduced breaking changes -pip-tools~=7.2 -pre-commit~=3.3 -pre-commit-hooks~=4.4 -pytest~=7.4 -pytest-csv~=3.0 -pytest-dotenv~=0.5.2 -pytest-logbook~=1.2 -pytest-xdist~=3.3 -pytz~=2023.3 -tox~=4.6 -types-pytz~=2023.3 -types-requests~=2.31 -twine~=4.0 -wheel~=0.41 diff --git a/mypy.ini b/mypy.ini deleted file mode 100644 index b6e603581..000000000 --- a/mypy.ini +++ /dev/null @@ -1,2 +0,0 @@ -[mypy] -namespace_packages = True diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 000000000..ea91b8a3d --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,85 @@ +[build-system] +requires = [ + "check-wheel-contents", + "setuptools", + "twine", + "wheel", +] +build-backend = "setuptools.build_meta" + +[project] +name = "dbt-snowflake" +version = "1.7.0a1" +description = "The Snowflake adapter plugin for dbt" +readme = "README.md" +requires-python = ">=3.8" +license = {file = "LICENSE.md"} +authors = [{name = "dbt Labs", email = "info@dbtlabs.com" }] +classifiers = [ # Optional + "Development Status :: 5 - Production/Stable", + "License :: OSI Approved :: Apache Software License", + "Operating System :: Microsoft :: Windows", + "Operating System :: MacOS :: MacOS X", + "Operating System :: POSIX :: Linux", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", +] +urls.Homepage = "https://github.com/dbt-labs/dbt-snowflake" +urls."Bug Reports" = "https://github.com/dbt-labs/dbt-snowflake/issues" +urls.Docs = "https://docs.getdbt.com/docs/core/connect-data-platform/snowflake-setup" +dependencies = [ + "dbt-core~=1.7", + "snowflake-connector-python[secure-local-storage]~=3.0", + # installed via dbt-core but referenced directly; don't pin to avoid version conflicts with dbt-core + "agate", +] +optional-dependencies.dev = [ + "git+https://github.com/dbt-labs/dbt-core.git#egg=dbt-core&subdirectory=core", + "git+https://github.com/dbt-labs/dbt-core.git#egg=dbt-tests-adapter&subdirectory=tests/adapter", + "black~=23.1.0", + "click", + "flake8", + "flaky", + "ipdb", + "mypy~=1.0", + "pip-tools", + "pre-commit", + "pre-commit-hooks", + "pytz", + "types-pytz", + "types-requests", +] +optional-dependencies.test = [ + "ddtrace", + "freezegun", + "pytest", + "pytest-csv", + "pytest-dotenv", + "pytest-logbook", + "pytest-xdist", + "tox~=4.0", +] + +[tool.black] +line-length = 99 +target-version = ["py38"] + +[tool.mypy] +explicit_package_bases = true +ignore_missing_imports = true +pretty = true +show_error_codes = true + +[tool.pytest] +filterwarnings = [ + "ignore:.*'soft_unicode' has been renamed to 'soft_str'*:DeprecationWarning", + "ignore:unclosed file .*:ResourceWarning", +] +env_files = "test.env" +testpaths = ["tests/unit", "tests/functional"] +addopts = "-v -n4 --color=yes" + +[tool.setuptools.packages.find] +include = ["dbt", "dbt.*"] diff --git a/pytest.ini b/pytest.ini deleted file mode 100644 index b04a6ccf3..000000000 --- a/pytest.ini +++ /dev/null @@ -1,10 +0,0 @@ -[pytest] -filterwarnings = - ignore:.*'soft_unicode' has been renamed to 'soft_str'*:DeprecationWarning - ignore:unclosed file .*:ResourceWarning -env_files = - test.env -testpaths = - tests/unit - tests/integration - tests/functional diff --git a/tox.ini b/setup.cfg similarity index 71% rename from tox.ini rename to setup.cfg index bbea5b254..002bae971 100644 --- a/tox.ini +++ b/setup.cfg @@ -1,4 +1,22 @@ -[tox] +[flake8] +select = + E + W + F +ignore = + # makes Flake8 work like black + W503, + W504, + # makes Flake8 work like black + E203, + E741, + E501, +exclude = test +per-file-ignores = + */__init__.py: F401 + + +[tox:tox] skipsdist = True envlist = py38,py39,py310,py311 diff --git a/setup.py b/setup.py deleted file mode 100644 index ffa9264c3..000000000 --- a/setup.py +++ /dev/null @@ -1,89 +0,0 @@ -#!/usr/bin/env python -import os -import sys -import re - -# require python 3.8 or newer -if sys.version_info < (3, 8): - print("Error: dbt does not support this version of Python.") - print("Please upgrade to Python 3.8 or higher.") - sys.exit(1) - - -# require version of setuptools that supports find_namespace_packages -from setuptools import setup - -try: - from setuptools import find_namespace_packages -except ImportError: - # the user has a downlevel version of setuptools. - print("Error: dbt requires setuptools v40.1.0 or higher.") - print('Please upgrade setuptools with "pip install --upgrade setuptools" ' "and try again") - sys.exit(1) - - -# pull long description from README -this_directory = os.path.abspath(os.path.dirname(__file__)) -with open(os.path.join(this_directory, "README.md")) as f: - long_description = f.read() - - -# get this package's version from dbt/adapters//__version__.py -def _get_plugin_version_dict(): - _version_path = os.path.join(this_directory, "dbt", "adapters", "snowflake", "__version__.py") - _semver = r"""(?P\d+)\.(?P\d+)\.(?P\d+)""" - _pre = r"""((?Pa|b|rc)(?P
\d+))?"""
-    _nightly = r"""(\.(?P[a-z0-9]+)?)?"""
-    _version_pattern = rf"""version\s*=\s*["']{_semver}{_pre}{_nightly}["']"""
-    with open(_version_path) as f:
-        match = re.search(_version_pattern, f.read().strip())
-        if match is None:
-            raise ValueError(f"invalid version at {_version_path}")
-        return match.groupdict()
-
-
-# require a compatible minor version (~=), prerelease if this is a prerelease
-def _get_dbt_core_version():
-    parts = _get_plugin_version_dict()
-    minor = "{major}.{minor}.0".format(**parts)
-    pre = parts["prekind"] + "1" if parts["prekind"] else ""
-    return f"{minor}{pre}"
-
-
-package_name = "dbt-snowflake"
-package_version = "1.7.0a1"
-dbt_core_version = _get_dbt_core_version()
-description = """The Snowflake adapter plugin for dbt"""
-
-setup(
-    name=package_name,
-    version=package_version,
-    description=description,
-    long_description=long_description,
-    long_description_content_type="text/markdown",
-    author="dbt Labs",
-    author_email="info@dbtlabs.com",
-    url="https://github.com/dbt-labs/dbt-snowflake",
-    packages=find_namespace_packages(include=["dbt", "dbt.*"]),
-    include_package_data=True,
-    install_requires=[
-        "dbt-core~={}".format(dbt_core_version),
-        "snowflake-connector-python[secure-local-storage]~=3.0",
-        # installed via dbt-core but referenced directly; don't pin to avoid version conflicts with dbt-core
-        "agate",
-    ],
-    zip_safe=False,
-    classifiers=[
-        "Development Status :: 5 - Production/Stable",
-        "License :: OSI Approved :: Apache Software License",
-        "Operating System :: Microsoft :: Windows",
-        "Operating System :: MacOS :: MacOS X",
-        "Operating System :: POSIX :: Linux",
-        "Programming Language :: Python :: 3.8",
-        "Programming Language :: Python :: 3.8",
-        "Programming Language :: Python :: 3.9",
-        "Programming Language :: Python :: 3.10",
-        "Programming Language :: Python :: 3.11",
-    ],
-    python_requires=">=3.8",
-)

From 1eead1f14f3fdc87496f7304afe6e72520a944c6 Mon Sep 17 00:00:00 2001
From: Mike Alfare 
Date: Fri, 11 Aug 2023 11:42:16 -0400
Subject: [PATCH 02/10] update workflows to use pyproject.toml

---
 .github/workflows/integration.yml       | 15 +++++-----
 .github/workflows/main-branch-tests.yml |  4 +--
 .github/workflows/main.yml              | 37 +++++++++++++------------
 .github/workflows/nightly-release.yml   | 23 +++++++--------
 .github/workflows/release.yml           | 18 ++++++++++++
 .github/workflows/triage-labels.yml     |  8 +++---
 6 files changed, 63 insertions(+), 42 deletions(-)

diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml
index 0db735228..c551af119 100644
--- a/.github/workflows/integration.yml
+++ b/.github/workflows/integration.yml
@@ -122,7 +122,7 @@ jobs:
 
     env:
       TOXENV: integration-${{ matrix.adapter }}
-      PYTEST_ADDOPTS: "--csv integration_results.csv"
+      PYTEST_ADDOPTS: "-v --color=yes -n4 --csv integration_results.csv"
       DBT_INVOCATION_ENV: github-actions
       DD_CIVISIBILITY_AGENTLESS_ENABLED: true
       DD_API_KEY: ${{ secrets.DATADOG_API_KEY }}
@@ -146,19 +146,20 @@ jobs:
           persist-credentials: false
           ref: ${{ github.event.pull_request.head.sha }}
 
-      - name: Set up python ${{ matrix.python-version }}
+      - name: Set up Python ${{ matrix.python-version }}
         uses: actions/setup-python@v4
         with:
           python-version: ${{ matrix.python-version }}
 
       - name: Install python dependencies
         run: |
-          python -m pip install --user --upgrade pip
+          python -m pip install  --user --upgrade pip
           python -m pip install ".[test]"
           python -m pip --version
           tox --version
 
       - name: Run tox (snowflake)
+        if: matrix.adapter == 'snowflake'
         env:
           SNOWFLAKE_TEST_ACCOUNT: ${{ secrets.SNOWFLAKE_TEST_ACCOUNT }}
           SNOWFLAKE_TEST_PASSWORD: ${{ secrets.SNOWFLAKE_TEST_PASSWORD }}
@@ -177,8 +178,7 @@ jobs:
           DBT_TEST_USER_3: dbt_test_role_3
         run: tox -- --ddtrace
 
-      - name: Upload log artifacts
-        uses: actions/upload-artifact@v3
+      - uses: actions/upload-artifact@v3
         if: always()
         with:
           name: logs
@@ -189,8 +189,7 @@ jobs:
         id: date
         run: echo "date=$(date +'%Y-%m-%dT%H_%M_%S')" >> $GITHUB_OUTPUT #no colons allowed for artifacts
 
-      - name: Upload test artifacts
-        uses: actions/upload-artifact@v3
+      - uses: actions/upload-artifact@v3
         if: always()
         with:
           name: integration_results_${{ matrix.python-version }}_${{ matrix.os }}_${{ matrix.adapter }}-${{ steps.date.outputs.date }}.csv
@@ -198,7 +197,9 @@ jobs:
 
   require-label-comment:
     runs-on: ubuntu-latest
+
     needs: test
+
     permissions:
       pull-requests: write
 
diff --git a/.github/workflows/main-branch-tests.yml b/.github/workflows/main-branch-tests.yml
index d898a6a42..0684b1c2c 100644
--- a/.github/workflows/main-branch-tests.yml
+++ b/.github/workflows/main-branch-tests.yml
@@ -25,7 +25,7 @@ permissions: read-all
 
 jobs:
   kick-off-ci:
-    name: Run CI
+    name: Kick-off CI
     runs-on: ubuntu-latest
 
     strategy:
@@ -39,7 +39,7 @@ jobs:
         workflow_name: [main.yml, integration.yml]
 
     steps:
-    - name: Run CI workflow for ${{ matrix.branch }} branch
+    - name: Call CI workflow for ${{ matrix.branch }} branch
       id: trigger-step
       uses: aurelien-baudet/workflow-dispatch@v2
       with:
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index d6290163c..e2e6d9b03 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -37,7 +37,8 @@ defaults:
 
 jobs:
   code-quality:
-    name: Code Quality
+    name: code-quality
+
     runs-on: ubuntu-latest
 
     steps:
@@ -46,7 +47,7 @@ jobs:
         with:
           persist-credentials: false
 
-      - name: Set up python
+      - name: Set up Python
         uses: actions/setup-python@v4
         with:
           python-version: '3.8'
@@ -64,7 +65,8 @@ jobs:
         run: pre-commit run --all-files --show-diff-on-failure
 
   unit:
-    name: Unit test / python ${{ matrix.python-version }}
+    name: unit test / python ${{ matrix.python-version }}
+
     runs-on: ubuntu-latest
 
     strategy:
@@ -74,7 +76,7 @@ jobs:
 
     env:
       TOXENV: "unit"
-      PYTEST_ADDOPTS: "--csv unit_results.csv"
+      PYTEST_ADDOPTS: "-v --color=yes --csv unit_results.csv"
 
     steps:
       - name: Check out the repository
@@ -82,7 +84,7 @@ jobs:
         with:
           persist-credentials: false
 
-      - name: Set up python ${{ matrix.python-version }}
+      - name: Set up Python ${{ matrix.python-version }}
         uses: actions/setup-python@v4
         with:
           python-version: ${{ matrix.python-version }}
@@ -90,7 +92,7 @@ jobs:
       - name: Install python dependencies
         run: |
           python -m pip install --user --upgrade pip
-          python -m pip install ".[text]"
+          python -m pip install ".[test]"
           python -m pip --version
           tox --version
 
@@ -102,15 +104,15 @@ jobs:
         id: date
         run: echo "date=$(date +'%Y-%m-%dT%H_%M_%S')" >> $GITHUB_OUTPUT #no colons allowed for artifacts
 
-      - name: Upload test artifacts
-        uses: actions/upload-artifact@v3
+      - uses: actions/upload-artifact@v3
         if: always()
         with:
           name: unit_results_${{ matrix.python-version }}-${{ steps.date.outputs.date }}.csv
           path: unit_results.csv
 
   build:
-    name: Build packages
+    name: build packages
+
     runs-on: ubuntu-latest
 
     outputs:
@@ -122,7 +124,7 @@ jobs:
         with:
           persist-credentials: false
 
-      - name: Set up python
+      - name: Set up Python
         uses: actions/setup-python@v4
         with:
           python-version: '3.8'
@@ -130,7 +132,6 @@ jobs:
       - name: Install python dependencies
         run: |
           python -m pip install --user --upgrade pip
-          python -m pip install --upgrade setuptools wheel twine check-wheel-contents
           python -m pip --version
 
       - name: Build distributions
@@ -154,16 +155,18 @@ jobs:
           if [[ "$(ls -lh dist/)" == *"a1"* ]]; then export is_alpha=1; fi
           echo "is_alpha=$is_alpha" >> $GITHUB_OUTPUT
 
-      - name: Upload build artifacts
-        uses: actions/upload-artifact@v3
+      - uses: actions/upload-artifact@v3
         with:
           name: dist
           path: dist/
 
   test-build:
-    name: Verify packages / python ${{ matrix.python-version }} / ${{ matrix.os }}
+    name: verify packages / python ${{ matrix.python-version }} / ${{ matrix.os }}
+
     if: needs.build.outputs.is_alpha == 0
+
     needs: build
+
     runs-on: ${{ matrix.os }}
 
     strategy:
@@ -173,7 +176,7 @@ jobs:
         python-version: ['3.8', '3.9', '3.10', '3.11']
 
     steps:
-      - name: Set up python ${{ matrix.python-version }}
+      - name: Set up Python ${{ matrix.python-version }}
         uses: actions/setup-python@v4
         with:
           python-version: ${{ matrix.python-version }}
@@ -181,11 +184,9 @@ jobs:
       - name: Install python dependencies
         run: |
           python -m pip install --user --upgrade pip
-          python -m pip install --upgrade wheel
           python -m pip --version
 
-      - name: Download build artifacts
-        uses: actions/download-artifact@v3
+      - uses: actions/download-artifact@v3
         with:
           name: dist
           path: dist/
diff --git a/.github/workflows/nightly-release.yml b/.github/workflows/nightly-release.yml
index fc3ecba92..4762d1218 100644
--- a/.github/workflows/nightly-release.yml
+++ b/.github/workflows/nightly-release.yml
@@ -26,7 +26,7 @@ defaults:
     shell: bash
 
 env:
-  RELEASE_BRANCH: "1.6.latest"
+  RELEASE_BRANCH: "1.5.latest"
 
 jobs:
   aggregate-release-data:
@@ -38,52 +38,52 @@ jobs:
       release_branch: ${{ steps.release-branch.outputs.name }}
 
     steps:
-      - name: "Checkout ${{ github.repository }} @ ${{ env.RELEASE_BRANCH }}"
+      - name: "Checkout ${{ github.repository }} Branch ${{ env.RELEASE_BRANCH }}"
         uses: actions/checkout@v3
         with:
           ref: ${{ env.RELEASE_BRANCH }}
 
-      - name: Resolve commit to release
+      - name: "Resolve Commit To Release"
         id: resolve-commit-sha
         run: |
           commit_sha=$(git rev-parse HEAD)
           echo "release_commit=$commit_sha" >> $GITHUB_OUTPUT
 
-      - name: Get current version
+      - name: "Get Current Version Number"
         id: version-number-sources
         run: |
           current_version=`awk -F"current_version = " '{print $2}' .bumpversion.cfg | tr '\n' ' '`
           echo "current_version=$current_version" >> $GITHUB_OUTPUT
 
-      - name: Audit version and parse into parts
+      - name: "Audit Version And Parse Into Parts"
         id: semver
         uses: dbt-labs/actions/parse-semver@v1.1.0
         with:
           version: ${{ steps.version-number-sources.outputs.current_version }}
 
-      - name: Get current date
+      - name: "Get Current Date"
         id: current-date
         run: echo "date=$(date +'%m%d%Y')" >> $GITHUB_OUTPUT
 
       # Bump to the next patch because when this is a previously released patch, the changelog
       # markdown will already exist and cause a failure in another step
-      - name: Bump patch number
+      - name: "Bump Patch Number"
         id: bump_patch
         run: |
           echo "patch=$((${{ steps.semver.outputs.patch }}+1))" >> $GITHUB_OUTPUT
 
-      - name: Generate nightly release version number
+      - name: "Generate Nightly Release Version Number"
         id: nightly-release-version
         run: |
           number="${{ steps.semver.outputs.major }}.${{ steps.semver.outputs.minor }}.${{ steps.bump_patch.outputs.patch }}.dev${{ steps.current-date.outputs.date }}"
           echo "number=$number" >> $GITHUB_OUTPUT
 
-      - name: Audit nightly release version and parse into parts
+      - name: "Audit Nightly Release Version And Parse Into Parts"
         uses: dbt-labs/actions/parse-semver@v1.1.0
         with:
           version: ${{ steps.nightly-release-version.outputs.number }}
 
-      - name: Set release branch
+      - name: "Set Release Branch"
         id: release-branch
         run: |
           echo "name=${{ env.RELEASE_BRANCH }}" >> $GITHUB_OUTPUT
@@ -93,7 +93,7 @@ jobs:
     needs: [aggregate-release-data]
 
     steps:
-      - name: "[DEBUG] log outputs"
+      - name: "[DEBUG] Log Outputs"
         run: |
           echo commit_sha    : ${{ needs.aggregate-release-data.outputs.commit_sha }}
           echo version_number: ${{ needs.aggregate-release-data.outputs.version_number }}
@@ -101,6 +101,7 @@ jobs:
 
   release-github-pypi:
     needs: [aggregate-release-data]
+
     uses: ./.github/workflows/release.yml
     with:
       sha: ${{ needs.aggregate-release-data.outputs.commit_sha }}
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index e375bd6e3..88942e251 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -131,7 +131,9 @@ jobs:
 
   bump-version-generate-changelog:
     name: Bump package version, Generate changelog
+
     uses: dbt-labs/dbt-release/.github/workflows/release-prep.yml@main
+
     with:
       sha: ${{ inputs.sha }}
       version_number: ${{ inputs.version_number }}
@@ -139,12 +141,15 @@ jobs:
       env_setup_script_path: ${{ inputs.env_setup_script_path }}
       test_run: ${{ inputs.test_run }}
       nightly_release: ${{ inputs.nightly_release }}
+
     secrets: inherit
 
   log-outputs-bump-version-generate-changelog:
     name: "[Log output] Bump package version, Generate changelog"
     if: ${{ !failure() && !cancelled() }}
+
     needs: [bump-version-generate-changelog]
+
     runs-on: ubuntu-latest
 
     steps:
@@ -157,7 +162,9 @@ jobs:
     name: Build, Test, Package
     if: ${{ !failure() && !cancelled() }}
     needs: [bump-version-generate-changelog]
+
     uses: dbt-labs/dbt-release/.github/workflows/build.yml@main
+
     with:
       sha: ${{ needs.bump-version-generate-changelog.outputs.final_sha }}
       version_number: ${{ inputs.version_number }}
@@ -167,6 +174,7 @@ jobs:
       package_test_command: ${{ inputs.package_test_command }}
       test_run: ${{ inputs.test_run }}
       nightly_release: ${{ inputs.nightly_release }}
+
     secrets:
       AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
       AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
@@ -174,8 +182,11 @@ jobs:
   github-release:
     name: GitHub Release
     if: ${{ !failure() && !cancelled() }}
+
     needs: [bump-version-generate-changelog, build-test-package]
+
     uses: dbt-labs/dbt-release/.github/workflows/github-release.yml@main
+
     with:
       sha: ${{ needs.bump-version-generate-changelog.outputs.final_sha }}
       version_number: ${{ inputs.version_number }}
@@ -184,11 +195,15 @@ jobs:
 
   pypi-release:
     name: PyPI Release
+
     needs: [github-release]
+
     uses: dbt-labs/dbt-release/.github/workflows/pypi-release.yml@main
+
     with:
       version_number: ${{ inputs.version_number }}
       test_run: ${{ inputs.test_run }}
+
     secrets:
       PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
       TEST_PYPI_API_TOKEN: ${{ secrets.TEST_PYPI_API_TOKEN }}
@@ -196,6 +211,7 @@ jobs:
   slack-notification:
     name: Slack Notification
     if: ${{ failure() && (!inputs.test_run || inputs.nightly_release) }}
+
     needs:
       [
         bump-version-generate-changelog,
@@ -203,8 +219,10 @@ jobs:
         github-release,
         pypi-release,
       ]
+
     uses: dbt-labs/dbt-release/.github/workflows/slack-post-notification.yml@main
     with:
       status: "failure"
+
     secrets:
       SLACK_WEBHOOK_URL: ${{ secrets.SLACK_DEV_ADAPTER_ALERTS }}
diff --git a/.github/workflows/triage-labels.yml b/.github/workflows/triage-labels.yml
index 1f4cddb20..91f529e3e 100644
--- a/.github/workflows/triage-labels.yml
+++ b/.github/workflows/triage-labels.yml
@@ -1,14 +1,14 @@
 # **what?**
 # When the core team triages, we sometimes need more information from the issue creator.  In
 # those cases we remove the `triage` label and add the `awaiting_response` label.  Once we
-# receive a response in the form of a comment, we want the `awaiting_response` label removed
-# in favor of the `triage` label so that we are aware that the issue needs action.
+# recieve a response in the form of a comment, we want the `awaiting_response` label removed
+# in favor of the `triage` label so we are aware that the issue needs action.
 
 # **why?**
-# To help out with team triage issue tracking
+# To help with out team triage issue tracking
 
 # **when?**
-# This will run when a comment is added to an issue with the `awaiting_response` label.
+# This will run when a comment is added to an issue and that issue has to `awaiting_response` label.
 
 name: Update Triage Label
 

From 89e23375a49c123cb1fa6a95e731e9291ba9e0fb Mon Sep 17 00:00:00 2001
From: Mike Alfare 
Date: Fri, 11 Aug 2023 12:19:13 -0400
Subject: [PATCH 03/10] update makefile to use pyproject.toml

---
 .pre-commit-config.yaml               |  4 +-
 Makefile                              | 86 +++++++--------------------
 docker_dev/debian.Dockerfile          | 49 ---------------
 docker_dev/dev-env-default.Dockerfile | 25 --------
 4 files changed, 24 insertions(+), 140 deletions(-)
 delete mode 100644 docker_dev/debian.Dockerfile
 delete mode 100644 docker_dev/dev-env-default.Dockerfile

diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 7321d4d8a..866605a97 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -15,7 +15,7 @@ repos:
     rev: 23.7.0
     hooks:
     -   id: black
-        args: [--line-length=99, --target-version=py38]
+        args: [--line-length=99, --target-version=py38, -v]
 -   repo: https://github.com/pycqa/flake8
     rev: 6.1.0
     hooks:
@@ -24,7 +24,7 @@ repos:
     rev: v1.4.1
     hooks:
     -   id: mypy
-        args: [--show-error-codes, --ignore-missing-imports, --explicit-package-bases]
+        args: [--show-error-codes, --ignore-missing-imports, --explicit-package-bases, --pretty]
         # By using `language: system` we run this hook in the local
         # environment instead of a pre-commit isolated one.
         # This is needed to ensure mypy correctly parses the project.
diff --git a/Makefile b/Makefile
index c8f682a1c..2a948ec28 100644
--- a/Makefile
+++ b/Makefile
@@ -2,65 +2,33 @@
 
 .PHONY: dev
 dev: ## Installs adapter in develop mode along with development dependencies
-	@\
-	pip install -e . -r dev-requirements.txt && pre-commit install
+	@pip install -e ".[dev,test]" && pre-commit install
 
 .PHONY: dev-uninstall
 dev-uninstall: ## Uninstalls all packages while maintaining the virtual environment
-               ## Useful when updating versions, or if you accidentally installed into the system interpreter
-	pip freeze | grep -v "^-e" | cut -d "@" -f1 | xargs pip uninstall -y
-	pip uninstall -y dbt-snowflake
-
-.PHONY: mypy
-mypy: ## Runs mypy against staged changes for static type checking.
-	@\
-	pre-commit run --hook-stage manual mypy-check | grep -v "INFO"
-
-.PHONY: flake8
-flake8: ## Runs flake8 against staged changes to enforce style guide.
-	@\
-	pre-commit run --hook-stage manual flake8-check | grep -v "INFO"
-
-.PHONY: black
-black: ## Runs black  against staged changes to enforce style guide.
-	@\
-	pre-commit run --hook-stage manual black-check -v | grep -v "INFO"
+	@pip freeze | grep -v "^-e" | cut -d "@" -f1 | xargs pip uninstall -y
+	@pip uninstall -y dbt-snowflake
 
 .PHONY: lint
-lint: ## Runs flake8 and mypy code checks against staged changes.
-	@\
-	pre-commit run flake8-check --hook-stage manual | grep -v "INFO"; \
-	pre-commit run mypy-check --hook-stage manual | grep -v "INFO"
-
-.PHONY: linecheck
-linecheck: ## Checks for all Python lines 100 characters or more
-	@\
-	find dbt -type f -name "*.py" -exec grep -I -r -n '.\{100\}' {} \;
+lint: ## Runs flake8 and mypy code checks against staged changes
+	@pre-commit run black | grep -v "INFO"
+	@pre-commit run flake8 | grep -v "INFO"
+	@pre-commit run mypy | grep -v "INFO"
 
 .PHONY: unit
-unit: ## Runs unit tests with py38.
-	@\
-	tox -e py38
-
-.PHONY: test
-test: ## Runs unit tests with py38 and code checks against staged changes.
-	@\
-	tox -p -e py38; \
-	pre-commit run black-check --hook-stage manual | grep -v "INFO"; \
-	pre-commit run flake8-check --hook-stage manual | grep -v "INFO"; \
-	pre-commit run mypy-check --hook-stage manual | grep -v "INFO"
+unit: ## Runs unit tests with py38
+	@tox -e py38
 
 .PHONY: integration
-integration: ## Runs snowflake integration tests with py38.
-	@\
-	tox -e py38-snowflake --
+integration: ## Runs snowflake integration tests with py38
+	@tox -e py38-snowflake --
 
 .PHONY: clean
-	@echo "cleaning repo"
-	@git clean -f -X
+clean:  ## Remove all untracked files, but keep the credentials file
+	@git clean -X -n --exclude="!test.env"
 
 .PHONY: help
-help: ## Show this help message.
+help: ## Show this help message
 	@echo 'usage: make [target]'
 	@echo
 	@echo 'targets:'
@@ -68,30 +36,20 @@ help: ## Show this help message.
 
 .PHONY: ubuntu-py38
 ubuntu-py38:
-	docker build -f docker_dev/ubuntu.Dockerfile -t dbt-snowflake-ubuntu-py38 . --build-arg version=3.8
-	docker run --rm -it --name dbt-snowflake-ubuntu-py38 -v $(shell pwd):/opt/code dbt-snowflake-ubuntu-py38
+	@docker build -f docker_dev/ubuntu.Dockerfile -t dbt-snowflake-ubuntu-py38 . --build-arg version=3.8
+	@docker run --rm -it --name dbt-snowflake-ubuntu-py38 -v $(shell pwd):/opt/code dbt-snowflake-ubuntu-py38
 
 .PHONY: ubuntu-py39
 ubuntu-py39:
-	docker build -f docker_dev/ubuntu.Dockerfile -t dbt-snowflake-ubuntu-py39 . --build-arg version=3.9
-	docker run --rm -it --name dbt-snowflake-ubuntu-py39 -v $(shell pwd):/opt/code dbt-snowflake-ubuntu-py39
+	@docker build -f docker_dev/ubuntu.Dockerfile -t dbt-snowflake-ubuntu-py39 . --build-arg version=3.9
+	@docker run --rm -it --name dbt-snowflake-ubuntu-py39 -v $(shell pwd):/opt/code dbt-snowflake-ubuntu-py39
 
 .PHONY: ubuntu-py310
 ubuntu-py310:
-	docker build -f docker_dev/ubuntu.Dockerfile -t dbt-snowflake-ubuntu-py310 . --build-arg version=3.10
-	docker run --rm -it --name dbt-snowflake-ubuntu-py310 -v $(shell pwd):/opt/code dbt-snowflake-ubuntu-py310
+	@docker build -f docker_dev/ubuntu.Dockerfile -t dbt-snowflake-ubuntu-py310 . --build-arg version=3.10
+	@docker run --rm -it --name dbt-snowflake-ubuntu-py310 -v $(shell pwd):/opt/code dbt-snowflake-ubuntu-py310
 
 .PHONY: ubuntu-py311
 ubuntu-py311:
-	docker build -f docker_dev/ubuntu.Dockerfile -t dbt-snowflake-ubuntu-py311 . --build-arg version=3.11
-	docker run --rm -it --name dbt-snowflake-ubuntu-py311 -v $(shell pwd):/opt/code dbt-snowflake-ubuntu-py311
-
-.PHONY: debian-py38
-debian-py38:
-	docker build -f docker/debian-py38.Dockerfile -t dbt-snowflake-debian-py38 . --build-arg version=3.8.15
-	docker run --rm -it --name dbt-snowflake-debian-py38 -v $(shell pwd):/opt/code dbt-snowflake-debian-py38
-
-.PHONY: dev-env-default
-dev-env-default:
-	docker build -f docker/dev-env-default.Dockerfile -t dbt-snowflake-dev-env-default .
-	docker run --rm -it --name dbt-snowflake-dev-env-default -v $(shell pwd):/opt/code dbt-snowflake-dev-env-default
+	@docker build -f docker_dev/ubuntu.Dockerfile -t dbt-snowflake-ubuntu-py311 . --build-arg version=3.11
+	@docker run --rm -it --name dbt-snowflake-ubuntu-py311 -v $(shell pwd):/opt/code dbt-snowflake-ubuntu-py311
diff --git a/docker_dev/debian.Dockerfile b/docker_dev/debian.Dockerfile
deleted file mode 100644
index 9c3415be5..000000000
--- a/docker_dev/debian.Dockerfile
+++ /dev/null
@@ -1,49 +0,0 @@
-FROM debian:latest
-
-# default to py3.11.1, this can be overridden at build, e.g. `docker build ... --build-arg version=3.10.8`
-ARG version=3.11.1
-
-# install python dependencies
-RUN apt-get update && \
-    apt-get install -y --no-install-recommends \
-        build-essential \
-        zlib1g-dev \
-        libncurses5-dev \
-        libgdbm-dev \
-        libnss3-dev \
-        libssl-dev \
-        libreadline-dev \
-        libffi-dev \
-        libsqlite3-dev \
-        wget \
-        libbz2-dev \
-        git-all
-
-# download, extract, and install python
-RUN wget https://www.python.org/ftp/python/$version/Python-$version.tgz && \
-    tar -xvf Python-$version.tgz && \
-    cd Python-$version && \
-    ./configure --enable-optimizations && \
-    make -j $(shell nproc) && \
-    make altinstall
-
-# clean up
-RUN apt-get clean && \
-    rm -rf \
-        /var/lib/apt/lists/* \
-        /tmp/* \
-        /var/tmp/* \
-        /Python-$version.tgz
-
-# add this installation to the path and update the default system interpreter to the newly installed version
-RUN export PATH="/Python-$version:$PATH" && \
-    update-alternatives --install /usr/bin/python3 python3 /Python-$version/python 1
-
-# update python build tools
-RUN python3 -m pip install --upgrade pip setuptools wheel --no-cache-dir
-
-# setup mount for our code
-WORKDIR /opt/code
-VOLUME /opt/code
-
-ENV PYTHONUNBUFFERED=1
diff --git a/docker_dev/dev-env-default.Dockerfile b/docker_dev/dev-env-default.Dockerfile
deleted file mode 100644
index ed90889a7..000000000
--- a/docker_dev/dev-env-default.Dockerfile
+++ /dev/null
@@ -1,25 +0,0 @@
-FROM docker/dev-environments-default:latest
-
-# install python and git (for installing dbt-core)
-RUN apt-get update && \
-    apt-get install -y --no-install-recommends \
-        python3-pip \
-        python3-wheel \
-        build-essential
-
-# clean up
-RUN apt-get clean && \
-    rm -rf \
-        /var/lib/apt/lists/* \
-        /tmp/* \
-        /var/tmp/*
-
-# update python build tools
-RUN python3 -m pip install --upgrade pip setuptools wheel --no-cache-dir
-
-# setup mount for our code
-WORKDIR /opt/code
-VOLUME /opt/code
-
-# send stdout/stderr to terminal
-ENV PYTHONUNBUFFERED=1

From e2ca6a891987d5e2b81ff1d8ee1cbb8b86ffe9be Mon Sep 17 00:00:00 2001
From: Mike Alfare 
Date: Fri, 11 Aug 2023 12:42:10 -0400
Subject: [PATCH 04/10] update dev pointers to dbt-core to be pep-508 compliant

---
 pyproject.toml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pyproject.toml b/pyproject.toml
index ea91b8a3d..4947ce2bb 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -36,8 +36,8 @@ dependencies = [
     "agate",
 ]
 optional-dependencies.dev = [
-    "git+https://github.com/dbt-labs/dbt-core.git#egg=dbt-core&subdirectory=core",
-    "git+https://github.com/dbt-labs/dbt-core.git#egg=dbt-tests-adapter&subdirectory=tests/adapter",
+    "dbt-core@git+https://github.com/dbt-labs/dbt-core.git#egg=dbt-core&subdirectory=core",
+    "dbt-tests-adapter@git+https://github.com/dbt-labs/dbt-core.git#egg=dbt-tests-adapter&subdirectory=tests/adapter",
     "black~=23.1.0",
     "click",
     "flake8",

From 2b6018e8f5e04bbd120ba1bec6c49855d95a2ca9 Mon Sep 17 00:00:00 2001
From: Mike Alfare 
Date: Fri, 11 Aug 2023 12:49:33 -0400
Subject: [PATCH 05/10] update tox deps to use pyproject.toml

---
 setup.cfg | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/setup.cfg b/setup.cfg
index 002bae971..e50ad1eeb 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -27,9 +27,7 @@ passenv =
     DBT_*
     PYTEST_ADDOPTS
 commands = {envpython} -m pytest {posargs} tests/unit
-deps =
-  -rdev-requirements.txt
-  -e.
+deps = -e".[test]"
 
 [testenv:{integration,py38,py39,py310,py311,py}-{snowflake}]
 description = adapter plugin integration testing
@@ -42,6 +40,4 @@ passenv =
     DD_ENV
 commands =
   snowflake: {envpython} -m pytest {posargs} tests/functional
-deps =
-  -rdev-requirements.txt
-  -e.
+deps = -e".[test]"

From e8ffe1ee7bf24b85611ae71f790d6f09b47f8dbb Mon Sep 17 00:00:00 2001
From: Mike Alfare 
Date: Fri, 11 Aug 2023 12:58:26 -0400
Subject: [PATCH 06/10] add dev core requirements to the test requirements

---
 pyproject.toml | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/pyproject.toml b/pyproject.toml
index 4947ce2bb..daec3595c 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -52,6 +52,8 @@ optional-dependencies.dev = [
     "types-requests",
 ]
 optional-dependencies.test = [
+    "dbt-core@git+https://github.com/dbt-labs/dbt-core.git#egg=dbt-core&subdirectory=core",
+    "dbt-tests-adapter@git+https://github.com/dbt-labs/dbt-core.git#egg=dbt-tests-adapter&subdirectory=tests/adapter",
     "ddtrace",
     "freezegun",
     "pytest",

From 6a4d094ee8ae528e99efe7e0f639a482c36b6540 Mon Sep 17 00:00:00 2001
From: Mike Alfare 
Date: Fri, 11 Aug 2023 13:14:48 -0400
Subject: [PATCH 07/10] updated dbt-core dependency to include pre-releases

---
 pyproject.toml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pyproject.toml b/pyproject.toml
index daec3595c..b98019fdf 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -30,7 +30,7 @@ urls.Homepage = "https://github.com/dbt-labs/dbt-snowflake"
 urls."Bug Reports" = "https://github.com/dbt-labs/dbt-snowflake/issues"
 urls.Docs = "https://docs.getdbt.com/docs/core/connect-data-platform/snowflake-setup"
 dependencies = [
-    "dbt-core~=1.7",
+    "dbt-core~=1.7.0a1",
     "snowflake-connector-python[secure-local-storage]~=3.0",
     # installed via dbt-core but referenced directly; don't pin to avoid version conflicts with dbt-core
     "agate",

From 66e64e6fb3d14dad9b93aea7b9f8eaaf6f9f9b20 Mon Sep 17 00:00:00 2001
From: Mike Alfare 
Date: Fri, 11 Aug 2023 13:50:51 -0400
Subject: [PATCH 08/10] replaced deps with extras in tox config

---
 setup.cfg | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/setup.cfg b/setup.cfg
index e50ad1eeb..36e0cc742 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -27,7 +27,7 @@ passenv =
     DBT_*
     PYTEST_ADDOPTS
 commands = {envpython} -m pytest {posargs} tests/unit
-deps = -e".[test]"
+extras = "test"
 
 [testenv:{integration,py38,py39,py310,py311,py}-{snowflake}]
 description = adapter plugin integration testing
@@ -40,4 +40,4 @@ passenv =
     DD_ENV
 commands =
   snowflake: {envpython} -m pytest {posargs} tests/functional
-deps = -e".[test]"
+extras = "test"

From 5b1737f1571d28c33156af1b1ac8b077d5847396 Mon Sep 17 00:00:00 2001
From: Mike Alfare 
Date: Fri, 11 Aug 2023 14:04:54 -0400
Subject: [PATCH 09/10] replaced deps with extras in tox config

---
 setup.cfg | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/setup.cfg b/setup.cfg
index 36e0cc742..04e72be5c 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -22,22 +22,24 @@ envlist = py38,py39,py310,py311
 
 [testenv:{unit,py38,py39,py310,py311,py}]
 description = unit testing
-skip_install = true
+# skip_install = true
+download = true
 passenv =
     DBT_*
     PYTEST_ADDOPTS
 commands = {envpython} -m pytest {posargs} tests/unit
-extras = "test"
+extras = test
 
 [testenv:{integration,py38,py39,py310,py311,py}-{snowflake}]
-description = adapter plugin integration testing
-skip_install = true
+description = integration testing
+# skip_install = true
+download = true
 passenv =
     DBT_*
-    SNOWFLAKE_TEST_*
     PYTEST_ADDOPTS
+    SNOWFLAKE_TEST_*
     DD_SERVICE
     DD_ENV
 commands =
   snowflake: {envpython} -m pytest {posargs} tests/functional
-extras = "test"
+extras = test

From bb84a445ab0035354f47f5cbadd964fca4468fd7 Mon Sep 17 00:00:00 2001
From: Mike Alfare 
Date: Fri, 11 Aug 2023 14:23:14 -0400
Subject: [PATCH 10/10] replaced deps with extras in tox config

---
 setup.cfg | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/setup.cfg b/setup.cfg
index 04e72be5c..d45c2e803 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -23,6 +23,7 @@ envlist = py38,py39,py310,py311
 [testenv:{unit,py38,py39,py310,py311,py}]
 description = unit testing
 # skip_install = true
+use_develop = true
 download = true
 passenv =
     DBT_*
@@ -33,6 +34,7 @@ extras = test
 [testenv:{integration,py38,py39,py310,py311,py}-{snowflake}]
 description = integration testing
 # skip_install = true
+use_develop = true
 download = true
 passenv =
     DBT_*