From 4f8bc3e63361d75dae24908de9cb59cba6772f5b Mon Sep 17 00:00:00 2001 From: Ivan Trusov Date: Tue, 2 Jul 2024 18:24:44 +0200 Subject: [PATCH] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20upgrade=20dependencies=20(?= =?UTF-8?q?#863)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * update deps * fix deps * change hash computation * update deps * bump deps * fix CI * update license * fix CI * fix contrib * update versions & fix tests * remove _version * fix prospector * fix py version * fix pylint * minor CI fixes * exclude version from black * update codecov * add reference to codecov secret --- .github/workflows/onpush.yml | 32 +++--- .github/workflows/onrelease.yml | 20 ++-- .gitignore | 1 + LICENSE | 100 +++++++++++------ Makefile | 67 +++-------- contrib/CONTRIBUTING.md | 2 +- dbx/__init__.py | 1 - prospector.yaml | 3 +- pyproject.toml | 106 ++++++++++++++++-- setup.py | 92 --------------- {dbx/api => src/dbx}/__init__.py | 0 {dbx => src/dbx}/__main__.py | 0 {dbx/api/adjuster => src/dbx/api}/__init__.py | 0 {dbx => src/dbx}/api/_module_loader.py | 0 .../dbx/api/adjuster}/__init__.py | 0 {dbx => src/dbx}/api/adjuster/adjuster.py | 0 .../dbx/api/adjuster/mixins}/__init__.py | 0 {dbx => src/dbx}/api/adjuster/mixins/base.py | 0 .../api/adjuster/mixins/existing_cluster.py | 0 .../api/adjuster/mixins/file_reference.py | 0 .../dbx}/api/adjuster/mixins/instance_pool.py | 0 .../api/adjuster/mixins/instance_profile.py | 0 .../dbx}/api/adjuster/mixins/pipeline.py | 0 .../api/adjuster/mixins/service_principal.py | 0 .../api/adjuster/mixins/sql_properties.py | 0 {dbx => src/dbx}/api/adjuster/policy.py | 0 {dbx => src/dbx}/api/auth.py | 0 {dbx => src/dbx}/api/build.py | 0 {dbx => src/dbx}/api/client_provider.py | 0 {dbx => src/dbx}/api/cluster.py | 0 {dbx => src/dbx}/api/config_reader.py | 0 {dbx => src/dbx}/api/configure.py | 0 {dbx => src/dbx}/api/context.py | 0 .../dbx/api/dependency}/__init__.py | 0 .../dbx}/api/dependency/core_package.py | 0 .../dbx}/api/dependency/requirements.py | 0 {dbx => src/dbx}/api/deployment.py | 0 {dbx => src/dbx}/api/destroyer.py | 0 {dbx => src/dbx}/api/execute.py | 0 {dbx => src/dbx}/api/jinja.py | 0 .../dbx/api/launch}/__init__.py | 0 {dbx => src/dbx}/api/launch/contexts.py | 0 {dbx => src/dbx}/api/launch/functions.py | 0 .../dbx}/api/launch/pipeline_models.py | 0 {dbx => src/dbx}/api/launch/processors.py | 0 .../dbx/api/launch/runners}/__init__.py | 0 .../dbx}/api/launch/runners/asset_based.py | 0 {dbx => src/dbx}/api/launch/runners/base.py | 0 .../dbx}/api/launch/runners/pipeline.py | 0 .../dbx}/api/launch/runners/standard.py | 0 {dbx => src/dbx}/api/launch/tracer.py | 0 {dbx => src/dbx}/api/output_provider.py | 0 .../dbx/api/services}/__init__.py | 0 {dbx => src/dbx}/api/services/_base.py | 0 {dbx => src/dbx}/api/services/jobs.py | 0 {dbx => src/dbx}/api/services/permissions.py | 0 {dbx => src/dbx}/api/services/pipelines.py | 0 .../dbx/api/storage}/__init__.py | 0 {dbx => src/dbx}/api/storage/io.py | 0 {dbx => src/dbx}/api/storage/mlflow_based.py | 0 {dbx => src/dbx}/callbacks.py | 2 +- {dbx => src/dbx}/cli.py | 0 .../sync => src/dbx/commands}/__init__.py | 0 {dbx => src/dbx}/commands/configure.py | 0 {dbx => src/dbx}/commands/deploy.py | 0 {dbx => src/dbx}/commands/destroy.py | 0 {dbx => src/dbx}/commands/execute.py | 0 {dbx => src/dbx}/commands/init.py | 1 + {dbx => src/dbx}/commands/launch.py | 0 .../dbx/commands/sync}/__init__.py | 0 {dbx => src/dbx}/commands/sync/functions.py | 0 {dbx => src/dbx}/commands/sync/options.py | 0 {dbx => src/dbx}/commands/sync/sync.py | 0 {dbx => src/dbx}/commands/version.py | 0 {dbx => src/dbx}/constants.py | 0 {dbx => src/dbx}/custom.py | 0 .../models/cli => src/dbx/models}/__init__.py | 0 {dbx => src/dbx}/models/build.py | 0 .../files => src/dbx/models/cli}/__init__.py | 0 {dbx => src/dbx}/models/cli/destroyer.py | 0 {dbx => src/dbx}/models/cli/execute.py | 0 {dbx => src/dbx}/models/cli/options.py | 0 {dbx => src/dbx}/models/deployment.py | 0 .../dbx/models/files}/__init__.py | 0 {dbx => src/dbx}/models/files/context.py | 0 {dbx => src/dbx}/models/files/project.py | 0 {dbx => src/dbx}/models/validators.py | 0 .../dbx/models/workflow}/__init__.py | 0 .../dbx/models/workflow/common}/__init__.py | 0 .../models/workflow/common/access_control.py | 0 .../workflow/common/deployment_config.py | 0 .../dbx}/models/workflow/common/flexible.py | 0 .../common/job_email_notifications.py | 0 .../dbx}/models/workflow/common/libraries.py | 0 .../models/workflow/common/new_cluster.py | 0 .../dbx}/models/workflow/common/parameters.py | 0 .../dbx}/models/workflow/common/pipeline.py | 0 .../dbx}/models/workflow/common/task.py | 0 .../dbx}/models/workflow/common/task_type.py | 0 .../dbx}/models/workflow/common/workflow.py | 0 .../models/workflow/common/workflow_types.py | 0 .../dbx/models/workflow/v2dot0}/__init__.py | 0 .../dbx}/models/workflow/v2dot0/parameters.py | 0 .../dbx}/models/workflow/v2dot0/task.py | 0 .../dbx}/models/workflow/v2dot0/workflow.py | 0 .../dbx/models/workflow/v2dot1}/__init__.py | 0 .../models/workflow/v2dot1/_parameters.py | 0 .../models/workflow/v2dot1/job_cluster.py | 0 .../workflow/v2dot1/job_task_settings.py | 0 .../dbx}/models/workflow/v2dot1/parameters.py | 0 .../dbx}/models/workflow/v2dot1/task.py | 0 .../dbx}/models/workflow/v2dot1/workflow.py | 0 {dbx => src/dbx}/options.py | 0 {dbx => src/dbx}/sync/__init__.py | 2 +- {dbx => src/dbx}/sync/clients.py | 0 {dbx => src/dbx}/sync/config.py | 0 {dbx => src/dbx}/sync/constants.py | 0 {dbx => src/dbx}/sync/event_handler.py | 0 {dbx => src/dbx}/sync/path_matcher.py | 0 {dbx => src/dbx}/sync/snapshot.py | 0 .../components/.github/workflows/onpush.yml | 0 .../.github/workflows/onrelease.yml | 0 .../python_basic/components/.gitlab-ci.yml | 0 .../components/azure-pipelines.yml | 0 .../components/conf/deployment.yml | 0 .../python_basic/render/cookiecutter.json | 0 .../render/hooks/post_gen_project.py | 0 .../{{cookiecutter.project_name}}/.gitignore | 0 .../{{cookiecutter.project_name}}/README.md | 0 .../conf/tasks/sample_etl_config.yml | 0 .../conf/tasks/sample_ml_config.yml | 0 .../notebooks/sample_notebook.py | 0 .../pyproject.toml | 0 .../{{cookiecutter.project_name}}/setup.py | 0 .../tests/entrypoint.py | 0 .../tests/integration/e2e_test.py | 0 .../tests/unit/conftest.py | 0 .../tests/unit/sample_test.py | 0 .../{{cookiecutter.project_slug}}/__init__.py | 0 .../{{cookiecutter.project_slug}}/common.py | 0 .../tasks/__init__.py | 0 .../tasks/sample_etl_task.py | 0 .../tasks/sample_ml_task.py | 0 {dbx => src/dbx}/types.py | 0 {dbx => src/dbx}/utils/__init__.py | 0 {dbx => src/dbx}/utils/common.py | 0 {dbx => src/dbx}/utils/file_uploader.py | 0 {dbx => src/dbx}/utils/json.py | 0 {dbx => src/dbx}/utils/url.py | 0 tests/unit/conftest.py | 9 +- 150 files changed, 217 insertions(+), 221 deletions(-) delete mode 100644 dbx/__init__.py delete mode 100644 setup.py rename {dbx/api => src/dbx}/__init__.py (100%) rename {dbx => src/dbx}/__main__.py (100%) rename {dbx/api/adjuster => src/dbx/api}/__init__.py (100%) rename {dbx => src/dbx}/api/_module_loader.py (100%) rename {dbx/api/adjuster/mixins => src/dbx/api/adjuster}/__init__.py (100%) rename {dbx => src/dbx}/api/adjuster/adjuster.py (100%) rename {dbx/api/dependency => src/dbx/api/adjuster/mixins}/__init__.py (100%) rename {dbx => src/dbx}/api/adjuster/mixins/base.py (100%) rename {dbx => src/dbx}/api/adjuster/mixins/existing_cluster.py (100%) rename {dbx => src/dbx}/api/adjuster/mixins/file_reference.py (100%) rename {dbx => src/dbx}/api/adjuster/mixins/instance_pool.py (100%) rename {dbx => src/dbx}/api/adjuster/mixins/instance_profile.py (100%) rename {dbx => src/dbx}/api/adjuster/mixins/pipeline.py (100%) rename {dbx => src/dbx}/api/adjuster/mixins/service_principal.py (100%) rename {dbx => src/dbx}/api/adjuster/mixins/sql_properties.py (100%) rename {dbx => src/dbx}/api/adjuster/policy.py (100%) rename {dbx => src/dbx}/api/auth.py (100%) rename {dbx => src/dbx}/api/build.py (100%) rename {dbx => src/dbx}/api/client_provider.py (100%) rename {dbx => src/dbx}/api/cluster.py (100%) rename {dbx => src/dbx}/api/config_reader.py (100%) rename {dbx => src/dbx}/api/configure.py (100%) rename {dbx => src/dbx}/api/context.py (100%) rename {dbx/api/launch => src/dbx/api/dependency}/__init__.py (100%) rename {dbx => src/dbx}/api/dependency/core_package.py (100%) rename {dbx => src/dbx}/api/dependency/requirements.py (100%) rename {dbx => src/dbx}/api/deployment.py (100%) rename {dbx => src/dbx}/api/destroyer.py (100%) rename {dbx => src/dbx}/api/execute.py (100%) rename {dbx => src/dbx}/api/jinja.py (100%) rename {dbx/api/launch/runners => src/dbx/api/launch}/__init__.py (100%) rename {dbx => src/dbx}/api/launch/contexts.py (100%) rename {dbx => src/dbx}/api/launch/functions.py (100%) rename {dbx => src/dbx}/api/launch/pipeline_models.py (100%) rename {dbx => src/dbx}/api/launch/processors.py (100%) rename {dbx/api/services => src/dbx/api/launch/runners}/__init__.py (100%) rename {dbx => src/dbx}/api/launch/runners/asset_based.py (100%) rename {dbx => src/dbx}/api/launch/runners/base.py (100%) rename {dbx => src/dbx}/api/launch/runners/pipeline.py (100%) rename {dbx => src/dbx}/api/launch/runners/standard.py (100%) rename {dbx => src/dbx}/api/launch/tracer.py (100%) rename {dbx => src/dbx}/api/output_provider.py (100%) rename {dbx/api/storage => src/dbx/api/services}/__init__.py (100%) rename {dbx => src/dbx}/api/services/_base.py (100%) rename {dbx => src/dbx}/api/services/jobs.py (100%) rename {dbx => src/dbx}/api/services/permissions.py (100%) rename {dbx => src/dbx}/api/services/pipelines.py (100%) rename {dbx/commands => src/dbx/api/storage}/__init__.py (100%) rename {dbx => src/dbx}/api/storage/io.py (100%) rename {dbx => src/dbx}/api/storage/mlflow_based.py (100%) rename {dbx => src/dbx}/callbacks.py (98%) rename {dbx => src/dbx}/cli.py (100%) rename {dbx/commands/sync => src/dbx/commands}/__init__.py (100%) rename {dbx => src/dbx}/commands/configure.py (100%) rename {dbx => src/dbx}/commands/deploy.py (100%) rename {dbx => src/dbx}/commands/destroy.py (100%) rename {dbx => src/dbx}/commands/execute.py (100%) rename {dbx => src/dbx}/commands/init.py (99%) rename {dbx => src/dbx}/commands/launch.py (100%) rename {dbx/models => src/dbx/commands/sync}/__init__.py (100%) rename {dbx => src/dbx}/commands/sync/functions.py (100%) rename {dbx => src/dbx}/commands/sync/options.py (100%) rename {dbx => src/dbx}/commands/sync/sync.py (100%) rename {dbx => src/dbx}/commands/version.py (100%) rename {dbx => src/dbx}/constants.py (100%) rename {dbx => src/dbx}/custom.py (100%) rename {dbx/models/cli => src/dbx/models}/__init__.py (100%) rename {dbx => src/dbx}/models/build.py (100%) rename {dbx/models/files => src/dbx/models/cli}/__init__.py (100%) rename {dbx => src/dbx}/models/cli/destroyer.py (100%) rename {dbx => src/dbx}/models/cli/execute.py (100%) rename {dbx => src/dbx}/models/cli/options.py (100%) rename {dbx => src/dbx}/models/deployment.py (100%) rename {dbx/models/workflow => src/dbx/models/files}/__init__.py (100%) rename {dbx => src/dbx}/models/files/context.py (100%) rename {dbx => src/dbx}/models/files/project.py (100%) rename {dbx => src/dbx}/models/validators.py (100%) rename {dbx/models/workflow/common => src/dbx/models/workflow}/__init__.py (100%) rename {dbx/models/workflow/v2dot0 => src/dbx/models/workflow/common}/__init__.py (100%) rename {dbx => src/dbx}/models/workflow/common/access_control.py (100%) rename {dbx => src/dbx}/models/workflow/common/deployment_config.py (100%) rename {dbx => src/dbx}/models/workflow/common/flexible.py (100%) rename {dbx => src/dbx}/models/workflow/common/job_email_notifications.py (100%) rename {dbx => src/dbx}/models/workflow/common/libraries.py (100%) rename {dbx => src/dbx}/models/workflow/common/new_cluster.py (100%) rename {dbx => src/dbx}/models/workflow/common/parameters.py (100%) rename {dbx => src/dbx}/models/workflow/common/pipeline.py (100%) rename {dbx => src/dbx}/models/workflow/common/task.py (100%) rename {dbx => src/dbx}/models/workflow/common/task_type.py (100%) rename {dbx => src/dbx}/models/workflow/common/workflow.py (100%) rename {dbx => src/dbx}/models/workflow/common/workflow_types.py (100%) rename {dbx/models/workflow/v2dot1 => src/dbx/models/workflow/v2dot0}/__init__.py (100%) rename {dbx => src/dbx}/models/workflow/v2dot0/parameters.py (100%) rename {dbx => src/dbx}/models/workflow/v2dot0/task.py (100%) rename {dbx => src/dbx}/models/workflow/v2dot0/workflow.py (100%) rename {dbx/templates/projects/python_basic/render/{{cookiecutter.project_name}}/{{cookiecutter.project_slug}}/tasks => src/dbx/models/workflow/v2dot1}/__init__.py (100%) rename {dbx => src/dbx}/models/workflow/v2dot1/_parameters.py (100%) rename {dbx => src/dbx}/models/workflow/v2dot1/job_cluster.py (100%) rename {dbx => src/dbx}/models/workflow/v2dot1/job_task_settings.py (100%) rename {dbx => src/dbx}/models/workflow/v2dot1/parameters.py (100%) rename {dbx => src/dbx}/models/workflow/v2dot1/task.py (100%) rename {dbx => src/dbx}/models/workflow/v2dot1/workflow.py (100%) rename {dbx => src/dbx}/options.py (100%) rename {dbx => src/dbx}/sync/__init__.py (99%) rename {dbx => src/dbx}/sync/clients.py (100%) rename {dbx => src/dbx}/sync/config.py (100%) rename {dbx => src/dbx}/sync/constants.py (100%) rename {dbx => src/dbx}/sync/event_handler.py (100%) rename {dbx => src/dbx}/sync/path_matcher.py (100%) rename {dbx => src/dbx}/sync/snapshot.py (100%) rename {dbx => src/dbx}/templates/projects/python_basic/components/.github/workflows/onpush.yml (100%) rename {dbx => src/dbx}/templates/projects/python_basic/components/.github/workflows/onrelease.yml (100%) rename {dbx => src/dbx}/templates/projects/python_basic/components/.gitlab-ci.yml (100%) rename {dbx => src/dbx}/templates/projects/python_basic/components/azure-pipelines.yml (100%) rename {dbx => src/dbx}/templates/projects/python_basic/components/conf/deployment.yml (100%) rename {dbx => src/dbx}/templates/projects/python_basic/render/cookiecutter.json (100%) rename {dbx => src/dbx}/templates/projects/python_basic/render/hooks/post_gen_project.py (100%) rename {dbx => src/dbx}/templates/projects/python_basic/render/{{cookiecutter.project_name}}/.gitignore (100%) rename {dbx => src/dbx}/templates/projects/python_basic/render/{{cookiecutter.project_name}}/README.md (100%) rename {dbx => src/dbx}/templates/projects/python_basic/render/{{cookiecutter.project_name}}/conf/tasks/sample_etl_config.yml (100%) rename {dbx => src/dbx}/templates/projects/python_basic/render/{{cookiecutter.project_name}}/conf/tasks/sample_ml_config.yml (100%) rename {dbx => src/dbx}/templates/projects/python_basic/render/{{cookiecutter.project_name}}/notebooks/sample_notebook.py (100%) rename {dbx => src/dbx}/templates/projects/python_basic/render/{{cookiecutter.project_name}}/pyproject.toml (100%) rename {dbx => src/dbx}/templates/projects/python_basic/render/{{cookiecutter.project_name}}/setup.py (100%) rename {dbx => src/dbx}/templates/projects/python_basic/render/{{cookiecutter.project_name}}/tests/entrypoint.py (100%) rename {dbx => src/dbx}/templates/projects/python_basic/render/{{cookiecutter.project_name}}/tests/integration/e2e_test.py (100%) rename {dbx => src/dbx}/templates/projects/python_basic/render/{{cookiecutter.project_name}}/tests/unit/conftest.py (100%) rename {dbx => src/dbx}/templates/projects/python_basic/render/{{cookiecutter.project_name}}/tests/unit/sample_test.py (100%) rename {dbx => src/dbx}/templates/projects/python_basic/render/{{cookiecutter.project_name}}/{{cookiecutter.project_slug}}/__init__.py (100%) rename {dbx => src/dbx}/templates/projects/python_basic/render/{{cookiecutter.project_name}}/{{cookiecutter.project_slug}}/common.py (100%) create mode 100644 src/dbx/templates/projects/python_basic/render/{{cookiecutter.project_name}}/{{cookiecutter.project_slug}}/tasks/__init__.py rename {dbx => src/dbx}/templates/projects/python_basic/render/{{cookiecutter.project_name}}/{{cookiecutter.project_slug}}/tasks/sample_etl_task.py (100%) rename {dbx => src/dbx}/templates/projects/python_basic/render/{{cookiecutter.project_name}}/{{cookiecutter.project_slug}}/tasks/sample_ml_task.py (100%) rename {dbx => src/dbx}/types.py (100%) rename {dbx => src/dbx}/utils/__init__.py (100%) rename {dbx => src/dbx}/utils/common.py (100%) rename {dbx => src/dbx}/utils/file_uploader.py (100%) rename {dbx => src/dbx}/utils/json.py (100%) rename {dbx => src/dbx}/utils/url.py (100%) diff --git a/.github/workflows/onpush.yml b/.github/workflows/onpush.yml index c493e277..27fddab0 100644 --- a/.github/workflows/onpush.yml +++ b/.github/workflows/onpush.yml @@ -12,42 +12,44 @@ jobs: strategy: max-parallel: 4 matrix: - python-version: [ '3.9' ] + python-version: [ '3.8' ] os: [ ubuntu-latest, windows-latest ] steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 + - uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + - name: Set up Python + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - cache: 'pip' # caching pip dependencies - cache-dependency-path: setup.py + cache: 'pip' - name: Install pip run: python -m pip install --upgrade pip - name: Install package and dependencies - run: pip install -U -e ".[dev]" + run: | + python -m pip install --upgrade pip + pip install hatch + hatch run sync - name: Lint run: | - prospector --profile prospector.yaml - black --check . + hatch run prospector --profile prospector.yaml + hatch run black --check . - name: Run unit tests run: | git config --global init.defaultBranch main # to avoid verbose deprecation messages in CI pipeline - pytest tests/unit --cov dbx -n auto + hatch run pytest tests/unit --cov dbx -n auto - name: Run integrity tests run: | - python -m dbx --help - python -c "import dbx; print(dbx.__version__)" + hatch run python -m dbx --help + hatch run python -c "from dbx._version import __version__; print(__version__)" - name: Publish test coverage if: startsWith(matrix.os,'ubuntu') - uses: codecov/codecov-action@v1 + uses: codecov/codecov-action@v4 + with: + token: ${{ secrets.CODECOV_TOKEN }} # required diff --git a/.github/workflows/onrelease.yml b/.github/workflows/onrelease.yml index 0ba1fdd4..f8c1da7f 100644 --- a/.github/workflows/onrelease.yml +++ b/.github/workflows/onrelease.yml @@ -15,25 +15,25 @@ jobs: os: [ ubuntu-latest ] steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 + - uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + - name: Set up Python + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - cache: 'pip' # caching pip dependencies - cache-dependency-path: setup.py + cache: 'pip' - name: Install pip run: python -m pip install --upgrade pip - - name: Install dependencies - run: pip install -U -e ".[dev]" + - name: Install package and dependencies + run: | + python -m pip install --upgrade pip + pip install hatch + hatch run sync - name: Build dist - run: pip wheel -w dist . --no-deps + run: hatch build -c -t wheel - name: Publish a Python distribution to PyPI uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/.gitignore b/.gitignore index 9fab74fb..8e168bd0 100644 --- a/.gitignore +++ b/.gitignore @@ -93,3 +93,4 @@ out/ site/ .dbx/ +src/dbx/_version.py \ No newline at end of file diff --git a/LICENSE b/LICENSE index 29f586c4..6afea9e6 100755 --- a/LICENSE +++ b/LICENSE @@ -1,43 +1,69 @@ -DataBricks eXtensions aka dbx + Databricks License + Copyright (2021) Databricks, Inc. -Copyright (2021) Databricks, Inc. + Definitions. + + Agreement: The agreement between Databricks, Inc., and you governing + the use of the Databricks Services, as that term is defined in + the Master Cloud Services Agreement (MCSA) located at + www.databricks.com/legal/mcsa. + + Licensed Materials: The source code, object code, data, and/or other + works to which this license applies. -This library (the "Software") may not be used except in connection with the Licensee's use of the Databricks Platform Services pursuant -to an Agreement (defined below) between Licensee (defined below) and Databricks, Inc. ("Databricks"). The Object Code version of the -Software shall be deemed part of the Downloadable Services under the Agreement, or if the Agreement does not define Downloadable Services, -Subscription Services, or if neither are defined then the term in such Agreement that refers to the applicable Databricks Platform -Services (as defined below) shall be substituted herein for “Downloadable Services.” Licensee's use of the Software must comply at -all times with any restrictions applicable to the Downloadable Services and Subscription Services, generally, and must be used in -accordance with any applicable documentation. For the avoidance of doubt, the Software constitutes Databricks Confidential Information -under the Agreement. + Scope of Use. You may not use the Licensed Materials except in + connection with your use of the Databricks Services pursuant to + the Agreement. Your use of the Licensed Materials must comply at all + times with any restrictions applicable to the Databricks Services, + generally, and must be used in accordance with any applicable + documentation. You may view, use, copy, modify, publish, and/or + distribute the Licensed Materials solely for the purposes of using + the Licensed Materials within or connecting to the Databricks Services. + If you do not agree to these terms, you may not view, use, copy, + modify, publish, and/or distribute the Licensed Materials. + + Redistribution. You may redistribute and sublicense the Licensed + Materials so long as all use is in compliance with these terms. + In addition: + + - You must give any other recipients a copy of this License; + - You must cause any modified files to carry prominent notices + stating that you changed the files; + - You must retain, in any derivative works that you distribute, + all copyright, patent, trademark, and attribution notices, + excluding those notices that do not pertain to any part of + the derivative works; and + - If a "NOTICE" text file is provided as part of its + distribution, then any derivative works that you distribute + must include a readable copy of the attribution notices + contained within such NOTICE file, excluding those notices + that do not pertain to any part of the derivative works. -Additionally, and notwithstanding anything in the Agreement to the contrary: -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE - LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR - IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -* you may view, make limited copies of, and may compile the Source Code version of the Software into an Object Code version of the - Software. For the avoidance of doubt, you may not make derivative works of Software (or make any any changes to the Source Code - version of the unless you have agreed to separate terms with Databricks permitting such modifications (e.g., a contribution license - agreement)). + You may add your own copyright statement to your modifications and may + provide additional license terms and conditions for use, reproduction, + or distribution of your modifications, or for any such derivative works + as a whole, provided your use, reproduction, and distribution of + the Licensed Materials otherwise complies with the conditions stated + in this License. -If you have not agreed to an Agreement or otherwise do not agree to these terms, you may not use the Software or view, copy or compile -the Source Code of the Software. - -This license terminates automatically upon the termination of the Agreement or Licensee's breach of these terms. Additionally, -Databricks may terminate this license at any time on notice. Upon termination, you must permanently delete the Software and all -copies thereof (including the Source Code). + Termination. This license terminates automatically upon your breach of + these terms or upon the termination of your Agreement. Additionally, + Databricks may terminate this license at any time on notice. Upon + termination, you must permanently delete the Licensed Materials and + all copies thereof. -Agreement: the agreement between Databricks and Licensee governing the use of the Databricks Platform Services, which shall be, with -respect to Databricks, the Databricks Terms of Service located at www.databricks.com/termsofservice, and with respect to Databricks -Community Edition, the Community Edition Terms of Service located at www.databricks.com/ce-termsofuse, in each case unless Licensee -has entered into a separate written agreement with Databricks governing the use of the applicable Databricks Platform Services. - -Databricks Platform Services: the Databricks services or the Databricks Community Edition services, according to where the Software is used. + DISCLAIMER; LIMITATION OF LIABILITY. -Licensee: the user of the Software, or, if the Software is being used on behalf of a company, the company. - -Object Code: is version of the Software produced when an interpreter or a compiler translates the Source Code into recognizable and -executable machine code. - -Source Code: the human readable portion of the Software. + THE LICENSED MATERIALS ARE PROVIDED “AS-IS” AND WITH ALL FAULTS. + DATABRICKS, ON BEHALF OF ITSELF AND ITS LICENSORS, SPECIFICALLY + DISCLAIMS ALL WARRANTIES RELATING TO THE LICENSED MATERIALS, EXPRESS + AND IMPLIED, INCLUDING, WITHOUT LIMITATION, IMPLIED WARRANTIES, + CONDITIONS AND OTHER TERMS OF MERCHANTABILITY, SATISFACTORY QUALITY OR + FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. DATABRICKS AND + ITS LICENSORS TOTAL AGGREGATE LIABILITY RELATING TO OR ARISING OUT OF + YOUR USE OF OR DATABRICKS’ PROVISIONING OF THE LICENSED MATERIALS SHALL + BE LIMITED TO ONE THOUSAND ($1,000) DOLLARS. IN NO EVENT SHALL + THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + ARISING FROM, OUT OF OR IN CONNECTION WITH THE LICENSED MATERIALS OR + THE USE OR OTHER DEALINGS IN THE LICENSED MATERIALS. \ No newline at end of file diff --git a/Makefile b/Makefile index 1c6c5cef..8ffb566d 100644 --- a/Makefile +++ b/Makefile @@ -11,14 +11,6 @@ SHELL=/bin/bash -############################################################################## -PYTHON_VERSION=3.8.13 -VENV_NAME := $(shell [ -d venv ] && echo venv || echo .venv) -VENV_DIR=${VENV_NAME} -PYTHON=${VENV_DIR}/bin/python -RSTCHECK=${VENV_DIR}/bin/rstcheck -SPHINX_AUTOBUILD=${VENV_DIR}/bin/sphinx-autobuild -SPHINX_BUILD=${VENV_DIR}/bin/sphinx-build ############################################################################## ############################################################################## @@ -84,12 +76,11 @@ clean: ## Clean .venv, dist, build @echo "" @echo "${YELLOW}Removing virtual environment ${NORMAL}" @make helper-line - -rm .python-version + hatch env remove @echo "" @echo "${YELLOW}Remove temp files${NORMAL}" @make helper-line - -rm -rf $(VENV_DIR) -rm -rf dist/* -rm -rf build/* -rm -rf dbx.egg-info/* @@ -103,52 +94,25 @@ clean: ## Clean .venv, dist, build @make docs-clean -############################################################################## -# This chaining exists so that the virtual env target will not be invoked multiple times. -# This config works because there is a file at this path "$(VENV_NAME)/bin/activate" -# Once that file is created, it will not be change unless you run "make clean". -# If the file did not change, then the target below with same name will be skipped. -venv: $(VENV_NAME)/bin/activate - -$(VENV_NAME)/bin/activate: - @echo "" - @echo "${YELLOW}Init pyenv${NORMAL}" - @make helper-line - pyenv install -s ${PYTHON_VERSION} - pyenv local ${PYTHON_VERSION} - - @echo "" - @echo "${YELLOW}Current python:${NORMAL}" - @make helper-line - @python --version - - @echo "" - @echo "${YELLOW}Init venv in ${VENV_DIR}${NORMAL}" - @make helper-line - test -d $(VENV_NAME) || python -m venv $(VENV_NAME) - - @echo "" - @echo "${YELLOW}Using ${PYTHON}${NORMAL}" - @make helper-line - $(PYTHON) --version - $(PYTHON) -m pip install --upgrade pip - ############################################################################## -install: venv install-e install-dev post-install-info ## >>> MAIN TARGET. Run this to start. <<< +create-env: + hatch env create + +install: create-env install-e install-dev post-install-info ## >>> MAIN TARGET. Run this to start. <<< install-e: ## Install project as editable. @echo "" @echo "${YELLOW}Install project as editable${NORMAL}" @make helper-line - $(PYTHON) -m pip install -e . + python -m pip install -e . install-dev: ## Install dev dependencies. @echo "" @echo "${YELLOW}Install Dev dependencies.${NORMAL}" @make helper-line - $(PYTHON) -m pip install -e ".[dev]" + python -m pip install -e ".[dev]" post-install-info: ## Just some post installation info. @echo "" @@ -162,7 +126,7 @@ post-install-info: ## Just some post installation info. @echo "" @echo "${YELLOW}Optionally${NORMAL}: If you really need to, you can activate the venv in your" @echo "terminal shell by running: " - @echo " ${YELLOW}'source .venv/bin/activate'${NORMAL}" + @echo " ${YELLOW}'hatch shell'${NORMAL}" @echo "" @echo "This will put any executable python tools installed above in the PATH, allowing you" @echo "to run the tools from the shell if you really need to." @@ -175,21 +139,20 @@ lint: ## Run the lint and checks @echo "" @echo "${YELLOW}Linting code:${NORMAL}" @make helper-line - $(PYTHON) -m prospector --profile prospector.yaml - $(RSTCHECK) README.rst + python -m prospector --profile prospector.yaml @make check check: ## Run black checks @echo "" @echo "${YELLOW}Check code with black:${NORMAL}" @make helper-line - $(PYTHON) -m black --check . + python -m black --check . fix: ## fix the code with black formatter. @echo "" @echo "${YELLOW}Fixing code with black:${NORMAL}" @make helper-line - $(PYTHON) -m black . + python -m black . ############################################################################## @@ -197,7 +160,7 @@ test: ## Run the tests. (option): file=tests/path/to/file.py @echo "" @echo "${YELLOW}Running tests:${NORMAL}" @make helper-line - $(PYTHON) -m pytest -vv --cov dbx $(file) -n auto \ + python -m pytest -vv --cov dbx $(file) -n auto \ --cov-report=xml \ --cov-report=term-missing:skip-covered @@ -205,7 +168,7 @@ test-with-html-report: ## Run all tests with html reporter. @echo "" @echo "${YELLOW}Testing with html report:${NORMAL}" @make helper-line - $(PYTHON) -m pytest --cov dbx -n auto --cov-report html -s + python -m pytest --cov dbx -n auto --cov-report html -s ############################################################################## @@ -227,6 +190,4 @@ build: ## Build the package. @echo "" @echo "${YELLOW}Building the project:${NORMAL}" @make helper-line - rm -rf dist/* - rm -rf build/* - $(PYTHON) setup.py clean bdist_wheel + hatch build -c -t wheel diff --git a/contrib/CONTRIBUTING.md b/contrib/CONTRIBUTING.md index f0ed4527..1ad27a93 100644 --- a/contrib/CONTRIBUTING.md +++ b/contrib/CONTRIBUTING.md @@ -19,7 +19,7 @@ To make e2e runs you'll need a Databricks account, and a configured profile. ### Prerequisites - `make`: This is the gnu make tool. - for mac: https://formulae.brew.sh/formula/make -- `pyenv`: https://github.com/pyenv/pyenv +- `hatch`: https://github.com/pypa/hatch Once you have the pre-requisites installed, you can run project functions like this: diff --git a/dbx/__init__.py b/dbx/__init__.py deleted file mode 100644 index ccab46fb..00000000 --- a/dbx/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__version__ = "0.8.18" diff --git a/prospector.yaml b/prospector.yaml index 3efb372f..eb8ad284 100644 --- a/prospector.yaml +++ b/prospector.yaml @@ -5,7 +5,7 @@ doc-warnings: false ignore-paths: - build - tests - - dbx/templates + - src/dbx/templates max-line-length: 120 @@ -31,6 +31,7 @@ pylint: - raise-missing-from # pretty strange requirement with acquaint logic - broad-except - arguments-differ + - broad-exception-raised pycodestyle: # W293: disabled because we have newlines in docstrings diff --git a/pyproject.toml b/pyproject.toml index 14ab4822..4fb637fd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,27 +1,117 @@ +[build-system] +requires = ["hatchling", "hatch-vcs"] +build-backend = "hatchling.build" + +[tool.hatch.build] +sources = ["src"] +include = ["src"] + +[project] +name = "dbx" +dynamic = ["version"] +description = "DataBricks CLI eXtensions aka dbx" +long-description = "README.md" +long-description-content-type = "text/markdown" +readme = "README.md" +license-files = { paths = ["LICENSE", "NOTICE"] } +requires-python = ">=3.8" + +authors = [ + { name = "Ivan Trusov", email = "ivan.trusov@databricks.com" }, + { name = "Michael Shtelma" }, + { name = "Thunder Shiviah" }, +] + +mainteiners = [{ name = "Ivan Trusov", email = "ivan.trusov@databricks.com" }] +classifiers = [ + "Intended Audience :: Developers", + "Intended Audience :: System Administrators", +] + +dependencies = [ + "aiohttp>=3.8.2", + "click>=8.1.0,<9.0.0", + "cookiecutter>2.1.0, <3.0.0", + "cryptography>=42.0.8", + "databricks-cli>=0.17,<0.18", + "Jinja2>=2.11.2", + "mlflow-skinny>=2.0.0,<3.0.0", + "pathspec>=0.9.0", + "pydantic>=1.10.8,<2.0.0", + "pyyaml>=6.0", + "requests>=2.30.1,<3.0.0", + "rich>=12.6.0,<=13.0.0", + "tenacity>=8.2.2,<9.0.0", + "typer[all]==0.7.0", + "watchdog>=2.1.0", +] + +[project.optional-dependencies] +aws = ["boto3>=1.26.13,<2"] +azure = [ + "azure-identity>=1.12.0,<2.0.0", + "azure-storage-blob>=12.14.1,<13.0.0" +] +gcp = ["google-cloud-storage>=2.6.0,<3.0.0"] + +[tool.hatch.envs.default] +python = "3.8" +dependencies = [ + "black>=22.3.0,<23.0.0", + "MarkupSafe>=2.1.1,<3.0.0", + "mccabe>=0.7.0,<1.0.0", + "mdx-include>=1.4.1,<2.0.0", + "mkdocs-click>=0.8.0,<1.0", + "mkdocs-git-revision-date-localized-plugin>=1.1.0,<=2.0", + "mkdocs-glightbox>=0.2.1,<1.0", + "mkdocs-markdownextradata-plugin>=0.1.7,<0.3.0", + "mkdocs-material>=9.0.8,<10.0.0", + "mkdocs>=1.1.2,<2.0.0", + "poetry>=1.2.0", + "pre-commit>=2.20.0,<4.0.0", + "prospector>=1.10.3,<2.0.0", + "pycodestyle>=2.12.0,<3.0.0", + "pyflakes==2.5.0", + "pylint>=2.15.6,<3.0.0", + "pytest-asyncio>=0.18.3,<1.0.0", + "pytest-clarity>=1.0.1,<2.0.0", + "pytest-cov>=4.0.0,<5.0.0", + "pytest-mock>=3.8.2,<3.12.0", + "pytest-timeout>=2.1.0,<3.0.0", + "pytest-xdist[psutil]>=2.5.0,<3.0.0", + "pytest>=7.1.3,<8.0.0", +] +[project.scripts] +dbx = "dbx.cli:entrypoint" + [tool.black] line-length = 120 target-version = ['py38'] exclude = ''' /( - | dbx/templates/projects + | src/dbx/templates/projects | build | .venv | out )/ ''' +extend-exclude = "src/dbx/_version.py" [tool.pytest.ini_options] -addopts = "-s -p no:warnings --timeout=3600 --ignore-glob='dbx/templates/*'" +addopts = "-s -p no:warnings --timeout=3600 --ignore-glob='src/dbx/templates/*'" log_cli = 1 log_cli_level = "INFO" log_cli_format = "[pytest][%(asctime)s][%(levelname)s][%(module)s][%(funcName)s] %(message)s" log_cli_date_format = "%Y-%m-%d %H:%M:%S" log_level = "INFO" -pythonpath = [ - "." -] +pythonpath = ["."] + +markers = ["disable_auto_execute_mock"] + +[tool.hatch.version] +source = "vcs" + +[tool.hatch.build.hooks.vcs] +version-file = "src/dbx/_version.py" -markers = [ - "disable_auto_execute_mock" -] diff --git a/setup.py b/setup.py deleted file mode 100644 index f76042d2..00000000 --- a/setup.py +++ /dev/null @@ -1,92 +0,0 @@ -import sys - -from setuptools import find_packages, setup - -from dbx import __version__ - -with open("README.md", "r", encoding="utf-8") as fh: - long_description = fh.read() - -INSTALL_REQUIRES = [ - # to use Databricks and MLflow APIs - "requests>=2.30.1,<3.0.0", - "mlflow-skinny>=2.0.0,<3.0.0", - "databricks-cli>=0.17,<0.18", - "tenacity>=8.2.2,<=9.0.0", - # CLI interface - "click>=8.1.0,<9.0.0", - "rich==12.6.0", - "typer[all]==0.7.0", - # for templates creation - "cookiecutter>2.1.0, <3.0.0", - # file formats and models - "pyyaml>=6.0", - "pydantic>=1.10.8,<2.0.0", - "Jinja2>=2.11.2", - # misc - enforced to avoid issues with dependent libraries - "cryptography>=41.0.0,<42.0.0", - # required by dbx sync - "aiohttp>=3.8.2", - "pathspec>=0.9.0", - "watchdog>=2.1.0", -] - -if sys.platform.startswith("win32"): - INSTALL_REQUIRES.append("pywin32==227") - -DEV_REQUIREMENTS = [ - # utilities for documentation - "mkdocs>=1.1.2,<2.0.0", - "mkdocs-click>=0.8.0,<1.0", - "mkdocs-material>=9.0.8,<10.0.0", - "mdx-include>=1.4.1,<2.0.0", - "mkdocs-markdownextradata-plugin>=0.1.7,<0.3.0", - "mkdocs-glightbox>=0.2.1,<1.0", - "mkdocs-git-revision-date-localized-plugin>=1.1.0,<=2.0", - # pre-commit and linting utilities - "pre-commit>=2.20.0,<4.0.0", - "pylint==2.15.6", - "pycodestyle==2.8.0", - "pyflakes==2.5.0", - "mccabe==0.6.1", - "prospector==1.7.7", - "black>=22.3.0,<23.0.0", - "MarkupSafe>=2.1.1,<3.0.0", - # testing framework - "pytest>=7.1.3,<8.0.0", - "pytest-mock>=3.8.2,<3.12.0", - "pytest-xdist[psutil]>=2.5.0,<3.0.0", - "pytest-asyncio>=0.18.3,<1.0.0", - "pytest-cov>=4.0.0,<5.0.0", - "pytest-timeout>=2.1.0,<3.0.0", - "pytest-clarity>=1.0.1,<2.0.0", - "poetry>=1.2.0", -] - -AZURE_EXTRAS = ["azure-storage-blob>=12.14.1,<13.0.0", "azure-identity>=1.12.0,<2.0.0"] - -AWS_EXTRAS = [ - "boto3>=1.26.13,<2", -] - -GCP_EXTRAS = ["google-cloud-storage>=2.6.0,<3.0.0"] - -setup( - name="dbx", - python_requires=">=3.8", - packages=find_packages(exclude=["tests", "tests.*"]), - install_requires=INSTALL_REQUIRES, - extras_require={"dev": DEV_REQUIREMENTS, "azure": AZURE_EXTRAS, "aws": AWS_EXTRAS, "gcp": GCP_EXTRAS}, - entry_points={"console_scripts": ["dbx=dbx.cli:entrypoint"]}, - long_description=long_description, - long_description_content_type="text/markdown", - include_package_data=True, - version=__version__, - description="DataBricks CLI eXtensions aka dbx", - author="Thunder Shiviah, Michael Shtelma, Ivan Trusov", - license="Databricks License", - classifiers=[ - "Intended Audience :: Developers", - "Intended Audience :: System Administrators", - ], -) diff --git a/dbx/api/__init__.py b/src/dbx/__init__.py similarity index 100% rename from dbx/api/__init__.py rename to src/dbx/__init__.py diff --git a/dbx/__main__.py b/src/dbx/__main__.py similarity index 100% rename from dbx/__main__.py rename to src/dbx/__main__.py diff --git a/dbx/api/adjuster/__init__.py b/src/dbx/api/__init__.py similarity index 100% rename from dbx/api/adjuster/__init__.py rename to src/dbx/api/__init__.py diff --git a/dbx/api/_module_loader.py b/src/dbx/api/_module_loader.py similarity index 100% rename from dbx/api/_module_loader.py rename to src/dbx/api/_module_loader.py diff --git a/dbx/api/adjuster/mixins/__init__.py b/src/dbx/api/adjuster/__init__.py similarity index 100% rename from dbx/api/adjuster/mixins/__init__.py rename to src/dbx/api/adjuster/__init__.py diff --git a/dbx/api/adjuster/adjuster.py b/src/dbx/api/adjuster/adjuster.py similarity index 100% rename from dbx/api/adjuster/adjuster.py rename to src/dbx/api/adjuster/adjuster.py diff --git a/dbx/api/dependency/__init__.py b/src/dbx/api/adjuster/mixins/__init__.py similarity index 100% rename from dbx/api/dependency/__init__.py rename to src/dbx/api/adjuster/mixins/__init__.py diff --git a/dbx/api/adjuster/mixins/base.py b/src/dbx/api/adjuster/mixins/base.py similarity index 100% rename from dbx/api/adjuster/mixins/base.py rename to src/dbx/api/adjuster/mixins/base.py diff --git a/dbx/api/adjuster/mixins/existing_cluster.py b/src/dbx/api/adjuster/mixins/existing_cluster.py similarity index 100% rename from dbx/api/adjuster/mixins/existing_cluster.py rename to src/dbx/api/adjuster/mixins/existing_cluster.py diff --git a/dbx/api/adjuster/mixins/file_reference.py b/src/dbx/api/adjuster/mixins/file_reference.py similarity index 100% rename from dbx/api/adjuster/mixins/file_reference.py rename to src/dbx/api/adjuster/mixins/file_reference.py diff --git a/dbx/api/adjuster/mixins/instance_pool.py b/src/dbx/api/adjuster/mixins/instance_pool.py similarity index 100% rename from dbx/api/adjuster/mixins/instance_pool.py rename to src/dbx/api/adjuster/mixins/instance_pool.py diff --git a/dbx/api/adjuster/mixins/instance_profile.py b/src/dbx/api/adjuster/mixins/instance_profile.py similarity index 100% rename from dbx/api/adjuster/mixins/instance_profile.py rename to src/dbx/api/adjuster/mixins/instance_profile.py diff --git a/dbx/api/adjuster/mixins/pipeline.py b/src/dbx/api/adjuster/mixins/pipeline.py similarity index 100% rename from dbx/api/adjuster/mixins/pipeline.py rename to src/dbx/api/adjuster/mixins/pipeline.py diff --git a/dbx/api/adjuster/mixins/service_principal.py b/src/dbx/api/adjuster/mixins/service_principal.py similarity index 100% rename from dbx/api/adjuster/mixins/service_principal.py rename to src/dbx/api/adjuster/mixins/service_principal.py diff --git a/dbx/api/adjuster/mixins/sql_properties.py b/src/dbx/api/adjuster/mixins/sql_properties.py similarity index 100% rename from dbx/api/adjuster/mixins/sql_properties.py rename to src/dbx/api/adjuster/mixins/sql_properties.py diff --git a/dbx/api/adjuster/policy.py b/src/dbx/api/adjuster/policy.py similarity index 100% rename from dbx/api/adjuster/policy.py rename to src/dbx/api/adjuster/policy.py diff --git a/dbx/api/auth.py b/src/dbx/api/auth.py similarity index 100% rename from dbx/api/auth.py rename to src/dbx/api/auth.py diff --git a/dbx/api/build.py b/src/dbx/api/build.py similarity index 100% rename from dbx/api/build.py rename to src/dbx/api/build.py diff --git a/dbx/api/client_provider.py b/src/dbx/api/client_provider.py similarity index 100% rename from dbx/api/client_provider.py rename to src/dbx/api/client_provider.py diff --git a/dbx/api/cluster.py b/src/dbx/api/cluster.py similarity index 100% rename from dbx/api/cluster.py rename to src/dbx/api/cluster.py diff --git a/dbx/api/config_reader.py b/src/dbx/api/config_reader.py similarity index 100% rename from dbx/api/config_reader.py rename to src/dbx/api/config_reader.py diff --git a/dbx/api/configure.py b/src/dbx/api/configure.py similarity index 100% rename from dbx/api/configure.py rename to src/dbx/api/configure.py diff --git a/dbx/api/context.py b/src/dbx/api/context.py similarity index 100% rename from dbx/api/context.py rename to src/dbx/api/context.py diff --git a/dbx/api/launch/__init__.py b/src/dbx/api/dependency/__init__.py similarity index 100% rename from dbx/api/launch/__init__.py rename to src/dbx/api/dependency/__init__.py diff --git a/dbx/api/dependency/core_package.py b/src/dbx/api/dependency/core_package.py similarity index 100% rename from dbx/api/dependency/core_package.py rename to src/dbx/api/dependency/core_package.py diff --git a/dbx/api/dependency/requirements.py b/src/dbx/api/dependency/requirements.py similarity index 100% rename from dbx/api/dependency/requirements.py rename to src/dbx/api/dependency/requirements.py diff --git a/dbx/api/deployment.py b/src/dbx/api/deployment.py similarity index 100% rename from dbx/api/deployment.py rename to src/dbx/api/deployment.py diff --git a/dbx/api/destroyer.py b/src/dbx/api/destroyer.py similarity index 100% rename from dbx/api/destroyer.py rename to src/dbx/api/destroyer.py diff --git a/dbx/api/execute.py b/src/dbx/api/execute.py similarity index 100% rename from dbx/api/execute.py rename to src/dbx/api/execute.py diff --git a/dbx/api/jinja.py b/src/dbx/api/jinja.py similarity index 100% rename from dbx/api/jinja.py rename to src/dbx/api/jinja.py diff --git a/dbx/api/launch/runners/__init__.py b/src/dbx/api/launch/__init__.py similarity index 100% rename from dbx/api/launch/runners/__init__.py rename to src/dbx/api/launch/__init__.py diff --git a/dbx/api/launch/contexts.py b/src/dbx/api/launch/contexts.py similarity index 100% rename from dbx/api/launch/contexts.py rename to src/dbx/api/launch/contexts.py diff --git a/dbx/api/launch/functions.py b/src/dbx/api/launch/functions.py similarity index 100% rename from dbx/api/launch/functions.py rename to src/dbx/api/launch/functions.py diff --git a/dbx/api/launch/pipeline_models.py b/src/dbx/api/launch/pipeline_models.py similarity index 100% rename from dbx/api/launch/pipeline_models.py rename to src/dbx/api/launch/pipeline_models.py diff --git a/dbx/api/launch/processors.py b/src/dbx/api/launch/processors.py similarity index 100% rename from dbx/api/launch/processors.py rename to src/dbx/api/launch/processors.py diff --git a/dbx/api/services/__init__.py b/src/dbx/api/launch/runners/__init__.py similarity index 100% rename from dbx/api/services/__init__.py rename to src/dbx/api/launch/runners/__init__.py diff --git a/dbx/api/launch/runners/asset_based.py b/src/dbx/api/launch/runners/asset_based.py similarity index 100% rename from dbx/api/launch/runners/asset_based.py rename to src/dbx/api/launch/runners/asset_based.py diff --git a/dbx/api/launch/runners/base.py b/src/dbx/api/launch/runners/base.py similarity index 100% rename from dbx/api/launch/runners/base.py rename to src/dbx/api/launch/runners/base.py diff --git a/dbx/api/launch/runners/pipeline.py b/src/dbx/api/launch/runners/pipeline.py similarity index 100% rename from dbx/api/launch/runners/pipeline.py rename to src/dbx/api/launch/runners/pipeline.py diff --git a/dbx/api/launch/runners/standard.py b/src/dbx/api/launch/runners/standard.py similarity index 100% rename from dbx/api/launch/runners/standard.py rename to src/dbx/api/launch/runners/standard.py diff --git a/dbx/api/launch/tracer.py b/src/dbx/api/launch/tracer.py similarity index 100% rename from dbx/api/launch/tracer.py rename to src/dbx/api/launch/tracer.py diff --git a/dbx/api/output_provider.py b/src/dbx/api/output_provider.py similarity index 100% rename from dbx/api/output_provider.py rename to src/dbx/api/output_provider.py diff --git a/dbx/api/storage/__init__.py b/src/dbx/api/services/__init__.py similarity index 100% rename from dbx/api/storage/__init__.py rename to src/dbx/api/services/__init__.py diff --git a/dbx/api/services/_base.py b/src/dbx/api/services/_base.py similarity index 100% rename from dbx/api/services/_base.py rename to src/dbx/api/services/_base.py diff --git a/dbx/api/services/jobs.py b/src/dbx/api/services/jobs.py similarity index 100% rename from dbx/api/services/jobs.py rename to src/dbx/api/services/jobs.py diff --git a/dbx/api/services/permissions.py b/src/dbx/api/services/permissions.py similarity index 100% rename from dbx/api/services/permissions.py rename to src/dbx/api/services/permissions.py diff --git a/dbx/api/services/pipelines.py b/src/dbx/api/services/pipelines.py similarity index 100% rename from dbx/api/services/pipelines.py rename to src/dbx/api/services/pipelines.py diff --git a/dbx/commands/__init__.py b/src/dbx/api/storage/__init__.py similarity index 100% rename from dbx/commands/__init__.py rename to src/dbx/api/storage/__init__.py diff --git a/dbx/api/storage/io.py b/src/dbx/api/storage/io.py similarity index 100% rename from dbx/api/storage/io.py rename to src/dbx/api/storage/io.py diff --git a/dbx/api/storage/mlflow_based.py b/src/dbx/api/storage/mlflow_based.py similarity index 100% rename from dbx/api/storage/mlflow_based.py rename to src/dbx/api/storage/mlflow_based.py diff --git a/dbx/callbacks.py b/src/dbx/callbacks.py similarity index 98% rename from dbx/callbacks.py rename to src/dbx/callbacks.py index d11bc483..f788df11 100644 --- a/dbx/callbacks.py +++ b/src/dbx/callbacks.py @@ -5,7 +5,7 @@ import typer -from dbx import __version__ +from dbx._version import __version__ from dbx.models.cli.execute import ExecuteParametersPayload from dbx.utils import dbx_echo diff --git a/dbx/cli.py b/src/dbx/cli.py similarity index 100% rename from dbx/cli.py rename to src/dbx/cli.py diff --git a/dbx/commands/sync/__init__.py b/src/dbx/commands/__init__.py similarity index 100% rename from dbx/commands/sync/__init__.py rename to src/dbx/commands/__init__.py diff --git a/dbx/commands/configure.py b/src/dbx/commands/configure.py similarity index 100% rename from dbx/commands/configure.py rename to src/dbx/commands/configure.py diff --git a/dbx/commands/deploy.py b/src/dbx/commands/deploy.py similarity index 100% rename from dbx/commands/deploy.py rename to src/dbx/commands/deploy.py diff --git a/dbx/commands/destroy.py b/src/dbx/commands/destroy.py similarity index 100% rename from dbx/commands/destroy.py rename to src/dbx/commands/destroy.py diff --git a/dbx/commands/execute.py b/src/dbx/commands/execute.py similarity index 100% rename from dbx/commands/execute.py rename to src/dbx/commands/execute.py diff --git a/dbx/commands/init.py b/src/dbx/commands/init.py similarity index 99% rename from dbx/commands/init.py rename to src/dbx/commands/init.py index 9e156ad6..04bffb10 100644 --- a/dbx/commands/init.py +++ b/src/dbx/commands/init.py @@ -32,6 +32,7 @@ def init( checkout: Optional[str] = typer.Option( None, "--checkout", + is_flag=False, help="""Checkout argument for cookiecutter. Used only if `--path` is used.""", ), parameters: Optional[List[str]] = typer.Option( diff --git a/dbx/commands/launch.py b/src/dbx/commands/launch.py similarity index 100% rename from dbx/commands/launch.py rename to src/dbx/commands/launch.py diff --git a/dbx/models/__init__.py b/src/dbx/commands/sync/__init__.py similarity index 100% rename from dbx/models/__init__.py rename to src/dbx/commands/sync/__init__.py diff --git a/dbx/commands/sync/functions.py b/src/dbx/commands/sync/functions.py similarity index 100% rename from dbx/commands/sync/functions.py rename to src/dbx/commands/sync/functions.py diff --git a/dbx/commands/sync/options.py b/src/dbx/commands/sync/options.py similarity index 100% rename from dbx/commands/sync/options.py rename to src/dbx/commands/sync/options.py diff --git a/dbx/commands/sync/sync.py b/src/dbx/commands/sync/sync.py similarity index 100% rename from dbx/commands/sync/sync.py rename to src/dbx/commands/sync/sync.py diff --git a/dbx/commands/version.py b/src/dbx/commands/version.py similarity index 100% rename from dbx/commands/version.py rename to src/dbx/commands/version.py diff --git a/dbx/constants.py b/src/dbx/constants.py similarity index 100% rename from dbx/constants.py rename to src/dbx/constants.py diff --git a/dbx/custom.py b/src/dbx/custom.py similarity index 100% rename from dbx/custom.py rename to src/dbx/custom.py diff --git a/dbx/models/cli/__init__.py b/src/dbx/models/__init__.py similarity index 100% rename from dbx/models/cli/__init__.py rename to src/dbx/models/__init__.py diff --git a/dbx/models/build.py b/src/dbx/models/build.py similarity index 100% rename from dbx/models/build.py rename to src/dbx/models/build.py diff --git a/dbx/models/files/__init__.py b/src/dbx/models/cli/__init__.py similarity index 100% rename from dbx/models/files/__init__.py rename to src/dbx/models/cli/__init__.py diff --git a/dbx/models/cli/destroyer.py b/src/dbx/models/cli/destroyer.py similarity index 100% rename from dbx/models/cli/destroyer.py rename to src/dbx/models/cli/destroyer.py diff --git a/dbx/models/cli/execute.py b/src/dbx/models/cli/execute.py similarity index 100% rename from dbx/models/cli/execute.py rename to src/dbx/models/cli/execute.py diff --git a/dbx/models/cli/options.py b/src/dbx/models/cli/options.py similarity index 100% rename from dbx/models/cli/options.py rename to src/dbx/models/cli/options.py diff --git a/dbx/models/deployment.py b/src/dbx/models/deployment.py similarity index 100% rename from dbx/models/deployment.py rename to src/dbx/models/deployment.py diff --git a/dbx/models/workflow/__init__.py b/src/dbx/models/files/__init__.py similarity index 100% rename from dbx/models/workflow/__init__.py rename to src/dbx/models/files/__init__.py diff --git a/dbx/models/files/context.py b/src/dbx/models/files/context.py similarity index 100% rename from dbx/models/files/context.py rename to src/dbx/models/files/context.py diff --git a/dbx/models/files/project.py b/src/dbx/models/files/project.py similarity index 100% rename from dbx/models/files/project.py rename to src/dbx/models/files/project.py diff --git a/dbx/models/validators.py b/src/dbx/models/validators.py similarity index 100% rename from dbx/models/validators.py rename to src/dbx/models/validators.py diff --git a/dbx/models/workflow/common/__init__.py b/src/dbx/models/workflow/__init__.py similarity index 100% rename from dbx/models/workflow/common/__init__.py rename to src/dbx/models/workflow/__init__.py diff --git a/dbx/models/workflow/v2dot0/__init__.py b/src/dbx/models/workflow/common/__init__.py similarity index 100% rename from dbx/models/workflow/v2dot0/__init__.py rename to src/dbx/models/workflow/common/__init__.py diff --git a/dbx/models/workflow/common/access_control.py b/src/dbx/models/workflow/common/access_control.py similarity index 100% rename from dbx/models/workflow/common/access_control.py rename to src/dbx/models/workflow/common/access_control.py diff --git a/dbx/models/workflow/common/deployment_config.py b/src/dbx/models/workflow/common/deployment_config.py similarity index 100% rename from dbx/models/workflow/common/deployment_config.py rename to src/dbx/models/workflow/common/deployment_config.py diff --git a/dbx/models/workflow/common/flexible.py b/src/dbx/models/workflow/common/flexible.py similarity index 100% rename from dbx/models/workflow/common/flexible.py rename to src/dbx/models/workflow/common/flexible.py diff --git a/dbx/models/workflow/common/job_email_notifications.py b/src/dbx/models/workflow/common/job_email_notifications.py similarity index 100% rename from dbx/models/workflow/common/job_email_notifications.py rename to src/dbx/models/workflow/common/job_email_notifications.py diff --git a/dbx/models/workflow/common/libraries.py b/src/dbx/models/workflow/common/libraries.py similarity index 100% rename from dbx/models/workflow/common/libraries.py rename to src/dbx/models/workflow/common/libraries.py diff --git a/dbx/models/workflow/common/new_cluster.py b/src/dbx/models/workflow/common/new_cluster.py similarity index 100% rename from dbx/models/workflow/common/new_cluster.py rename to src/dbx/models/workflow/common/new_cluster.py diff --git a/dbx/models/workflow/common/parameters.py b/src/dbx/models/workflow/common/parameters.py similarity index 100% rename from dbx/models/workflow/common/parameters.py rename to src/dbx/models/workflow/common/parameters.py diff --git a/dbx/models/workflow/common/pipeline.py b/src/dbx/models/workflow/common/pipeline.py similarity index 100% rename from dbx/models/workflow/common/pipeline.py rename to src/dbx/models/workflow/common/pipeline.py diff --git a/dbx/models/workflow/common/task.py b/src/dbx/models/workflow/common/task.py similarity index 100% rename from dbx/models/workflow/common/task.py rename to src/dbx/models/workflow/common/task.py diff --git a/dbx/models/workflow/common/task_type.py b/src/dbx/models/workflow/common/task_type.py similarity index 100% rename from dbx/models/workflow/common/task_type.py rename to src/dbx/models/workflow/common/task_type.py diff --git a/dbx/models/workflow/common/workflow.py b/src/dbx/models/workflow/common/workflow.py similarity index 100% rename from dbx/models/workflow/common/workflow.py rename to src/dbx/models/workflow/common/workflow.py diff --git a/dbx/models/workflow/common/workflow_types.py b/src/dbx/models/workflow/common/workflow_types.py similarity index 100% rename from dbx/models/workflow/common/workflow_types.py rename to src/dbx/models/workflow/common/workflow_types.py diff --git a/dbx/models/workflow/v2dot1/__init__.py b/src/dbx/models/workflow/v2dot0/__init__.py similarity index 100% rename from dbx/models/workflow/v2dot1/__init__.py rename to src/dbx/models/workflow/v2dot0/__init__.py diff --git a/dbx/models/workflow/v2dot0/parameters.py b/src/dbx/models/workflow/v2dot0/parameters.py similarity index 100% rename from dbx/models/workflow/v2dot0/parameters.py rename to src/dbx/models/workflow/v2dot0/parameters.py diff --git a/dbx/models/workflow/v2dot0/task.py b/src/dbx/models/workflow/v2dot0/task.py similarity index 100% rename from dbx/models/workflow/v2dot0/task.py rename to src/dbx/models/workflow/v2dot0/task.py diff --git a/dbx/models/workflow/v2dot0/workflow.py b/src/dbx/models/workflow/v2dot0/workflow.py similarity index 100% rename from dbx/models/workflow/v2dot0/workflow.py rename to src/dbx/models/workflow/v2dot0/workflow.py diff --git a/dbx/templates/projects/python_basic/render/{{cookiecutter.project_name}}/{{cookiecutter.project_slug}}/tasks/__init__.py b/src/dbx/models/workflow/v2dot1/__init__.py similarity index 100% rename from dbx/templates/projects/python_basic/render/{{cookiecutter.project_name}}/{{cookiecutter.project_slug}}/tasks/__init__.py rename to src/dbx/models/workflow/v2dot1/__init__.py diff --git a/dbx/models/workflow/v2dot1/_parameters.py b/src/dbx/models/workflow/v2dot1/_parameters.py similarity index 100% rename from dbx/models/workflow/v2dot1/_parameters.py rename to src/dbx/models/workflow/v2dot1/_parameters.py diff --git a/dbx/models/workflow/v2dot1/job_cluster.py b/src/dbx/models/workflow/v2dot1/job_cluster.py similarity index 100% rename from dbx/models/workflow/v2dot1/job_cluster.py rename to src/dbx/models/workflow/v2dot1/job_cluster.py diff --git a/dbx/models/workflow/v2dot1/job_task_settings.py b/src/dbx/models/workflow/v2dot1/job_task_settings.py similarity index 100% rename from dbx/models/workflow/v2dot1/job_task_settings.py rename to src/dbx/models/workflow/v2dot1/job_task_settings.py diff --git a/dbx/models/workflow/v2dot1/parameters.py b/src/dbx/models/workflow/v2dot1/parameters.py similarity index 100% rename from dbx/models/workflow/v2dot1/parameters.py rename to src/dbx/models/workflow/v2dot1/parameters.py diff --git a/dbx/models/workflow/v2dot1/task.py b/src/dbx/models/workflow/v2dot1/task.py similarity index 100% rename from dbx/models/workflow/v2dot1/task.py rename to src/dbx/models/workflow/v2dot1/task.py diff --git a/dbx/models/workflow/v2dot1/workflow.py b/src/dbx/models/workflow/v2dot1/workflow.py similarity index 100% rename from dbx/models/workflow/v2dot1/workflow.py rename to src/dbx/models/workflow/v2dot1/workflow.py diff --git a/dbx/options.py b/src/dbx/options.py similarity index 100% rename from dbx/options.py rename to src/dbx/options.py diff --git a/dbx/sync/__init__.py b/src/dbx/sync/__init__.py similarity index 99% rename from dbx/sync/__init__.py rename to src/dbx/sync/__init__.py index 75801a99..312ba3bb 100644 --- a/dbx/sync/__init__.py +++ b/src/dbx/sync/__init__.py @@ -76,7 +76,7 @@ def get_snapshot_name(client: BaseClient) -> str: dir_name = client.base_path.split("/")[-1] # The host and the base path should uniquely identify where we are syncing to. - base_path_hash = hashlib.md5(f"{client.host}-{client.base_path}".encode("utf-8")).hexdigest() + base_path_hash = hashlib.sha256(f"{client.host}-{client.base_path}".encode("utf-8")).hexdigest() # Include the client name as well for human readability. return f"{dir_name}-{client.name}-{base_path_hash}" diff --git a/dbx/sync/clients.py b/src/dbx/sync/clients.py similarity index 100% rename from dbx/sync/clients.py rename to src/dbx/sync/clients.py diff --git a/dbx/sync/config.py b/src/dbx/sync/config.py similarity index 100% rename from dbx/sync/config.py rename to src/dbx/sync/config.py diff --git a/dbx/sync/constants.py b/src/dbx/sync/constants.py similarity index 100% rename from dbx/sync/constants.py rename to src/dbx/sync/constants.py diff --git a/dbx/sync/event_handler.py b/src/dbx/sync/event_handler.py similarity index 100% rename from dbx/sync/event_handler.py rename to src/dbx/sync/event_handler.py diff --git a/dbx/sync/path_matcher.py b/src/dbx/sync/path_matcher.py similarity index 100% rename from dbx/sync/path_matcher.py rename to src/dbx/sync/path_matcher.py diff --git a/dbx/sync/snapshot.py b/src/dbx/sync/snapshot.py similarity index 100% rename from dbx/sync/snapshot.py rename to src/dbx/sync/snapshot.py diff --git a/dbx/templates/projects/python_basic/components/.github/workflows/onpush.yml b/src/dbx/templates/projects/python_basic/components/.github/workflows/onpush.yml similarity index 100% rename from dbx/templates/projects/python_basic/components/.github/workflows/onpush.yml rename to src/dbx/templates/projects/python_basic/components/.github/workflows/onpush.yml diff --git a/dbx/templates/projects/python_basic/components/.github/workflows/onrelease.yml b/src/dbx/templates/projects/python_basic/components/.github/workflows/onrelease.yml similarity index 100% rename from dbx/templates/projects/python_basic/components/.github/workflows/onrelease.yml rename to src/dbx/templates/projects/python_basic/components/.github/workflows/onrelease.yml diff --git a/dbx/templates/projects/python_basic/components/.gitlab-ci.yml b/src/dbx/templates/projects/python_basic/components/.gitlab-ci.yml similarity index 100% rename from dbx/templates/projects/python_basic/components/.gitlab-ci.yml rename to src/dbx/templates/projects/python_basic/components/.gitlab-ci.yml diff --git a/dbx/templates/projects/python_basic/components/azure-pipelines.yml b/src/dbx/templates/projects/python_basic/components/azure-pipelines.yml similarity index 100% rename from dbx/templates/projects/python_basic/components/azure-pipelines.yml rename to src/dbx/templates/projects/python_basic/components/azure-pipelines.yml diff --git a/dbx/templates/projects/python_basic/components/conf/deployment.yml b/src/dbx/templates/projects/python_basic/components/conf/deployment.yml similarity index 100% rename from dbx/templates/projects/python_basic/components/conf/deployment.yml rename to src/dbx/templates/projects/python_basic/components/conf/deployment.yml diff --git a/dbx/templates/projects/python_basic/render/cookiecutter.json b/src/dbx/templates/projects/python_basic/render/cookiecutter.json similarity index 100% rename from dbx/templates/projects/python_basic/render/cookiecutter.json rename to src/dbx/templates/projects/python_basic/render/cookiecutter.json diff --git a/dbx/templates/projects/python_basic/render/hooks/post_gen_project.py b/src/dbx/templates/projects/python_basic/render/hooks/post_gen_project.py similarity index 100% rename from dbx/templates/projects/python_basic/render/hooks/post_gen_project.py rename to src/dbx/templates/projects/python_basic/render/hooks/post_gen_project.py diff --git a/dbx/templates/projects/python_basic/render/{{cookiecutter.project_name}}/.gitignore b/src/dbx/templates/projects/python_basic/render/{{cookiecutter.project_name}}/.gitignore similarity index 100% rename from dbx/templates/projects/python_basic/render/{{cookiecutter.project_name}}/.gitignore rename to src/dbx/templates/projects/python_basic/render/{{cookiecutter.project_name}}/.gitignore diff --git a/dbx/templates/projects/python_basic/render/{{cookiecutter.project_name}}/README.md b/src/dbx/templates/projects/python_basic/render/{{cookiecutter.project_name}}/README.md similarity index 100% rename from dbx/templates/projects/python_basic/render/{{cookiecutter.project_name}}/README.md rename to src/dbx/templates/projects/python_basic/render/{{cookiecutter.project_name}}/README.md diff --git a/dbx/templates/projects/python_basic/render/{{cookiecutter.project_name}}/conf/tasks/sample_etl_config.yml b/src/dbx/templates/projects/python_basic/render/{{cookiecutter.project_name}}/conf/tasks/sample_etl_config.yml similarity index 100% rename from dbx/templates/projects/python_basic/render/{{cookiecutter.project_name}}/conf/tasks/sample_etl_config.yml rename to src/dbx/templates/projects/python_basic/render/{{cookiecutter.project_name}}/conf/tasks/sample_etl_config.yml diff --git a/dbx/templates/projects/python_basic/render/{{cookiecutter.project_name}}/conf/tasks/sample_ml_config.yml b/src/dbx/templates/projects/python_basic/render/{{cookiecutter.project_name}}/conf/tasks/sample_ml_config.yml similarity index 100% rename from dbx/templates/projects/python_basic/render/{{cookiecutter.project_name}}/conf/tasks/sample_ml_config.yml rename to src/dbx/templates/projects/python_basic/render/{{cookiecutter.project_name}}/conf/tasks/sample_ml_config.yml diff --git a/dbx/templates/projects/python_basic/render/{{cookiecutter.project_name}}/notebooks/sample_notebook.py b/src/dbx/templates/projects/python_basic/render/{{cookiecutter.project_name}}/notebooks/sample_notebook.py similarity index 100% rename from dbx/templates/projects/python_basic/render/{{cookiecutter.project_name}}/notebooks/sample_notebook.py rename to src/dbx/templates/projects/python_basic/render/{{cookiecutter.project_name}}/notebooks/sample_notebook.py diff --git a/dbx/templates/projects/python_basic/render/{{cookiecutter.project_name}}/pyproject.toml b/src/dbx/templates/projects/python_basic/render/{{cookiecutter.project_name}}/pyproject.toml similarity index 100% rename from dbx/templates/projects/python_basic/render/{{cookiecutter.project_name}}/pyproject.toml rename to src/dbx/templates/projects/python_basic/render/{{cookiecutter.project_name}}/pyproject.toml diff --git a/dbx/templates/projects/python_basic/render/{{cookiecutter.project_name}}/setup.py b/src/dbx/templates/projects/python_basic/render/{{cookiecutter.project_name}}/setup.py similarity index 100% rename from dbx/templates/projects/python_basic/render/{{cookiecutter.project_name}}/setup.py rename to src/dbx/templates/projects/python_basic/render/{{cookiecutter.project_name}}/setup.py diff --git a/dbx/templates/projects/python_basic/render/{{cookiecutter.project_name}}/tests/entrypoint.py b/src/dbx/templates/projects/python_basic/render/{{cookiecutter.project_name}}/tests/entrypoint.py similarity index 100% rename from dbx/templates/projects/python_basic/render/{{cookiecutter.project_name}}/tests/entrypoint.py rename to src/dbx/templates/projects/python_basic/render/{{cookiecutter.project_name}}/tests/entrypoint.py diff --git a/dbx/templates/projects/python_basic/render/{{cookiecutter.project_name}}/tests/integration/e2e_test.py b/src/dbx/templates/projects/python_basic/render/{{cookiecutter.project_name}}/tests/integration/e2e_test.py similarity index 100% rename from dbx/templates/projects/python_basic/render/{{cookiecutter.project_name}}/tests/integration/e2e_test.py rename to src/dbx/templates/projects/python_basic/render/{{cookiecutter.project_name}}/tests/integration/e2e_test.py diff --git a/dbx/templates/projects/python_basic/render/{{cookiecutter.project_name}}/tests/unit/conftest.py b/src/dbx/templates/projects/python_basic/render/{{cookiecutter.project_name}}/tests/unit/conftest.py similarity index 100% rename from dbx/templates/projects/python_basic/render/{{cookiecutter.project_name}}/tests/unit/conftest.py rename to src/dbx/templates/projects/python_basic/render/{{cookiecutter.project_name}}/tests/unit/conftest.py diff --git a/dbx/templates/projects/python_basic/render/{{cookiecutter.project_name}}/tests/unit/sample_test.py b/src/dbx/templates/projects/python_basic/render/{{cookiecutter.project_name}}/tests/unit/sample_test.py similarity index 100% rename from dbx/templates/projects/python_basic/render/{{cookiecutter.project_name}}/tests/unit/sample_test.py rename to src/dbx/templates/projects/python_basic/render/{{cookiecutter.project_name}}/tests/unit/sample_test.py diff --git a/dbx/templates/projects/python_basic/render/{{cookiecutter.project_name}}/{{cookiecutter.project_slug}}/__init__.py b/src/dbx/templates/projects/python_basic/render/{{cookiecutter.project_name}}/{{cookiecutter.project_slug}}/__init__.py similarity index 100% rename from dbx/templates/projects/python_basic/render/{{cookiecutter.project_name}}/{{cookiecutter.project_slug}}/__init__.py rename to src/dbx/templates/projects/python_basic/render/{{cookiecutter.project_name}}/{{cookiecutter.project_slug}}/__init__.py diff --git a/dbx/templates/projects/python_basic/render/{{cookiecutter.project_name}}/{{cookiecutter.project_slug}}/common.py b/src/dbx/templates/projects/python_basic/render/{{cookiecutter.project_name}}/{{cookiecutter.project_slug}}/common.py similarity index 100% rename from dbx/templates/projects/python_basic/render/{{cookiecutter.project_name}}/{{cookiecutter.project_slug}}/common.py rename to src/dbx/templates/projects/python_basic/render/{{cookiecutter.project_name}}/{{cookiecutter.project_slug}}/common.py diff --git a/src/dbx/templates/projects/python_basic/render/{{cookiecutter.project_name}}/{{cookiecutter.project_slug}}/tasks/__init__.py b/src/dbx/templates/projects/python_basic/render/{{cookiecutter.project_name}}/{{cookiecutter.project_slug}}/tasks/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/dbx/templates/projects/python_basic/render/{{cookiecutter.project_name}}/{{cookiecutter.project_slug}}/tasks/sample_etl_task.py b/src/dbx/templates/projects/python_basic/render/{{cookiecutter.project_name}}/{{cookiecutter.project_slug}}/tasks/sample_etl_task.py similarity index 100% rename from dbx/templates/projects/python_basic/render/{{cookiecutter.project_name}}/{{cookiecutter.project_slug}}/tasks/sample_etl_task.py rename to src/dbx/templates/projects/python_basic/render/{{cookiecutter.project_name}}/{{cookiecutter.project_slug}}/tasks/sample_etl_task.py diff --git a/dbx/templates/projects/python_basic/render/{{cookiecutter.project_name}}/{{cookiecutter.project_slug}}/tasks/sample_ml_task.py b/src/dbx/templates/projects/python_basic/render/{{cookiecutter.project_name}}/{{cookiecutter.project_slug}}/tasks/sample_ml_task.py similarity index 100% rename from dbx/templates/projects/python_basic/render/{{cookiecutter.project_name}}/{{cookiecutter.project_slug}}/tasks/sample_ml_task.py rename to src/dbx/templates/projects/python_basic/render/{{cookiecutter.project_name}}/{{cookiecutter.project_slug}}/tasks/sample_ml_task.py diff --git a/dbx/types.py b/src/dbx/types.py similarity index 100% rename from dbx/types.py rename to src/dbx/types.py diff --git a/dbx/utils/__init__.py b/src/dbx/utils/__init__.py similarity index 100% rename from dbx/utils/__init__.py rename to src/dbx/utils/__init__.py diff --git a/dbx/utils/common.py b/src/dbx/utils/common.py similarity index 100% rename from dbx/utils/common.py rename to src/dbx/utils/common.py diff --git a/dbx/utils/file_uploader.py b/src/dbx/utils/file_uploader.py similarity index 100% rename from dbx/utils/file_uploader.py rename to src/dbx/utils/file_uploader.py diff --git a/dbx/utils/json.py b/src/dbx/utils/json.py similarity index 100% rename from dbx/utils/json.py rename to src/dbx/utils/json.py diff --git a/dbx/utils/url.py b/src/dbx/utils/url.py similarity index 100% rename from dbx/utils/url.py rename to src/dbx/utils/url.py diff --git a/tests/unit/conftest.py b/tests/unit/conftest.py index 0337180d..1250c3f2 100644 --- a/tests/unit/conftest.py +++ b/tests/unit/conftest.py @@ -56,7 +56,14 @@ def invoke_cli_runner(*args, **kwargs): def initialize_cookiecutter(project_name): - init(template="python_basic", path=None, package=None, parameters=[f"project_name={project_name}"], no_input=True) + init( + template="python_basic", + path=None, + package=None, + parameters=[f"project_name={project_name}"], + no_input=True, + checkout=None, + ) @contextlib.contextmanager