diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 96744060..00000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: ci - -on: - pull_request: - push: - branches: [main] - -jobs: - pre-commit: - name: 'Pre-commit checks' - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v3 - with: - python-version: '3.11' - - uses: pre-commit/action@v3.0.0 - - unit_test: - name: 'Unit tests with coverage' - runs-on: ubuntu-latest - strategy: - matrix: - python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] - steps: - - uses: actions/checkout@v3 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - make install_deps - - name: Test with pytest - run: | - make unit_test diff --git a/.github/workflows/code-quality.yml b/.github/workflows/code-quality.yml new file mode 100644 index 00000000..425940da --- /dev/null +++ b/.github/workflows/code-quality.yml @@ -0,0 +1,39 @@ +name: "Code quality" + +on: + workflow_call: + inputs: + branch: + description: "Choose the branch to check" + type: string + default: "main" + repository: + description: "Choose the repository to check, when using a fork" + type: string + default: "dbt-labs/dbt-athena" + workflow_dispatch: + inputs: + branch: + description: "Choose the branch to check" + type: string + default: "main" + repository: + description: "Choose the repository to check, when using a fork" + type: string + default: "dbt-labs/dbt-athena" + +permissions: + contents: read + +jobs: + code-quality: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ inputs.branch }} + repository: ${{ inputs.repository }} + - uses: actions/setup-python@v5 + with: + python-version: ${{ vars.DEFAULT_PYTHON_VERSION }} + - uses: pre-commit/action@v3.0.1 diff --git a/.github/workflows/functional-tests-workflow.yml b/.github/workflows/functional-tests-workflow.yml deleted file mode 100644 index 7f3fbe07..00000000 --- a/.github/workflows/functional-tests-workflow.yml +++ /dev/null @@ -1,54 +0,0 @@ -# reusable workflow to be called from the main workflow -name: functional-tests-workflow -run-name: "${{ (contains(github.event_name, 'workflow_') && inputs.name) || github.event_name }}: ${{ (contains(github.event_name, 'workflow_') && inputs.adapter_branch) || github.ref_name }} by @${{ github.actor }}" - -on: - workflow_call: - inputs: - checkout-ref: - required: true - type: string - checkout-repository: - required: true - type: string -concurrency: - group: ${{ github.workflow }}-${{ github.event_name }}-${{ contains(github.event_name, 'pull_request') && github.event.pull_request.head.ref || github.sha }} - cancel-in-progress: true - -env: - DBT_TEST_ATHENA_DATABASE: awsdatacatalog - DBT_TEST_ATHENA_SCHEMA: dbt-tests - DBT_TEST_ATHENA_WORK_GROUP: athena-dbt-tests - DBT_TEST_ATHENA_THREADS: 16 - DBT_TEST_ATHENA_POLL_INTERVAL: 0.5 - DBT_TEST_ATHENA_NUM_RETRIES: 3 - -jobs: - functional-tests: - name: Functional Tests - runs-on: ubuntu-latest - env: - DBT_TEST_ATHENA_S3_STAGING_DIR: ${{ vars.DBT_TEST_ATHENA_S3_BUCKET }}/staging/ - DBT_TEST_ATHENA_S3_TMP_TABLE_DIR: ${{ vars.DBT_TEST_ATHENA_S3_BUCKET }}/tmp_tables/ - DBT_TEST_ATHENA_REGION_NAME: ${{ vars.DBT_TEST_ATHENA_REGION_NAME }} - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - ref: ${{ inputs.checkout-ref }} - repository: ${{ inputs.checkout-repository }} - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: '3.8' - - name: Install dependencies - run: | - make install_deps - - name: Configure AWS credentials from Test account - uses: aws-actions/configure-aws-credentials@v2 - with: - role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/${{ secrets.ASSUMABLE_ROLE_NAME }} - aws-region: ${{ vars.DBT_TEST_ATHENA_REGION_NAME }} - - name: Functional Test - run: | - pytest -n 8 tests/functional diff --git a/.github/workflows/functional-tests.yml b/.github/workflows/functional-tests.yml deleted file mode 100644 index c1e4dbd7..00000000 --- a/.github/workflows/functional-tests.yml +++ /dev/null @@ -1,48 +0,0 @@ -name: functional-tests - -on: - # we use pull_request_target to run the CI also for forks - pull_request_target: - types: [opened, reopened, synchronize, labeled] - push: - branches: [main] - workflow_dispatch: - workflow_call: - inputs: - checkout-ref: - required: true - type: string - checkout-repository: - required: true - type: string - -jobs: - # workflow that is invoked when for PRs with labels 'enable-functional-tests' - functional-tests-pr: - name: Functional Tests - PR - uses: ./.github/workflows/functional-tests-workflow.yml - secrets: inherit - permissions: - id-token: write - contents: read - with: - # this allows to pick the branch from the PR - checkout-ref: ${{ github.event.pull_request.head.ref }} - # this allows to work on fork - checkout-repository: ${{ github.event.pull_request.head.repo.full_name }} - - # workflow that is invoked when a push to main happens - functional-tests-main: - name: Functional Tests - main - if: | - github.event_name == 'push' && github.ref == 'refs/heads/main' - || github.event_name == 'workflow_dispatch' - || github.event_name == 'workflow_call' - uses: ./.github/workflows/functional-tests-workflow.yml - secrets: inherit - permissions: - id-token: write - contents: read - with: - checkout-ref: ${{ github.ref }} - checkout-repository: ${{ github.repository }} diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml new file mode 100644 index 00000000..04c91abf --- /dev/null +++ b/.github/workflows/integration-tests.yml @@ -0,0 +1,64 @@ +name: "Integration tests" + +on: + workflow_call: + inputs: + package: + description: "Choose the package to test" + type: string + default: "dbt-athena" + branch: + description: "Choose the branch to test" + type: string + default: "main" + repository: + description: "Choose the repository to test, when using a fork" + type: string + default: "dbt-labs/dbt-athena" + workflow_dispatch: + inputs: + package: + description: "Choose the package to test" + type: choice + options: ["dbt-athena", "dbt-athena-community"] + branch: + description: "Choose the branch to test" + type: string + default: "main" + repository: + description: "Choose the repository to test, when using a fork" + type: string + default: "dbt-labs/dbt-athena" + +permissions: + id-token: write + contents: read + +jobs: + integration-tests: + runs-on: ubuntu-latest + env: + DBT_TEST_ATHENA_S3_STAGING_DIR: ${{ vars.DBT_TEST_ATHENA_S3_BUCKET }}/staging/ + DBT_TEST_ATHENA_S3_TMP_TABLE_DIR: ${{ vars.DBT_TEST_ATHENA_S3_BUCKET }}/tmp_tables/ + DBT_TEST_ATHENA_REGION_NAME: ${{ vars.DBT_TEST_ATHENA_REGION_NAME }} + DBT_TEST_ATHENA_DATABASE: awsdatacatalog + DBT_TEST_ATHENA_SCHEMA: dbt-tests + DBT_TEST_ATHENA_WORK_GROUP: athena-dbt-tests + DBT_TEST_ATHENA_THREADS: 16 + DBT_TEST_ATHENA_POLL_INTERVAL: 0.5 + DBT_TEST_ATHENA_NUM_RETRIES: 3 + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ inputs.branch }} + repository: ${{ inputs.repository }} + - uses: actions/setup-python@v5 + with: + python-version: ${{ vars.DEFAULT_PYTHON_VERSION }} + - uses: pypa/hatch@install + - uses: aws-actions/configure-aws-credentials@v2 + with: + role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/${{ secrets.ASSUMABLE_ROLE_NAME }} + aws-region: ${{ vars.DBT_TEST_ATHENA_REGION_NAME }} + - run: hatch run integration-tests + working-directory: ./${{ inputs.package }} diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml new file mode 100644 index 00000000..35f7427f --- /dev/null +++ b/.github/workflows/publish-pypi.yml @@ -0,0 +1,71 @@ +name: "Publish to PyPI" + +on: + workflow_call: + inputs: + package: + description: "Choose the package to publish" + type: string + default: "dbt-athena" + deploy-to: + description: "Choose whether to publish to test or prod" + type: string + default: "prod" + branch: + description: "Choose the branch to publish" + type: string + default: "main" + +permissions: + contents: read + +defaults: + run: + shell: bash + +jobs: + publish: + runs-on: ubuntu-latest + environment: + name: ${{ inputs.deploy-to }} + url: ${{ vars.PYPI_PROJECT_URL }}/${{ inputs.package }} + permissions: + # this permission is required for trusted publishing + # see https://github.com/marketplace/actions/pypi-publish + id-token: write + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ inputs.branch }} + - uses: actions/setup-python@v5 + with: + python-version: ${{ vars.DEFAULT_PYTHON_VERSION }} + - uses: pypa/hatch@install + # hatch will build using test PyPI first and fall back to prod PyPI when deploying to test + # this is done via environment variables in the test environment in GitHub + - run: hatch build && hatch run build:check-all + working-directory: ./${{ inputs.package }} + - uses: pypa/gh-action-pypi-publish@release/v1 + with: + repository-url: ${{ vars.PYPI_REPOSITORY_URL }} + packages-dir: ${{ inputs.package }}/dist/ + + verify: + runs-on: ubuntu-latest + needs: publish + # check the correct index + environment: + name: ${{ inputs.deploy-to }} + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ inputs.branch }} + - id: version + run: echo "version=$(hatch version)" >> $GITHUB_OUTPUT + working-directory: ./${{ inputs.package }} + - uses: nick-fields/retry@v3 + with: + timeout_seconds: 10 + retry_wait_seconds: 10 + max_attempts: 15 # 5 minutes: (10s timeout + 10s delay) * 15 attempts + command: wget ${{ vars.PYPI_PROJECT_URL }}/${{ inputs.package }}/${{ steps.version.outputs.version }} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 00000000..82597c7d --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,48 @@ +name: "Publish" + +on: + workflow_dispatch: + inputs: + deploy-to: + description: "Choose whether to deploy to test or prod" + type: environment + default: "prod" + branch: + description: "Choose the branch to release from" + type: string + default: "main" + +# don't attempt to release the same target in parallel +concurrency: + group: ${{ github.workflow }}-${{ inputs.deploy-to }} + cancel-in-progress: true + +jobs: + unit-tests: + uses: ./.github/workflows/unit-tests.yml + with: + branch: ${{ inputs.branch }} + + integration-tests: + uses: ./.github/workflows/integration-tests.yml + with: + branch: ${{ inputs.branch }} + repository: ${{ github.repository }} + secrets: inherit + + publish-dbt-athena: + needs: [unit-tests, integration-tests] + uses: ./.github/workflows/publish-pypi.yml + with: + deploy-to: ${{ inputs.deploy-to }} + branch: ${{ inputs.branch }} + + publish-dbt-athena-community: + # dbt-athena-community is hard pinned to dbt-athena to ensure they are the same + # this means we need to finish publishing dbt-athena before starting to build dbt-athena-community + needs: publish-dbt-athena + uses: ./.github/workflows/publish-pypi.yml + with: + package: "dbt-athena-community" + deploy-to: ${{ inputs.deploy-to }} + branch: ${{ inputs.branch }} diff --git a/.github/workflows/pull-request-checks.yml b/.github/workflows/pull-request-checks.yml new file mode 100644 index 00000000..3ca27145 --- /dev/null +++ b/.github/workflows/pull-request-checks.yml @@ -0,0 +1,50 @@ +name: "Pull request checks" + +on: + pull_request: + types: [opened, reopened, synchronize] + +# only run this once per PR at a time +concurrency: + group: ${{ github.workflow }}-${{ github.event.number }} + cancel-in-progress: true + +jobs: + code-quality: + uses: ./.github/workflows/code-quality.yml + with: + branch: ${{ github.event.pull_request.head.ref }} + repository: ${{ github.event.pull_request.head.repo.full_name }} + + unit-tests: + uses: ./.github/workflows/unit-tests.yml + with: + package: ${{ matrix.package }} + branch: ${{ github.event.pull_request.head.ref }} + repository: ${{ github.event.pull_request.head.repo.full_name }} + strategy: + matrix: + package: ["dbt-athena", "dbt-athena-community"] + + integration-tests: + uses: ./.github/workflows/integration-tests.yml + with: + # integration test runs can't run in parallel for now, so only run dbt-athena + # both will run post merge and unit tests run for both, so this is sufficient + branch: ${{ github.event.pull_request.head.ref }} + repository: ${{ github.event.pull_request.head.repo.full_name }} + secrets: inherit + + # This job does nothing and is only used for branch protection + results: + name: "Pull request checks" + if: always() + needs: + - code-quality + - unit-tests + - integration-tests + runs-on: ubuntu-latest + steps: + - uses: re-actors/alls-green@release/v1 + with: + jobs: ${{ toJSON(needs) }} diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml deleted file mode 100644 index 48c147ee..00000000 --- a/.github/workflows/python-publish.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: Upload Python Package - -on: - push: - tags: - - '**' - -permissions: - contents: read - -jobs: - deploy: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - name: Set up Python - uses: actions/setup-python@v3 - with: - python-version: '3.x' - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install build - - name: Build package - run: python -m build - - name: Publish package - uses: pypa/gh-action-pypi-publish@release/v1 - with: - user: __token__ - password: ${{ secrets.PYPI_API_TOKEN }} diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml new file mode 100644 index 00000000..71e5559d --- /dev/null +++ b/.github/workflows/unit-tests.yml @@ -0,0 +1,54 @@ +name: "Unit tests" + +on: + workflow_call: + inputs: + package: + description: "Choose the package to test" + type: string + default: "dbt-athena" + branch: + description: "Choose the branch to test" + type: string + default: "main" + repository: + description: "Choose the repository to test, when using a fork" + type: string + default: "dbt-labs/dbt-athena" + workflow_dispatch: + inputs: + package: + description: "Choose the package to test" + type: choice + options: ["dbt-athena", "dbt-athena-community"] + branch: + description: "Choose the branch to test" + type: string + default: "main" + repository: + description: "Choose the repository to test, when using a fork" + type: string + default: "dbt-labs/dbt-athena" + +permissions: + contents: read + +jobs: + unit-tests: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: ["3.9", "3.10", "3.11", "3.12"] + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ inputs.branch }} + repository: ${{ inputs.repository }} + - uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + - uses: pypa/hatch@install + - run: hatch run unit-tests + shell: bash + working-directory: ./${{ inputs.package }} diff --git a/.markdownlint.yaml b/.markdownlint.yaml index 5657ac69..2e651302 100644 --- a/.markdownlint.yaml +++ b/.markdownlint.yaml @@ -1,264 +1,6 @@ -# Example markdownlint configuration with all properties set to their default value - -# Default state for all rules -default: true - -# Path to configuration file to extend -extends: null - -# MD001/heading-increment/header-increment - Heading levels should only increment by one level at a time -MD001: true - -# MD002/first-heading-h1/first-header-h1 - First heading should be a top-level heading -MD002: - # Heading level - level: 1 - -# MD003/heading-style/header-style - Heading style -MD003: - # Heading style - style: "consistent" - -# MD004/ul-style - Unordered list style -MD004: - # List style - style: "consistent" - -# MD005/list-indent - Inconsistent indentation for list items at the same level -MD005: true - -# MD006/ul-start-left - Consider starting bulleted lists at the beginning of the line -MD006: true - -# MD007/ul-indent - Unordered list indentation -MD007: - # Spaces for indent - indent: 2 - # Whether to indent the first level of the list - start_indented: false - # Spaces for first level indent (when start_indented is set) - start_indent: 2 - -# MD009/no-trailing-spaces - Trailing spaces -MD009: - # Spaces for line break - br_spaces: 2 - # Allow spaces for empty lines in list items - list_item_empty_lines: false - # Include unnecessary breaks - strict: false - -# MD010/no-hard-tabs - Hard tabs -MD010: - # Include code blocks - code_blocks: true - # Fenced code languages to ignore - ignore_code_languages: [] - # Number of spaces for each hard tab - spaces_per_tab: 1 - -# MD011/no-reversed-links - Reversed link syntax -MD011: true - -# MD012/no-multiple-blanks - Multiple consecutive blank lines -MD012: - # Consecutive blank lines - maximum: 1 - -# MD013/line-length - Line length MD013: - # Number of characters line_length: 120 - # Number of characters for headings - heading_line_length: 120 - # Number of characters for code blocks - code_block_line_length: 120 - # Include code blocks - code_blocks: true - # Include tables tables: false - # Include headings - headings: true - # Include headings - headers: true - # Strict length checking - strict: true - # Stern length checking - stern: false - -# MD014/commands-show-output - Dollar signs used before commands without showing output -MD014: true - -# MD018/no-missing-space-atx - No space after hash on atx style heading -MD018: true - -# MD019/no-multiple-space-atx - Multiple spaces after hash on atx style heading -MD019: true - -# MD020/no-missing-space-closed-atx - No space inside hashes on closed atx style heading -MD020: true - -# MD021/no-multiple-space-closed-atx - Multiple spaces inside hashes on closed atx style heading -MD021: true - -# MD022/blanks-around-headings/blanks-around-headers - Headings should be surrounded by blank lines -MD022: - # Blank lines above heading - lines_above: 1 - # Blank lines below heading - lines_below: 1 - -# MD023/heading-start-left/header-start-left - Headings must start at the beginning of the line -MD023: true - -# MD024/no-duplicate-heading/no-duplicate-header - Multiple headings with the same content -MD024: - # Only check sibling headings - allow_different_nesting: false - # Only check sibling headings - siblings_only: false - -# MD025/single-title/single-h1 - Multiple top-level headings in the same document -MD025: - # Heading level - level: 1 - # RegExp for matching title in front matter - front_matter_title: "^\\s*title\\s*[:=]" - -# MD026/no-trailing-punctuation - Trailing punctuation in heading -MD026: - # Punctuation characters - punctuation: ".,;:!。,;:!" - -# MD027/no-multiple-space-blockquote - Multiple spaces after blockquote symbol -MD027: true - -# MD028/no-blanks-blockquote - Blank line inside blockquote -MD028: true -# MD029/ol-prefix - Ordered list item prefix -MD029: - # List style - style: "one_or_ordered" - -# MD030/list-marker-space - Spaces after list markers -MD030: - # Spaces for single-line unordered list items - ul_single: 1 - # Spaces for single-line ordered list items - ol_single: 1 - # Spaces for multi-line unordered list items - ul_multi: 1 - # Spaces for multi-line ordered list items - ol_multi: 1 - -# MD031/blanks-around-fences - Fenced code blocks should be surrounded by blank lines -MD031: - # Include list items - list_items: true - -# MD032/blanks-around-lists - Lists should be surrounded by blank lines -MD032: true - -# MD033/no-inline-html - Inline HTML MD033: - # Allowed elements allowed_elements: [a, p, img] - -# MD034/no-bare-urls - Bare URL used -MD034: true - -# MD035/hr-style - Horizontal rule style -MD035: - # Horizontal rule style - style: "consistent" - -# MD036/no-emphasis-as-heading/no-emphasis-as-header - Emphasis used instead of a heading -MD036: - # Punctuation characters - punctuation: ".,;:!?。,;:!?" - -# MD037/no-space-in-emphasis - Spaces inside emphasis markers -MD037: true - -# MD038/no-space-in-code - Spaces inside code span elements -MD038: true - -# MD039/no-space-in-links - Spaces inside link text -MD039: true - -# MD040/fenced-code-language - Fenced code blocks should have a language specified -MD040: - # List of languages - allowed_languages: [] - # Require language only - language_only: false - -# MD041/first-line-heading/first-line-h1 - First line in a file should be a top-level heading -MD041: - - # Heading level - level: 1 - # RegExp for matching title in front matter - front_matter_title: "^\\s*title\\s*[:=]" - -# MD042/no-empty-links - No empty links -MD042: true - -# MD043/required-headings/required-headers - Required heading structure -MD043: false -# # List of headings -# headings: [] -# # List of headings -# headers: [] -# # Match case of headings -# match_case: false - -# MD044/proper-names - Proper names should have the correct capitalization -MD044: - # List of proper names - names: [] - # Include code blocks - code_blocks: true - # Include HTML elements - html_elements: true - -# MD045/no-alt-text - Images should have an alternate text (alt text) -MD045: true - -# MD046/code-block-style - Code block style -MD046: - # Block style - style: "consistent" - -# MD047/single-trailing-newline - Files should end with a single newline character -MD047: true - -# MD048/code-fence-style - Code fence style -MD048: - # Code fence style - style: "consistent" - -# MD049/emphasis-style - Emphasis style should be consistent -MD049: - # Emphasis style - style: "consistent" - -# MD050/strong-style - Strong style should be consistent -MD050: - # Strong style - style: "consistent" - -# MD051/link-fragments - Link fragments should be valid -MD051: true - -# MD052/reference-links-images - Reference links and images should use a label that is defined -MD052: - # Include shortcut syntax - shortcut_syntax: false - -# MD053/link-image-reference-definitions - Link and image reference definitions should be needed -MD053: - # Ignored definitions - ignored_definitions: - - "//" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d0d8b4f8..73ea3a2a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -18,7 +18,6 @@ repos: # Python checks - id: check-docstring-first - id: debug-statements - - id: requirements-txt-fixer - id: fix-byte-order-marker # General quality checks @@ -27,10 +26,20 @@ repos: args: [--markdown-linebreak-ext=md] - id: end-of-file-fixer + - repo: https://github.com/dbt-labs/pre-commit-hooks + rev: v0.1.0a1 + hooks: + - id: dbt-core-in-adapters-check + - repo: https://github.com/PyCQA/autoflake rev: v2.0.1 hooks: - id: autoflake + args: + - --in-place + - --recursive + - --remove-all-unused-imports + - --remove-unused-variables - repo: https://github.com/asottile/pyupgrade rev: v3.3.1 @@ -39,27 +48,28 @@ repos: args: - '--py37-plus' - - repo: https://github.com/pycqa/isort - rev: 5.12.0 - hooks: - - id: isort - name: isort - args: - - '.' - - repo: https://github.com/psf/black rev: 23.1.0 hooks: - id: black + args: + - --line-length=120 + - --target-version=py38 + - --target-version=py39 + - --target-version=py310 + - --target-version=py311 + # - --target-version=py312 - repo: https://github.com/pycqa/flake8 rev: 6.0.0 hooks: - id: flake8 - additional_dependencies: - - 'Flake8-pyproject~=1.1' args: - - '.' + - --max-line-length=120 + - --select=E,F,W + - --ignore=E203,E501,E741,W503,W504 + - --per-file-ignores=*/__init__.py:F401 + - repo: https://github.com/pre-commit/mirrors-mypy rev: v1.3.0 hooks: @@ -71,8 +81,12 @@ repos: - --allow-subclassing-any - --allow-untyped-decorators additional_dependencies: - - types-setuptools==67.8.0.0 - exclude: ^tests/ + - types-PyYAML + - types-protobuf + - types-pytz + - types-requests + - types-setuptools + exclude: /tests/ - repo: https://github.com/igorshubovych/markdownlint-cli rev: v0.37.0 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 466893b1..187e4f0f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,51 +2,125 @@ ## Requirements -* Python from 3.8 to 3.12 -* Virtual Environment or any other Python environment manager +* Python>=3.8 - [docs](https://www.python.org/) +* Hatch - [docs](https://hatch.pypa.io/dev/) ## Getting started -* Clone or fork the repo -* Run `make setup`, it will: - 1. Install all dependencies - 2. Install pre-commit hooks - 3. Generate your `.env` file +### Hatch -* Adjust `.env` file by configuring the environment variables to match your Athena development environment. +This repository uses `hatch` as its primary development tool. +`hatch` will store its virtual environments in its own user space unless you configure it. +We strongly recommend that you configure `hatch` to store its virtual environments in an explicit location. +This has two benefits: -## Running tests +* this path is predictable and easily discoverable, making it much easier to use with IDEs +* the default environment uses a hash for the name whereas the explicit environment will use +a predictable and human-readable name -We have 2 different types of testing: +For example, we configure `hatch` to store its virtual environments in the project itself (first option below). +This is akin to running `python -m venv venv` from the project root. +Many folks prefer to store virtual environments in a central location separate from the project (second option below). -* **unit testing**: you can run this type of tests running `make unit_test` -* **functional testing**: you must have an AWS account with Athena setup in order to launch this type of tests and have - a `.env` file in place with the right values. - You can run this type of tests running `make functional_test` +```toml +# MacOS : ~/Library/Application Support/hatch/config.toml +# Windows : %USERPROFILE%\AppData\Local\hatch\config.toml +# Unix : ~.config/hatch/config.toml -All type of tests can be run using `make`: +# this will create the virtual environment at `dbt-athena/dbt-athena/.hatch/dbt-athena +[dirs.env] +virtual = ".hatch" -```bash -make test +# this will create the virtual environment at `~/.hatch/dbt-athena` +[dirs.env] +virtual = "~/.hatch" ``` -### Pull Request +You can find the full docs [here](https://hatch.pypa.io/dev/config/hatch/) if you'd like to learn more about `hatch`. -* Create a commit with your changes and push them to a - [fork](https://docs.github.com/en/get-started/quickstart/fork-a-repo). - -* Create a [pull request on Github](https://docs.github.com/en/github/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork). -* Pull request title and message (and PR title and description) must adhere to - [conventional commits](https://www.conventionalcommits.org). -* Pull request body should describe _motivation_. +### Initial setup + +You will need to perform these steps the first time you contribute. +If you plan on contributing in the future (we would really appreciate that!), +most of this should persist and be reusable at that point in time. + + +* Fork the `dbt-athena` repo into your own user space on GitHub - [docs](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo) +* Install `hatch` on your local machine - [docs](https://hatch.pypa.io/dev/install/) +* Clone the fork to your local machine - [docs](https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository) +* Navigate to the `dbt-athena` package directory + * There are two packages in this repository. Don't worry about `dbt-athena-community`, + it will automatically remain in sync with `dbt-athena` +* Setup your development environment with `hatch run setup`: + 1. Create a `hatch` virtual environment + 2. Install all dependencies + 3. Install pre-commit hooks + 4. Create a `test.env` stub file (formerly `.env`) +* Adjust the `test.env` file by configuring the environment variables to match your Athena development environment + + +```shell +# install `hatch` +pip install hatch + +# clone your fork +git clone https://github.com//dbt-athena + +# navigate to the dbt-athena package +cd dbt-athena + +# setup your development environment (formerly `make setup`) +hatch run setup +``` + +## Running tests and checks + +There are many checks that are collectively referred to as Code Quality checks as well as 2 different types of testing: + +* **code quality checks**: these checks include static analysis, type checking, and other code quality assurances +* **unit testing**: these tests are fast tests that don't require a platform connection +* **integration testing**: these tests are more thorough and require an AWS account with an Athena instance configured + * Details of the Athena instance also need to be configured in your `test.env` file + +These tests and checks can be run as follows: + +```shell +# run all pre-commit checks +hatch run code-quality + +# run unit tests (formerly `make unit_test`) +hatch run unit-tests + +# run integration tests (formerly `make integration_test`) +hatch run integration-tests + +# run unit tests and integration tests, formerly `make test` +hatch run all-tests + +# run specific integration tests +hatch run integration-tests tests/functional/my/test_file.py +``` + +## Submitting a pull request + + +* Create a commit with your changes and push them back up to your fork (e.g. `https://github.com//dbt-athena`) +* Create a [pull request](https://github.com/dbt-labs/dbt-athena/compare) on GitHub - [docs](https://docs.github.com/en/github/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork) + * The pull request title and commit messages should adhere to [conventional commits](https://www.conventionalcommits.org) + * The pull request body should describe _motivation_ ### General Guidelines -* Keep your Pull Request small and focused on a single feature or bug fix. -* Make sure your code is well tested. -* Make sure your code is well documented. -* Provide a clear description of your Pull Request to allow the reviewer to understand the context of your changes. -* Consider the usage of draft Pull Request and switch to ready for review only when the CI pass or is ready for - feedback. -* Be sure to have pre-commit installed or run `make pre-commit` before pushing your changes. +* Keep your Pull Request small and focused on a single feature or bug fix +* Make sure your change is well tested + * Add new tests for completely new features or bug fixes + * Add scenarios to existing tests if extending a feature +* Make sure your change is well documented + * Mention when something is not obvious, or is being used for a specific purpose + * Provide a link to the GitHub bug in the docstring when writing a new test demonstrating the bug +* Provide a clear description in your pull request to allow the reviewer to understand the context of your changes + * Use a "self-review" to walk the reviewer through your thought process in a specific area + * Use a "self-review" to ask a question about how to handle a specific problem +* Use a draft pull request during development and mark it as Ready for Review when you're ready + * Ideally CI is also passing at this point, but you may also be looking for feedback on how to resolve an issue diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index 96f39441..00000000 --- a/MANIFEST.in +++ /dev/null @@ -1 +0,0 @@ -recursive-include dbt/include *.sql *.yml diff --git a/Makefile b/Makefile deleted file mode 100644 index e8eaaf67..00000000 --- a/Makefile +++ /dev/null @@ -1,41 +0,0 @@ -include .env -export - -CHANGED_FILES := $(shell git ls-files --modified --other --exclude-standard) -CHANGED_FILES_IN_BRANCH := $(shell git diff --name-only $(shell git merge-base origin/main HEAD)) - -.PHONY : install_deps setup pre-commit pre-commit-in-branch pre-commit-all test help - -install_deps: ## Install all dependencies. - pip install -r dev-requirements.txt - pip install -e . - -setup: ## Install all dependencies and setup pre-commit - make install_deps - pre-commit install - make .env - -.env: ## Generate .env file - @cp .env.example $@ - -test: ## Run tests. - make unit_test - make functional_test - -unit_test: ## Run unit tests. - pytest --cov=dbt --cov-report=html:htmlcov tests/unit - -functional_test: .env ## Run functional tests. - pytest -n auto tests/functional - -pre-commit: ## check modified and added files (compared to last commit!) with pre-commit. - pre-commit run --files $(CHANGED_FILES) - -pre-commit-in-branch: ## check changed since origin/main files with pre-commit. - pre-commit run --files $(CHANGED_FILES_IN_BRANCH) - -pre-commit-all: ## Check all files in working directory with pre-commit. - pre-commit run --all-files - -help: ## Show this help. - @egrep -h '\s##\s' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m %-30s\033[0m %s\n", $$1, $$2}' diff --git a/RELEASING.md b/RELEASING.md index 81e93309..6abd975f 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -1,11 +1,11 @@ -# How to make a release +# How to release -* open a Pull Request with a manual bump of in `main/dbt/adapters/athena/__version__.py` -* create a new release from - * be sure to use the same version as in the `__version__.py` file - * be sure to start the release with `v` e.g. v1.6.3 - * tag with the same name of the release e.g. v1.6.3 - * be sure to clean up release notes grouping by semantic commit type, +* Open a pull request with a manual bump on `dbt-athena/dbt/adapters/athena/__version__.py` +* Create a new release from + * Be sure to use the same version as in the `__version__.py` file + * Be sure to start the release with `v` e.g. v1.6.3 + * Tag with the same name of the release e.g. v1.6.3 + * Be sure to clean up release notes grouping by semantic commit type, e.g. all feat commits should under the same section -* Once the new release is made be sure that the new package version is available in PyPI - in [dbt-athena-community](https://pypi.org/project/dbt-athena-comunity/) +* Once the new release is made be sure that the new package version is available on PyPI + in [PyPI](https://pypi.org/project/dbt-athena/) diff --git a/dbt-athena-community/pyproject.toml b/dbt-athena-community/pyproject.toml new file mode 100644 index 00000000..edcead41 --- /dev/null +++ b/dbt-athena-community/pyproject.toml @@ -0,0 +1,104 @@ +[project] +name = "dbt-athena-community" +description = "The athena adapter plugin for dbt (data build tool)" +readme = "../README.md" +keywords = ["dbt", "adapter", "adapters", "database", "elt", "dbt-core", "dbt Core", "dbt Cloud", "dbt Labs", "athena"] +requires-python = ">=3.8.0" +authors = [ + { name = "dbt Labs", email = "info@dbtlabs.com" }, +] +maintainers = [ + { name = "dbt Labs", email = "info@dbtlabs.com" }, +] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "License :: OSI Approved :: Apache Software License", + "Operating System :: MacOS :: MacOS X", + "Operating System :: Microsoft :: Windows", + "Operating System :: POSIX :: Linux", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", +] +# these versions should always match and they both should match the local version of dbt-athena +dependencies = ["dbt-athena==1.8.5rc1"] +version = "1.8.5rc1" +[project.urls] +Homepage = "https://github.com/dbt-labs/dbt-athena/dbt-athena" +Documentation = "https://docs.getdbt.com" +Repository = "https://github.com/dbt-labs/dbt-athena.git#subdirectory=dbt-athena" +Issues = "https://github.com/dbt-labs/dbt-athena/issues" + +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[tool.hatch.build.targets.sdist] +include = ["src/dbt"] + +[tool.hatch.build.targets.wheel] +packages = ["src/dbt"] + +[tool.hatch.envs.default] +# the only build dependency is dbt-athena, which will never be published when running this +# because the versions need to be identical +detached = true +dependencies = [ + "dbt-athena @ {root:uri}/../dbt-athena", + "dbt-tests-adapter~=1.9.2", + "isort~=5.13", + "moto~=5.0.13", + "pre-commit~=3.5", + "pyparsing~=3.1.4", + "pytest~=8.3", + "pytest-cov~=5.0", + "pytest-dotenv~=0.5", + "pytest-xdist~=3.6", +] +[tool.hatch.envs.default.scripts] +setup = [ + "pre-commit install", + "cp -n ../dbt-athena/test.env.example test.env", +] +code-quality = "pre-commit run --all-files" +unit-tests = "pytest --cov=dbt --cov-report=html:htmlcov {args:../dbt-athena/tests/unit}" +integration-tests = "python -m pytest -n auto {args:../dbt-athena/tests/functional}" +all-tests = ["unit-tests", "integration-tests"] + +[tool.hatch.envs.build] +detached = true +dependencies = [ + "wheel", + "twine", + "check-wheel-contents", +] +[tool.hatch.envs.build.scripts] +check-all = [ + "- check-wheel", + "- check-sdist", +] +check-wheel = [ + "twine check dist/*", + "find ./dist/dbt_athena_community-*.whl -maxdepth 1 -type f | xargs python -m pip install --force-reinstall --find-links=dist/", + "pip freeze | grep dbt-athena-community", + "pip freeze | grep dbt-athena", +] +check-sdist = [ + "check-wheel-contents dist/*.whl --ignore W007,W008", + "find ./dist/dbt_athena_community-*.gz -maxdepth 1 -type f | xargs python -m pip install --force-reinstall --find-links=dist/", + "pip freeze | grep dbt-athena-community", + "pip freeze | grep dbt-athena", +] + +[tool.pytest] +env_files = ["../dbt-athena/test.env"] +testpaths = [ + "../dbt-athena/tests/unit", + "../dbt-athena/tests/functional", +] +filterwarnings = [ + "ignore:.*'soft_unicode' has been renamed to 'soft_str'*:DeprecationWarning", + "ignore:unclosed file .*:ResourceWarning", +] diff --git a/dbt-athena-community/src/dbt/adapters/athena_community/__init__.py b/dbt-athena-community/src/dbt/adapters/athena_community/__init__.py new file mode 100644 index 00000000..c10eb7e8 --- /dev/null +++ b/dbt-athena-community/src/dbt/adapters/athena_community/__init__.py @@ -0,0 +1 @@ +# this is a shell package that allows us to publish dbt-athena as dbt-athena-community diff --git a/dbt-athena/pyproject.toml b/dbt-athena/pyproject.toml new file mode 100644 index 00000000..9c1cd070 --- /dev/null +++ b/dbt-athena/pyproject.toml @@ -0,0 +1,110 @@ +[project] +dynamic = ["version"] +name = "dbt-athena" +description = "The athena adapter plugin for dbt (data build tool)" +readme = "../README.md" +keywords = ["dbt", "adapter", "adapters", "database", "elt", "dbt-core", "dbt Core", "dbt Cloud", "dbt Labs", "athena"] +requires-python = ">=3.8.0" +authors = [ + { name = "dbt Labs", email = "info@dbtlabs.com" }, +] +maintainers = [ + { name = "dbt Labs", email = "info@dbtlabs.com" }, +] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "License :: OSI Approved :: Apache Software License", + "Operating System :: MacOS :: MacOS X", + "Operating System :: Microsoft :: Windows", + "Operating System :: POSIX :: Linux", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", +] +dependencies=[ + "dbt-adapters>=1.0.0b2,<2.0", + "dbt-common>=1.0.0b2,<2.0", + # add dbt-core to ensure backwards compatibility of installation, this is not a functional dependency + "dbt-core>=1.8.0", + "boto3>=1.28", + "boto3-stubs[athena,glue,lakeformation,sts]>=1.28", + "mmh3>=4.0.1,<4.2.0", + "pyathena>=2.25,<4.0", + "pydantic>=1.10,<3.0", + "tenacity>=8.2,<10.0", +] +[project.urls] +Homepage = "https://github.com/dbt-labs/dbt-athena/dbt-athena" +Documentation = "https://docs.getdbt.com" +Repository = "https://github.com/dbt-labs/dbt-athena.git#subdirectory=dbt-athena" +Issues = "https://github.com/dbt-labs/dbt-athena/issues" + +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[tool.hatch.build.targets.sdist] +include = ["src/dbt"] + +[tool.hatch.build.targets.wheel] +packages = ["src/dbt"] + +[tool.hatch.version] +path = "src/dbt/adapters/athena/__version__.py" + +[tool.hatch.envs.default] +dependencies = [ + "dbt-tests-adapter~=1.9.2", + "moto~=5.0.13", + "pre-commit~=3.5", + "pyparsing~=3.1.4", + "pytest~=8.3", + "pytest-cov~=5.0", + "pytest-dotenv~=0.5", + "pytest-xdist~=3.6", +] +[tool.hatch.envs.default.scripts] +setup = [ + "pre-commit install", + "cp -n test.env.example test.env", +] +code-quality = "pre-commit run --all-files" +unit-tests = "pytest --cov=dbt --cov-report=html:htmlcov {args:tests/unit}" +integration-tests = "python -m pytest -n auto {args:tests/functional}" +all-tests = ["unit-tests", "integration-tests"] + +[tool.hatch.envs.build] +detached = true +dependencies = [ + "wheel", + "twine", + "check-wheel-contents", +] +[tool.hatch.envs.build.scripts] +check-all = [ + "- check-wheel", + "- check-sdist", +] +check-wheel = [ + "twine check dist/*", + "find ./dist/dbt_athena-*.whl -maxdepth 1 -type f | xargs python -m pip install --force-reinstall --find-links=dist/", + "pip freeze | grep dbt-athena", +] +check-sdist = [ + "check-wheel-contents dist/*.whl --ignore W007,W008", + "find ./dist/dbt_athena-*.gz -maxdepth 1 -type f | xargs python -m pip install --force-reinstall --find-links=dist/", + "pip freeze | grep dbt-athena", +] + +[tool.pytest] +env_files = ["test.env"] +testpaths = [ + "tests/unit", + "tests/functional", +] +filterwarnings = [ + "ignore:.*'soft_unicode' has been renamed to 'soft_str'*:DeprecationWarning", + "ignore:unclosed file .*:ResourceWarning", +] diff --git a/dbt/__init__.py b/dbt-athena/src/dbt/__init__.py similarity index 100% rename from dbt/__init__.py rename to dbt-athena/src/dbt/__init__.py diff --git a/dbt/adapters/athena/__init__.py b/dbt-athena/src/dbt/adapters/athena/__init__.py similarity index 100% rename from dbt/adapters/athena/__init__.py rename to dbt-athena/src/dbt/adapters/athena/__init__.py diff --git a/dbt-athena/src/dbt/adapters/athena/__version__.py b/dbt-athena/src/dbt/adapters/athena/__version__.py new file mode 100644 index 00000000..e7014098 --- /dev/null +++ b/dbt-athena/src/dbt/adapters/athena/__version__.py @@ -0,0 +1 @@ +version = "1.8.5rc1" diff --git a/dbt/adapters/athena/column.py b/dbt-athena/src/dbt/adapters/athena/column.py similarity index 100% rename from dbt/adapters/athena/column.py rename to dbt-athena/src/dbt/adapters/athena/column.py diff --git a/dbt/adapters/athena/config.py b/dbt-athena/src/dbt/adapters/athena/config.py similarity index 98% rename from dbt/adapters/athena/config.py rename to dbt-athena/src/dbt/adapters/athena/config.py index 52d9ed31..eacc10e0 100644 --- a/dbt/adapters/athena/config.py +++ b/dbt-athena/src/dbt/adapters/athena/config.py @@ -18,7 +18,7 @@ @lru_cache() def get_boto3_config(num_retries: int) -> config.Config: return config.Config( - user_agent_extra="dbt-athena-community/" + importlib.metadata.version("dbt-athena-community"), + user_agent_extra="dbt-athena/" + importlib.metadata.version("dbt-athena"), retries={"max_attempts": num_retries, "mode": "standard"}, ) diff --git a/dbt/adapters/athena/connections.py b/dbt-athena/src/dbt/adapters/athena/connections.py similarity index 100% rename from dbt/adapters/athena/connections.py rename to dbt-athena/src/dbt/adapters/athena/connections.py diff --git a/dbt/adapters/athena/constants.py b/dbt-athena/src/dbt/adapters/athena/constants.py similarity index 100% rename from dbt/adapters/athena/constants.py rename to dbt-athena/src/dbt/adapters/athena/constants.py diff --git a/dbt/adapters/athena/exceptions.py b/dbt-athena/src/dbt/adapters/athena/exceptions.py similarity index 100% rename from dbt/adapters/athena/exceptions.py rename to dbt-athena/src/dbt/adapters/athena/exceptions.py diff --git a/dbt/adapters/athena/impl.py b/dbt-athena/src/dbt/adapters/athena/impl.py similarity index 100% rename from dbt/adapters/athena/impl.py rename to dbt-athena/src/dbt/adapters/athena/impl.py diff --git a/dbt/adapters/athena/lakeformation.py b/dbt-athena/src/dbt/adapters/athena/lakeformation.py similarity index 100% rename from dbt/adapters/athena/lakeformation.py rename to dbt-athena/src/dbt/adapters/athena/lakeformation.py diff --git a/dbt/adapters/athena/python_submissions.py b/dbt-athena/src/dbt/adapters/athena/python_submissions.py similarity index 100% rename from dbt/adapters/athena/python_submissions.py rename to dbt-athena/src/dbt/adapters/athena/python_submissions.py diff --git a/dbt/adapters/athena/query_headers.py b/dbt-athena/src/dbt/adapters/athena/query_headers.py similarity index 100% rename from dbt/adapters/athena/query_headers.py rename to dbt-athena/src/dbt/adapters/athena/query_headers.py diff --git a/dbt/adapters/athena/relation.py b/dbt-athena/src/dbt/adapters/athena/relation.py similarity index 100% rename from dbt/adapters/athena/relation.py rename to dbt-athena/src/dbt/adapters/athena/relation.py diff --git a/dbt/adapters/athena/s3.py b/dbt-athena/src/dbt/adapters/athena/s3.py similarity index 100% rename from dbt/adapters/athena/s3.py rename to dbt-athena/src/dbt/adapters/athena/s3.py diff --git a/dbt/adapters/athena/session.py b/dbt-athena/src/dbt/adapters/athena/session.py similarity index 100% rename from dbt/adapters/athena/session.py rename to dbt-athena/src/dbt/adapters/athena/session.py diff --git a/dbt/adapters/athena/utils.py b/dbt-athena/src/dbt/adapters/athena/utils.py similarity index 100% rename from dbt/adapters/athena/utils.py rename to dbt-athena/src/dbt/adapters/athena/utils.py diff --git a/dbt/include/athena/__init__.py b/dbt-athena/src/dbt/include/athena/__init__.py similarity index 100% rename from dbt/include/athena/__init__.py rename to dbt-athena/src/dbt/include/athena/__init__.py diff --git a/dbt/include/athena/dbt_project.yml b/dbt-athena/src/dbt/include/athena/dbt_project.yml similarity index 100% rename from dbt/include/athena/dbt_project.yml rename to dbt-athena/src/dbt/include/athena/dbt_project.yml diff --git a/dbt/include/athena/macros/adapters/columns.sql b/dbt-athena/src/dbt/include/athena/macros/adapters/columns.sql similarity index 100% rename from dbt/include/athena/macros/adapters/columns.sql rename to dbt-athena/src/dbt/include/athena/macros/adapters/columns.sql diff --git a/dbt/include/athena/macros/adapters/metadata.sql b/dbt-athena/src/dbt/include/athena/macros/adapters/metadata.sql similarity index 100% rename from dbt/include/athena/macros/adapters/metadata.sql rename to dbt-athena/src/dbt/include/athena/macros/adapters/metadata.sql diff --git a/dbt/include/athena/macros/adapters/persist_docs.sql b/dbt-athena/src/dbt/include/athena/macros/adapters/persist_docs.sql similarity index 100% rename from dbt/include/athena/macros/adapters/persist_docs.sql rename to dbt-athena/src/dbt/include/athena/macros/adapters/persist_docs.sql diff --git a/dbt/include/athena/macros/adapters/python_submissions.sql b/dbt-athena/src/dbt/include/athena/macros/adapters/python_submissions.sql similarity index 100% rename from dbt/include/athena/macros/adapters/python_submissions.sql rename to dbt-athena/src/dbt/include/athena/macros/adapters/python_submissions.sql diff --git a/dbt/include/athena/macros/adapters/relation.sql b/dbt-athena/src/dbt/include/athena/macros/adapters/relation.sql similarity index 100% rename from dbt/include/athena/macros/adapters/relation.sql rename to dbt-athena/src/dbt/include/athena/macros/adapters/relation.sql diff --git a/dbt/include/athena/macros/adapters/schema.sql b/dbt-athena/src/dbt/include/athena/macros/adapters/schema.sql similarity index 100% rename from dbt/include/athena/macros/adapters/schema.sql rename to dbt-athena/src/dbt/include/athena/macros/adapters/schema.sql diff --git a/dbt/include/athena/macros/materializations/hooks.sql b/dbt-athena/src/dbt/include/athena/macros/materializations/hooks.sql similarity index 100% rename from dbt/include/athena/macros/materializations/hooks.sql rename to dbt-athena/src/dbt/include/athena/macros/materializations/hooks.sql diff --git a/dbt/include/athena/macros/materializations/models/helpers/get_partition_batches.sql b/dbt-athena/src/dbt/include/athena/macros/materializations/models/helpers/get_partition_batches.sql similarity index 100% rename from dbt/include/athena/macros/materializations/models/helpers/get_partition_batches.sql rename to dbt-athena/src/dbt/include/athena/macros/materializations/models/helpers/get_partition_batches.sql diff --git a/dbt/include/athena/macros/materializations/models/helpers/process_bucket_column.sql b/dbt-athena/src/dbt/include/athena/macros/materializations/models/helpers/process_bucket_column.sql similarity index 100% rename from dbt/include/athena/macros/materializations/models/helpers/process_bucket_column.sql rename to dbt-athena/src/dbt/include/athena/macros/materializations/models/helpers/process_bucket_column.sql diff --git a/dbt/include/athena/macros/materializations/models/incremental/column_helpers.sql b/dbt-athena/src/dbt/include/athena/macros/materializations/models/incremental/column_helpers.sql similarity index 100% rename from dbt/include/athena/macros/materializations/models/incremental/column_helpers.sql rename to dbt-athena/src/dbt/include/athena/macros/materializations/models/incremental/column_helpers.sql diff --git a/dbt/include/athena/macros/materializations/models/incremental/helpers.sql b/dbt-athena/src/dbt/include/athena/macros/materializations/models/incremental/helpers.sql similarity index 100% rename from dbt/include/athena/macros/materializations/models/incremental/helpers.sql rename to dbt-athena/src/dbt/include/athena/macros/materializations/models/incremental/helpers.sql diff --git a/dbt/include/athena/macros/materializations/models/incremental/incremental.sql b/dbt-athena/src/dbt/include/athena/macros/materializations/models/incremental/incremental.sql similarity index 100% rename from dbt/include/athena/macros/materializations/models/incremental/incremental.sql rename to dbt-athena/src/dbt/include/athena/macros/materializations/models/incremental/incremental.sql diff --git a/dbt/include/athena/macros/materializations/models/incremental/merge.sql b/dbt-athena/src/dbt/include/athena/macros/materializations/models/incremental/merge.sql similarity index 100% rename from dbt/include/athena/macros/materializations/models/incremental/merge.sql rename to dbt-athena/src/dbt/include/athena/macros/materializations/models/incremental/merge.sql diff --git a/dbt/include/athena/macros/materializations/models/incremental/on_schema_change.sql b/dbt-athena/src/dbt/include/athena/macros/materializations/models/incremental/on_schema_change.sql similarity index 100% rename from dbt/include/athena/macros/materializations/models/incremental/on_schema_change.sql rename to dbt-athena/src/dbt/include/athena/macros/materializations/models/incremental/on_schema_change.sql diff --git a/dbt/include/athena/macros/materializations/models/table/create_table_as.sql b/dbt-athena/src/dbt/include/athena/macros/materializations/models/table/create_table_as.sql similarity index 100% rename from dbt/include/athena/macros/materializations/models/table/create_table_as.sql rename to dbt-athena/src/dbt/include/athena/macros/materializations/models/table/create_table_as.sql diff --git a/dbt/include/athena/macros/materializations/models/table/table.sql b/dbt-athena/src/dbt/include/athena/macros/materializations/models/table/table.sql similarity index 100% rename from dbt/include/athena/macros/materializations/models/table/table.sql rename to dbt-athena/src/dbt/include/athena/macros/materializations/models/table/table.sql diff --git a/dbt/include/athena/macros/materializations/models/view/create_or_replace_view.sql b/dbt-athena/src/dbt/include/athena/macros/materializations/models/view/create_or_replace_view.sql similarity index 100% rename from dbt/include/athena/macros/materializations/models/view/create_or_replace_view.sql rename to dbt-athena/src/dbt/include/athena/macros/materializations/models/view/create_or_replace_view.sql diff --git a/dbt/include/athena/macros/materializations/models/view/create_view_as.sql b/dbt-athena/src/dbt/include/athena/macros/materializations/models/view/create_view_as.sql similarity index 100% rename from dbt/include/athena/macros/materializations/models/view/create_view_as.sql rename to dbt-athena/src/dbt/include/athena/macros/materializations/models/view/create_view_as.sql diff --git a/dbt/include/athena/macros/materializations/models/view/view.sql b/dbt-athena/src/dbt/include/athena/macros/materializations/models/view/view.sql similarity index 100% rename from dbt/include/athena/macros/materializations/models/view/view.sql rename to dbt-athena/src/dbt/include/athena/macros/materializations/models/view/view.sql diff --git a/dbt/include/athena/macros/materializations/seeds/helpers.sql b/dbt-athena/src/dbt/include/athena/macros/materializations/seeds/helpers.sql similarity index 100% rename from dbt/include/athena/macros/materializations/seeds/helpers.sql rename to dbt-athena/src/dbt/include/athena/macros/materializations/seeds/helpers.sql diff --git a/dbt/include/athena/macros/materializations/snapshots/snapshot.sql b/dbt-athena/src/dbt/include/athena/macros/materializations/snapshots/snapshot.sql similarity index 100% rename from dbt/include/athena/macros/materializations/snapshots/snapshot.sql rename to dbt-athena/src/dbt/include/athena/macros/materializations/snapshots/snapshot.sql diff --git a/dbt/include/athena/macros/utils/any_value.sql b/dbt-athena/src/dbt/include/athena/macros/utils/any_value.sql similarity index 100% rename from dbt/include/athena/macros/utils/any_value.sql rename to dbt-athena/src/dbt/include/athena/macros/utils/any_value.sql diff --git a/dbt/include/athena/macros/utils/array_append.sql b/dbt-athena/src/dbt/include/athena/macros/utils/array_append.sql similarity index 100% rename from dbt/include/athena/macros/utils/array_append.sql rename to dbt-athena/src/dbt/include/athena/macros/utils/array_append.sql diff --git a/dbt/include/athena/macros/utils/array_concat.sql b/dbt-athena/src/dbt/include/athena/macros/utils/array_concat.sql similarity index 100% rename from dbt/include/athena/macros/utils/array_concat.sql rename to dbt-athena/src/dbt/include/athena/macros/utils/array_concat.sql diff --git a/dbt/include/athena/macros/utils/array_construct.sql b/dbt-athena/src/dbt/include/athena/macros/utils/array_construct.sql similarity index 100% rename from dbt/include/athena/macros/utils/array_construct.sql rename to dbt-athena/src/dbt/include/athena/macros/utils/array_construct.sql diff --git a/dbt/include/athena/macros/utils/bool_or.sql b/dbt-athena/src/dbt/include/athena/macros/utils/bool_or.sql similarity index 100% rename from dbt/include/athena/macros/utils/bool_or.sql rename to dbt-athena/src/dbt/include/athena/macros/utils/bool_or.sql diff --git a/dbt/include/athena/macros/utils/datatypes.sql b/dbt-athena/src/dbt/include/athena/macros/utils/datatypes.sql similarity index 100% rename from dbt/include/athena/macros/utils/datatypes.sql rename to dbt-athena/src/dbt/include/athena/macros/utils/datatypes.sql diff --git a/dbt/include/athena/macros/utils/date_trunc.sql b/dbt-athena/src/dbt/include/athena/macros/utils/date_trunc.sql similarity index 100% rename from dbt/include/athena/macros/utils/date_trunc.sql rename to dbt-athena/src/dbt/include/athena/macros/utils/date_trunc.sql diff --git a/dbt/include/athena/macros/utils/dateadd.sql b/dbt-athena/src/dbt/include/athena/macros/utils/dateadd.sql similarity index 100% rename from dbt/include/athena/macros/utils/dateadd.sql rename to dbt-athena/src/dbt/include/athena/macros/utils/dateadd.sql diff --git a/dbt/include/athena/macros/utils/datediff.sql b/dbt-athena/src/dbt/include/athena/macros/utils/datediff.sql similarity index 100% rename from dbt/include/athena/macros/utils/datediff.sql rename to dbt-athena/src/dbt/include/athena/macros/utils/datediff.sql diff --git a/dbt/include/athena/macros/utils/ddl_dml_data_type.sql b/dbt-athena/src/dbt/include/athena/macros/utils/ddl_dml_data_type.sql similarity index 100% rename from dbt/include/athena/macros/utils/ddl_dml_data_type.sql rename to dbt-athena/src/dbt/include/athena/macros/utils/ddl_dml_data_type.sql diff --git a/dbt/include/athena/macros/utils/hash.sql b/dbt-athena/src/dbt/include/athena/macros/utils/hash.sql similarity index 100% rename from dbt/include/athena/macros/utils/hash.sql rename to dbt-athena/src/dbt/include/athena/macros/utils/hash.sql diff --git a/dbt/include/athena/macros/utils/listagg.sql b/dbt-athena/src/dbt/include/athena/macros/utils/listagg.sql similarity index 100% rename from dbt/include/athena/macros/utils/listagg.sql rename to dbt-athena/src/dbt/include/athena/macros/utils/listagg.sql diff --git a/dbt/include/athena/macros/utils/right.sql b/dbt-athena/src/dbt/include/athena/macros/utils/right.sql similarity index 100% rename from dbt/include/athena/macros/utils/right.sql rename to dbt-athena/src/dbt/include/athena/macros/utils/right.sql diff --git a/dbt/include/athena/macros/utils/safe_cast.sql b/dbt-athena/src/dbt/include/athena/macros/utils/safe_cast.sql similarity index 100% rename from dbt/include/athena/macros/utils/safe_cast.sql rename to dbt-athena/src/dbt/include/athena/macros/utils/safe_cast.sql diff --git a/dbt/include/athena/macros/utils/timestamps.sql b/dbt-athena/src/dbt/include/athena/macros/utils/timestamps.sql similarity index 100% rename from dbt/include/athena/macros/utils/timestamps.sql rename to dbt-athena/src/dbt/include/athena/macros/utils/timestamps.sql diff --git a/dbt/include/athena/profile_template.yml b/dbt-athena/src/dbt/include/athena/profile_template.yml similarity index 100% rename from dbt/include/athena/profile_template.yml rename to dbt-athena/src/dbt/include/athena/profile_template.yml diff --git a/dbt/include/athena/sample_profiles.yml b/dbt-athena/src/dbt/include/athena/sample_profiles.yml similarity index 100% rename from dbt/include/athena/sample_profiles.yml rename to dbt-athena/src/dbt/include/athena/sample_profiles.yml diff --git a/.env.example b/dbt-athena/test.env.example similarity index 100% rename from .env.example rename to dbt-athena/test.env.example diff --git a/tests/__init__.py b/dbt-athena/tests/__init__.py similarity index 100% rename from tests/__init__.py rename to dbt-athena/tests/__init__.py diff --git a/tests/conftest.py b/dbt-athena/tests/conftest.py similarity index 100% rename from tests/conftest.py rename to dbt-athena/tests/conftest.py diff --git a/tests/functional/adapter/fixture_datediff.py b/dbt-athena/tests/functional/adapter/fixture_datediff.py similarity index 100% rename from tests/functional/adapter/fixture_datediff.py rename to dbt-athena/tests/functional/adapter/fixture_datediff.py diff --git a/tests/functional/adapter/fixture_split_parts.py b/dbt-athena/tests/functional/adapter/fixture_split_parts.py similarity index 100% rename from tests/functional/adapter/fixture_split_parts.py rename to dbt-athena/tests/functional/adapter/fixture_split_parts.py diff --git a/tests/functional/adapter/test_basic_hive.py b/dbt-athena/tests/functional/adapter/test_basic_hive.py similarity index 100% rename from tests/functional/adapter/test_basic_hive.py rename to dbt-athena/tests/functional/adapter/test_basic_hive.py diff --git a/tests/functional/adapter/test_basic_hive_native_drop.py b/dbt-athena/tests/functional/adapter/test_basic_hive_native_drop.py similarity index 100% rename from tests/functional/adapter/test_basic_hive_native_drop.py rename to dbt-athena/tests/functional/adapter/test_basic_hive_native_drop.py diff --git a/tests/functional/adapter/test_basic_iceberg.py b/dbt-athena/tests/functional/adapter/test_basic_iceberg.py similarity index 100% rename from tests/functional/adapter/test_basic_iceberg.py rename to dbt-athena/tests/functional/adapter/test_basic_iceberg.py diff --git a/tests/functional/adapter/test_basic_iceberg_native_drop.py b/dbt-athena/tests/functional/adapter/test_basic_iceberg_native_drop.py similarity index 100% rename from tests/functional/adapter/test_basic_iceberg_native_drop.py rename to dbt-athena/tests/functional/adapter/test_basic_iceberg_native_drop.py diff --git a/tests/functional/adapter/test_change_relation_types.py b/dbt-athena/tests/functional/adapter/test_change_relation_types.py similarity index 100% rename from tests/functional/adapter/test_change_relation_types.py rename to dbt-athena/tests/functional/adapter/test_change_relation_types.py diff --git a/tests/functional/adapter/test_constraints.py b/dbt-athena/tests/functional/adapter/test_constraints.py similarity index 100% rename from tests/functional/adapter/test_constraints.py rename to dbt-athena/tests/functional/adapter/test_constraints.py diff --git a/tests/functional/adapter/test_detailed_table_type.py b/dbt-athena/tests/functional/adapter/test_detailed_table_type.py similarity index 100% rename from tests/functional/adapter/test_detailed_table_type.py rename to dbt-athena/tests/functional/adapter/test_detailed_table_type.py diff --git a/tests/functional/adapter/test_docs.py b/dbt-athena/tests/functional/adapter/test_docs.py similarity index 100% rename from tests/functional/adapter/test_docs.py rename to dbt-athena/tests/functional/adapter/test_docs.py diff --git a/tests/functional/adapter/test_empty.py b/dbt-athena/tests/functional/adapter/test_empty.py similarity index 100% rename from tests/functional/adapter/test_empty.py rename to dbt-athena/tests/functional/adapter/test_empty.py diff --git a/tests/functional/adapter/test_force_batch.py b/dbt-athena/tests/functional/adapter/test_force_batch.py similarity index 100% rename from tests/functional/adapter/test_force_batch.py rename to dbt-athena/tests/functional/adapter/test_force_batch.py diff --git a/tests/functional/adapter/test_ha_iceberg.py b/dbt-athena/tests/functional/adapter/test_ha_iceberg.py similarity index 100% rename from tests/functional/adapter/test_ha_iceberg.py rename to dbt-athena/tests/functional/adapter/test_ha_iceberg.py diff --git a/tests/functional/adapter/test_hive_iceberg.py b/dbt-athena/tests/functional/adapter/test_hive_iceberg.py similarity index 100% rename from tests/functional/adapter/test_hive_iceberg.py rename to dbt-athena/tests/functional/adapter/test_hive_iceberg.py diff --git a/tests/functional/adapter/test_incremental_iceberg.py b/dbt-athena/tests/functional/adapter/test_incremental_iceberg.py similarity index 100% rename from tests/functional/adapter/test_incremental_iceberg.py rename to dbt-athena/tests/functional/adapter/test_incremental_iceberg.py diff --git a/tests/functional/adapter/test_incremental_iceberg_merge_no_updates.py b/dbt-athena/tests/functional/adapter/test_incremental_iceberg_merge_no_updates.py similarity index 100% rename from tests/functional/adapter/test_incremental_iceberg_merge_no_updates.py rename to dbt-athena/tests/functional/adapter/test_incremental_iceberg_merge_no_updates.py diff --git a/tests/functional/adapter/test_incremental_tmp_schema.py b/dbt-athena/tests/functional/adapter/test_incremental_tmp_schema.py similarity index 100% rename from tests/functional/adapter/test_incremental_tmp_schema.py rename to dbt-athena/tests/functional/adapter/test_incremental_tmp_schema.py diff --git a/tests/functional/adapter/test_on_schema_change.py b/dbt-athena/tests/functional/adapter/test_on_schema_change.py similarity index 100% rename from tests/functional/adapter/test_on_schema_change.py rename to dbt-athena/tests/functional/adapter/test_on_schema_change.py diff --git a/tests/functional/adapter/test_partitions.py b/dbt-athena/tests/functional/adapter/test_partitions.py similarity index 100% rename from tests/functional/adapter/test_partitions.py rename to dbt-athena/tests/functional/adapter/test_partitions.py diff --git a/tests/functional/adapter/test_python_submissions.py b/dbt-athena/tests/functional/adapter/test_python_submissions.py similarity index 100% rename from tests/functional/adapter/test_python_submissions.py rename to dbt-athena/tests/functional/adapter/test_python_submissions.py diff --git a/tests/functional/adapter/test_quote_seed_column.py b/dbt-athena/tests/functional/adapter/test_quote_seed_column.py similarity index 100% rename from tests/functional/adapter/test_quote_seed_column.py rename to dbt-athena/tests/functional/adapter/test_quote_seed_column.py diff --git a/tests/functional/adapter/test_retries_iceberg.py b/dbt-athena/tests/functional/adapter/test_retries_iceberg.py similarity index 100% rename from tests/functional/adapter/test_retries_iceberg.py rename to dbt-athena/tests/functional/adapter/test_retries_iceberg.py diff --git a/tests/functional/adapter/test_seed_by_insert.py b/dbt-athena/tests/functional/adapter/test_seed_by_insert.py similarity index 100% rename from tests/functional/adapter/test_seed_by_insert.py rename to dbt-athena/tests/functional/adapter/test_seed_by_insert.py diff --git a/tests/functional/adapter/test_snapshot.py b/dbt-athena/tests/functional/adapter/test_snapshot.py similarity index 100% rename from tests/functional/adapter/test_snapshot.py rename to dbt-athena/tests/functional/adapter/test_snapshot.py diff --git a/tests/functional/adapter/test_unique_tmp_table_suffix.py b/dbt-athena/tests/functional/adapter/test_unique_tmp_table_suffix.py similarity index 100% rename from tests/functional/adapter/test_unique_tmp_table_suffix.py rename to dbt-athena/tests/functional/adapter/test_unique_tmp_table_suffix.py diff --git a/tests/functional/adapter/test_unit_testing.py b/dbt-athena/tests/functional/adapter/test_unit_testing.py similarity index 100% rename from tests/functional/adapter/test_unit_testing.py rename to dbt-athena/tests/functional/adapter/test_unit_testing.py diff --git a/tests/functional/adapter/utils/parse_dbt_run_output.py b/dbt-athena/tests/functional/adapter/utils/parse_dbt_run_output.py similarity index 100% rename from tests/functional/adapter/utils/parse_dbt_run_output.py rename to dbt-athena/tests/functional/adapter/utils/parse_dbt_run_output.py diff --git a/tests/functional/adapter/utils/test_utils.py b/dbt-athena/tests/functional/adapter/utils/test_utils.py similarity index 100% rename from tests/functional/adapter/utils/test_utils.py rename to dbt-athena/tests/functional/adapter/utils/test_utils.py diff --git a/tests/unit/__init__.py b/dbt-athena/tests/unit/__init__.py similarity index 100% rename from tests/unit/__init__.py rename to dbt-athena/tests/unit/__init__.py diff --git a/tests/unit/conftest.py b/dbt-athena/tests/unit/conftest.py similarity index 100% rename from tests/unit/conftest.py rename to dbt-athena/tests/unit/conftest.py diff --git a/tests/unit/constants.py b/dbt-athena/tests/unit/constants.py similarity index 100% rename from tests/unit/constants.py rename to dbt-athena/tests/unit/constants.py diff --git a/tests/unit/fixtures.py b/dbt-athena/tests/unit/fixtures.py similarity index 100% rename from tests/unit/fixtures.py rename to dbt-athena/tests/unit/fixtures.py diff --git a/tests/unit/test_adapter.py b/dbt-athena/tests/unit/test_adapter.py similarity index 100% rename from tests/unit/test_adapter.py rename to dbt-athena/tests/unit/test_adapter.py diff --git a/tests/unit/test_column.py b/dbt-athena/tests/unit/test_column.py similarity index 100% rename from tests/unit/test_column.py rename to dbt-athena/tests/unit/test_column.py diff --git a/tests/unit/test_config.py b/dbt-athena/tests/unit/test_config.py similarity index 99% rename from tests/unit/test_config.py rename to dbt-athena/tests/unit/test_config.py index 1e66b906..55a3672e 100644 --- a/tests/unit/test_config.py +++ b/dbt-athena/tests/unit/test_config.py @@ -12,7 +12,7 @@ def test_get_boto3_config(self): num_boto3_retries = 5 get_boto3_config.cache_clear() config = get_boto3_config(num_retries=num_boto3_retries) - assert config._user_provided_options["user_agent_extra"] == "dbt-athena-community/2.4.6" + assert config._user_provided_options["user_agent_extra"] == "dbt-athena/2.4.6" assert config.retries == {"max_attempts": num_boto3_retries, "mode": "standard"} diff --git a/tests/unit/test_connection_manager.py b/dbt-athena/tests/unit/test_connection_manager.py similarity index 100% rename from tests/unit/test_connection_manager.py rename to dbt-athena/tests/unit/test_connection_manager.py diff --git a/tests/unit/test_formatter.py b/dbt-athena/tests/unit/test_formatter.py similarity index 100% rename from tests/unit/test_formatter.py rename to dbt-athena/tests/unit/test_formatter.py diff --git a/tests/unit/test_lakeformation.py b/dbt-athena/tests/unit/test_lakeformation.py similarity index 100% rename from tests/unit/test_lakeformation.py rename to dbt-athena/tests/unit/test_lakeformation.py diff --git a/tests/unit/test_python_submissions.py b/dbt-athena/tests/unit/test_python_submissions.py similarity index 100% rename from tests/unit/test_python_submissions.py rename to dbt-athena/tests/unit/test_python_submissions.py diff --git a/tests/unit/test_query_headers.py b/dbt-athena/tests/unit/test_query_headers.py similarity index 100% rename from tests/unit/test_query_headers.py rename to dbt-athena/tests/unit/test_query_headers.py diff --git a/tests/unit/test_relation.py b/dbt-athena/tests/unit/test_relation.py similarity index 100% rename from tests/unit/test_relation.py rename to dbt-athena/tests/unit/test_relation.py diff --git a/tests/unit/test_session.py b/dbt-athena/tests/unit/test_session.py similarity index 100% rename from tests/unit/test_session.py rename to dbt-athena/tests/unit/test_session.py diff --git a/tests/unit/test_utils.py b/dbt-athena/tests/unit/test_utils.py similarity index 100% rename from tests/unit/test_utils.py rename to dbt-athena/tests/unit/test_utils.py diff --git a/tests/unit/utils.py b/dbt-athena/tests/unit/utils.py similarity index 100% rename from tests/unit/utils.py rename to dbt-athena/tests/unit/utils.py diff --git a/dbt/adapters/athena/__version__.py b/dbt/adapters/athena/__version__.py deleted file mode 100644 index f2493fc9..00000000 --- a/dbt/adapters/athena/__version__.py +++ /dev/null @@ -1 +0,0 @@ -version = "1.8.4" diff --git a/dev-requirements.txt b/dev-requirements.txt deleted file mode 100644 index 7bc1e370..00000000 --- a/dev-requirements.txt +++ /dev/null @@ -1,15 +0,0 @@ -autoflake~=2.3 -black~=24.8 -boto3-stubs[s3]~=1.35 -dbt-tests-adapter~=1.9.2 -flake8~=7.1 -Flake8-pyproject~=1.2 -isort~=5.13 -moto~=5.0.13 -pre-commit~=3.5 -pyparsing~=3.1.4 -pytest~=8.3 -pytest-cov~=5.0 -pytest-dotenv~=0.5 -pytest-xdist~=3.6 -pyupgrade~=3.16 diff --git a/pyproject.toml b/pyproject.toml deleted file mode 100644 index abc847a5..00000000 --- a/pyproject.toml +++ /dev/null @@ -1,35 +0,0 @@ -[tool.autoflake] -recursive = true -in-place = true -remove-all-unused-imports = true -remove-unused-variables = true - -[tool.black] -line-length = 120 -target-version = ['py37', 'py38', 'py39', 'py310'] -include = '\.pyi?$' - -[tool.flake8] -files = '.*\.py' -max-line-length = 120 -exclude = ['.git', '.eggs', '__pycache__', 'venv', '.venv'] -ignore = [ - # space before : (needed for how black formats slicing) - 'E203', - # line break before binary operator (needed for how black formats long lines) - 'W503' -] -# Error codes to ignore, per file level module imported but unused -per-file-ignores = """ - */__init__.py:F401 -""" - -[tool.isort] -profile = 'black' -src_paths = ['dbt', 'test'] - -[tool.pytest.ini_options] -testpaths = [ - "tests/unit", - "tests/functional", -] diff --git a/pytest.ini b/pytest.ini deleted file mode 100644 index 7dd1048c..00000000 --- a/pytest.ini +++ /dev/null @@ -1,8 +0,0 @@ -[pytest] -filterwarnings = - ignore:.*'soft_unicode' has been renamed to 'soft_str'*:DeprecationWarning - ignore:unclosed file .*:ResourceWarning -env_files = - .env -testpaths = - tests/functional diff --git a/setup.py b/setup.py deleted file mode 100644 index 4455a1c1..00000000 --- a/setup.py +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/env python -import os -from pathlib import Path -from typing import Dict - -from setuptools import find_namespace_packages, setup - -this_directory = os.path.abspath(os.path.dirname(__file__)) - -with open(os.path.join(this_directory, "README.md"), encoding="utf-8") as f: - long_description = f.read() - -package_name = "dbt-athena-community" - -# used for this adapter's version -VERSION = Path(__file__).parent / "dbt/adapters/athena/__version__.py" - - -def _get_package_version() -> str: - attributes: Dict[str, str] = {} - exec(VERSION.read_text(), attributes) - return attributes["version"] - - -description = "The athena adapter plugin for dbt (data build tool)" - -setup( - name=package_name, - version=_get_package_version(), - description=description, - long_description=long_description, - long_description_content_type="text/markdown", - platforms="any", - license="Apache License 2.0", - license_files=("LICENSE.txt",), - url="https://github.com/dbt-athena/dbt-athena", - packages=find_namespace_packages(include=["dbt", "dbt.*"]), - include_package_data=True, - install_requires=[ - "dbt-common>=1.0.0b2,<2.0", - "dbt-adapters>=1.0.0b2,<2.0", - # add dbt-core to ensure backwards compatibility of installation, this is not a functional dependency - "dbt-core>=1.8.0", - "boto3>=1.28", - "boto3-stubs[athena,glue,lakeformation,sts]>=1.28", - "pyathena>=2.25,<4.0", - "mmh3>=4.0.1,<4.2.0", - "pydantic>=1.10,<3.0", - "tenacity>=8.2,<10.0", - ], - 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.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", - ], - python_requires=">=3.8,<3.13", -)