Skip to content

Commit 4f8bc3e

Browse files
⬆️ upgrade dependencies (#863)
* 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
1 parent 1a7bcd5 commit 4f8bc3e

File tree

150 files changed

+217
-221
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

150 files changed

+217
-221
lines changed

.github/workflows/onpush.yml

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,42 +12,44 @@ jobs:
1212
strategy:
1313
max-parallel: 4
1414
matrix:
15-
python-version: [ '3.9' ]
15+
python-version: [ '3.8' ]
1616
os: [ ubuntu-latest, windows-latest ]
1717

1818
steps:
19-
- uses: actions/checkout@v3
20-
with:
21-
fetch-depth: 0
19+
- uses: actions/checkout@v4
2220

23-
- name: Set up Python ${{ matrix.python-version }}
24-
uses: actions/setup-python@v4
21+
- name: Set up Python
22+
uses: actions/setup-python@v5
2523
with:
2624
python-version: ${{ matrix.python-version }}
27-
cache: 'pip' # caching pip dependencies
28-
cache-dependency-path: setup.py
25+
cache: 'pip'
2926

3027
- name: Install pip
3128
run: python -m pip install --upgrade pip
3229

3330
- name: Install package and dependencies
34-
run: pip install -U -e ".[dev]"
31+
run: |
32+
python -m pip install --upgrade pip
33+
pip install hatch
34+
hatch run sync
3535
3636
- name: Lint
3737
run: |
38-
prospector --profile prospector.yaml
39-
black --check .
38+
hatch run prospector --profile prospector.yaml
39+
hatch run black --check .
4040
4141
- name: Run unit tests
4242
run: |
4343
git config --global init.defaultBranch main # to avoid verbose deprecation messages in CI pipeline
44-
pytest tests/unit --cov dbx -n auto
44+
hatch run pytest tests/unit --cov dbx -n auto
4545
4646
- name: Run integrity tests
4747
run: |
48-
python -m dbx --help
49-
python -c "import dbx; print(dbx.__version__)"
48+
hatch run python -m dbx --help
49+
hatch run python -c "from dbx._version import __version__; print(__version__)"
5050
5151
- name: Publish test coverage
5252
if: startsWith(matrix.os,'ubuntu')
53-
uses: codecov/codecov-action@v1
53+
uses: codecov/codecov-action@v4
54+
with:
55+
token: ${{ secrets.CODECOV_TOKEN }} # required

.github/workflows/onrelease.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,25 @@ jobs:
1515
os: [ ubuntu-latest ]
1616

1717
steps:
18-
- uses: actions/checkout@v3
19-
with:
20-
fetch-depth: 0
18+
- uses: actions/checkout@v4
2119

22-
- name: Set up Python ${{ matrix.python-version }}
23-
uses: actions/setup-python@v4
20+
- name: Set up Python
21+
uses: actions/setup-python@v5
2422
with:
2523
python-version: ${{ matrix.python-version }}
26-
cache: 'pip' # caching pip dependencies
27-
cache-dependency-path: setup.py
24+
cache: 'pip'
2825

2926
- name: Install pip
3027
run: python -m pip install --upgrade pip
3128

32-
- name: Install dependencies
33-
run: pip install -U -e ".[dev]"
29+
- name: Install package and dependencies
30+
run: |
31+
python -m pip install --upgrade pip
32+
pip install hatch
33+
hatch run sync
3434
3535
- name: Build dist
36-
run: pip wheel -w dist . --no-deps
36+
run: hatch build -c -t wheel
3737

3838
- name: Publish a Python distribution to PyPI
3939
uses: pypa/gh-action-pypi-publish@release/v1

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,3 +93,4 @@ out/
9393

9494
site/
9595
.dbx/
96+
src/dbx/_version.py

LICENSE

Lines changed: 63 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,69 @@
1-
DataBricks eXtensions aka dbx
1+
Databricks License
2+
Copyright (2021) Databricks, Inc.
23

3-
Copyright (2021) Databricks, Inc.
4+
Definitions.
5+
6+
Agreement: The agreement between Databricks, Inc., and you governing
7+
the use of the Databricks Services, as that term is defined in
8+
the Master Cloud Services Agreement (MCSA) located at
9+
www.databricks.com/legal/mcsa.
10+
11+
Licensed Materials: The source code, object code, data, and/or other
12+
works to which this license applies.
413

5-
This library (the "Software") may not be used except in connection with the Licensee's use of the Databricks Platform Services pursuant
6-
to an Agreement (defined below) between Licensee (defined below) and Databricks, Inc. ("Databricks"). The Object Code version of the
7-
Software shall be deemed part of the Downloadable Services under the Agreement, or if the Agreement does not define Downloadable Services,
8-
Subscription Services, or if neither are defined then the term in such Agreement that refers to the applicable Databricks Platform
9-
Services (as defined below) shall be substituted herein for “Downloadable Services.” Licensee's use of the Software must comply at
10-
all times with any restrictions applicable to the Downloadable Services and Subscription Services, generally, and must be used in
11-
accordance with any applicable documentation. For the avoidance of doubt, the Software constitutes Databricks Confidential Information
12-
under the Agreement.
14+
Scope of Use. You may not use the Licensed Materials except in
15+
connection with your use of the Databricks Services pursuant to
16+
the Agreement. Your use of the Licensed Materials must comply at all
17+
times with any restrictions applicable to the Databricks Services,
18+
generally, and must be used in accordance with any applicable
19+
documentation. You may view, use, copy, modify, publish, and/or
20+
distribute the Licensed Materials solely for the purposes of using
21+
the Licensed Materials within or connecting to the Databricks Services.
22+
If you do not agree to these terms, you may not view, use, copy,
23+
modify, publish, and/or distribute the Licensed Materials.
24+
25+
Redistribution. You may redistribute and sublicense the Licensed
26+
Materials so long as all use is in compliance with these terms.
27+
In addition:
28+
29+
- You must give any other recipients a copy of this License;
30+
- You must cause any modified files to carry prominent notices
31+
stating that you changed the files;
32+
- You must retain, in any derivative works that you distribute,
33+
all copyright, patent, trademark, and attribution notices,
34+
excluding those notices that do not pertain to any part of
35+
the derivative works; and
36+
- If a "NOTICE" text file is provided as part of its
37+
distribution, then any derivative works that you distribute
38+
must include a readable copy of the attribution notices
39+
contained within such NOTICE file, excluding those notices
40+
that do not pertain to any part of the derivative works.
1341

14-
Additionally, and notwithstanding anything in the Agreement to the contrary:
15-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
16-
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
17-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
18-
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19-
* you may view, make limited copies of, and may compile the Source Code version of the Software into an Object Code version of the
20-
Software. For the avoidance of doubt, you may not make derivative works of Software (or make any any changes to the Source Code
21-
version of the unless you have agreed to separate terms with Databricks permitting such modifications (e.g., a contribution license
22-
agreement)).
42+
You may add your own copyright statement to your modifications and may
43+
provide additional license terms and conditions for use, reproduction,
44+
or distribution of your modifications, or for any such derivative works
45+
as a whole, provided your use, reproduction, and distribution of
46+
the Licensed Materials otherwise complies with the conditions stated
47+
in this License.
2348

24-
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
25-
the Source Code of the Software.
26-
27-
This license terminates automatically upon the termination of the Agreement or Licensee's breach of these terms. Additionally,
28-
Databricks may terminate this license at any time on notice. Upon termination, you must permanently delete the Software and all
29-
copies thereof (including the Source Code).
49+
Termination. This license terminates automatically upon your breach of
50+
these terms or upon the termination of your Agreement. Additionally,
51+
Databricks may terminate this license at any time on notice. Upon
52+
termination, you must permanently delete the Licensed Materials and
53+
all copies thereof.
3054

31-
Agreement: the agreement between Databricks and Licensee governing the use of the Databricks Platform Services, which shall be, with
32-
respect to Databricks, the Databricks Terms of Service located at www.databricks.com/termsofservice, and with respect to Databricks
33-
Community Edition, the Community Edition Terms of Service located at www.databricks.com/ce-termsofuse, in each case unless Licensee
34-
has entered into a separate written agreement with Databricks governing the use of the applicable Databricks Platform Services.
35-
36-
Databricks Platform Services: the Databricks services or the Databricks Community Edition services, according to where the Software is used.
55+
DISCLAIMER; LIMITATION OF LIABILITY.
3756

38-
Licensee: the user of the Software, or, if the Software is being used on behalf of a company, the company.
39-
40-
Object Code: is version of the Software produced when an interpreter or a compiler translates the Source Code into recognizable and
41-
executable machine code.
42-
43-
Source Code: the human readable portion of the Software.
57+
THE LICENSED MATERIALS ARE PROVIDED “AS-IS” AND WITH ALL FAULTS.
58+
DATABRICKS, ON BEHALF OF ITSELF AND ITS LICENSORS, SPECIFICALLY
59+
DISCLAIMS ALL WARRANTIES RELATING TO THE LICENSED MATERIALS, EXPRESS
60+
AND IMPLIED, INCLUDING, WITHOUT LIMITATION, IMPLIED WARRANTIES,
61+
CONDITIONS AND OTHER TERMS OF MERCHANTABILITY, SATISFACTORY QUALITY OR
62+
FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. DATABRICKS AND
63+
ITS LICENSORS TOTAL AGGREGATE LIABILITY RELATING TO OR ARISING OUT OF
64+
YOUR USE OF OR DATABRICKS’ PROVISIONING OF THE LICENSED MATERIALS SHALL
65+
BE LIMITED TO ONE THOUSAND ($1,000) DOLLARS. IN NO EVENT SHALL
66+
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
67+
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
68+
ARISING FROM, OUT OF OR IN CONNECTION WITH THE LICENSED MATERIALS OR
69+
THE USE OR OTHER DEALINGS IN THE LICENSED MATERIALS.

Makefile

Lines changed: 14 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,6 @@
1111
SHELL=/bin/bash
1212

1313

14-
##############################################################################
15-
PYTHON_VERSION=3.8.13
16-
VENV_NAME := $(shell [ -d venv ] && echo venv || echo .venv)
17-
VENV_DIR=${VENV_NAME}
18-
PYTHON=${VENV_DIR}/bin/python
19-
RSTCHECK=${VENV_DIR}/bin/rstcheck
20-
SPHINX_AUTOBUILD=${VENV_DIR}/bin/sphinx-autobuild
21-
SPHINX_BUILD=${VENV_DIR}/bin/sphinx-build
2214
##############################################################################
2315

2416
##############################################################################
@@ -84,12 +76,11 @@ clean: ## Clean .venv, dist, build
8476
@echo ""
8577
@echo "${YELLOW}Removing virtual environment ${NORMAL}"
8678
@make helper-line
87-
-rm .python-version
79+
hatch env remove
8880

8981
@echo ""
9082
@echo "${YELLOW}Remove temp files${NORMAL}"
9183
@make helper-line
92-
-rm -rf $(VENV_DIR)
9384
-rm -rf dist/*
9485
-rm -rf build/*
9586
-rm -rf dbx.egg-info/*
@@ -103,52 +94,25 @@ clean: ## Clean .venv, dist, build
10394

10495
@make docs-clean
10596

106-
##############################################################################
107-
# This chaining exists so that the virtual env target will not be invoked multiple times.
108-
# This config works because there is a file at this path "$(VENV_NAME)/bin/activate"
109-
# Once that file is created, it will not be change unless you run "make clean".
110-
# If the file did not change, then the target below with same name will be skipped.
111-
venv: $(VENV_NAME)/bin/activate
112-
113-
$(VENV_NAME)/bin/activate:
114-
@echo ""
115-
@echo "${YELLOW}Init pyenv${NORMAL}"
116-
@make helper-line
117-
pyenv install -s ${PYTHON_VERSION}
118-
pyenv local ${PYTHON_VERSION}
119-
120-
@echo ""
121-
@echo "${YELLOW}Current python:${NORMAL}"
122-
@make helper-line
123-
@python --version
124-
125-
@echo ""
126-
@echo "${YELLOW}Init venv in ${VENV_DIR}${NORMAL}"
127-
@make helper-line
128-
test -d $(VENV_NAME) || python -m venv $(VENV_NAME)
129-
130-
@echo ""
131-
@echo "${YELLOW}Using ${PYTHON}${NORMAL}"
132-
@make helper-line
133-
$(PYTHON) --version
134-
$(PYTHON) -m pip install --upgrade pip
135-
13697

13798
##############################################################################
13899

139-
install: venv install-e install-dev post-install-info ## >>> MAIN TARGET. Run this to start. <<<
100+
create-env:
101+
hatch env create
102+
103+
install: create-env install-e install-dev post-install-info ## >>> MAIN TARGET. Run this to start. <<<
140104

141105
install-e: ## Install project as editable.
142106
@echo ""
143107
@echo "${YELLOW}Install project as editable${NORMAL}"
144108
@make helper-line
145-
$(PYTHON) -m pip install -e .
109+
python -m pip install -e .
146110

147111
install-dev: ## Install dev dependencies.
148112
@echo ""
149113
@echo "${YELLOW}Install Dev dependencies.${NORMAL}"
150114
@make helper-line
151-
$(PYTHON) -m pip install -e ".[dev]"
115+
python -m pip install -e ".[dev]"
152116

153117
post-install-info: ## Just some post installation info.
154118
@echo ""
@@ -162,7 +126,7 @@ post-install-info: ## Just some post installation info.
162126
@echo ""
163127
@echo "${YELLOW}Optionally${NORMAL}: If you really need to, you can activate the venv in your"
164128
@echo "terminal shell by running: "
165-
@echo " ${YELLOW}'source .venv/bin/activate'${NORMAL}"
129+
@echo " ${YELLOW}'hatch shell'${NORMAL}"
166130
@echo ""
167131
@echo "This will put any executable python tools installed above in the PATH, allowing you"
168132
@echo "to run the tools from the shell if you really need to."
@@ -175,37 +139,36 @@ lint: ## Run the lint and checks
175139
@echo ""
176140
@echo "${YELLOW}Linting code:${NORMAL}"
177141
@make helper-line
178-
$(PYTHON) -m prospector --profile prospector.yaml
179-
$(RSTCHECK) README.rst
142+
python -m prospector --profile prospector.yaml
180143
@make check
181144

182145
check: ## Run black checks
183146
@echo ""
184147
@echo "${YELLOW}Check code with black:${NORMAL}"
185148
@make helper-line
186-
$(PYTHON) -m black --check .
149+
python -m black --check .
187150

188151
fix: ## fix the code with black formatter.
189152
@echo ""
190153
@echo "${YELLOW}Fixing code with black:${NORMAL}"
191154
@make helper-line
192-
$(PYTHON) -m black .
155+
python -m black .
193156

194157
##############################################################################
195158

196159
test: ## Run the tests. (option): file=tests/path/to/file.py
197160
@echo ""
198161
@echo "${YELLOW}Running tests:${NORMAL}"
199162
@make helper-line
200-
$(PYTHON) -m pytest -vv --cov dbx $(file) -n auto \
163+
python -m pytest -vv --cov dbx $(file) -n auto \
201164
--cov-report=xml \
202165
--cov-report=term-missing:skip-covered
203166

204167
test-with-html-report: ## Run all tests with html reporter.
205168
@echo ""
206169
@echo "${YELLOW}Testing with html report:${NORMAL}"
207170
@make helper-line
208-
$(PYTHON) -m pytest --cov dbx -n auto --cov-report html -s
171+
python -m pytest --cov dbx -n auto --cov-report html -s
209172

210173
##############################################################################
211174

@@ -227,6 +190,4 @@ build: ## Build the package.
227190
@echo ""
228191
@echo "${YELLOW}Building the project:${NORMAL}"
229192
@make helper-line
230-
rm -rf dist/*
231-
rm -rf build/*
232-
$(PYTHON) setup.py clean bdist_wheel
193+
hatch build -c -t wheel

contrib/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ To make e2e runs you'll need a Databricks account, and a configured profile.
1919
### Prerequisites
2020
- `make`: This is the gnu make tool.
2121
- for mac: https://formulae.brew.sh/formula/make
22-
- `pyenv`: https://github.com/pyenv/pyenv
22+
- `hatch`: https://github.com/pypa/hatch
2323

2424
Once you have the pre-requisites installed, you can run project functions like this:
2525

dbx/__init__.py

Lines changed: 0 additions & 1 deletion
This file was deleted.

prospector.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ doc-warnings: false
55
ignore-paths:
66
- build
77
- tests
8-
- dbx/templates
8+
- src/dbx/templates
99

1010
max-line-length: 120
1111

@@ -31,6 +31,7 @@ pylint:
3131
- raise-missing-from # pretty strange requirement with acquaint logic
3232
- broad-except
3333
- arguments-differ
34+
- broad-exception-raised
3435

3536
pycodestyle:
3637
# W293: disabled because we have newlines in docstrings

0 commit comments

Comments
 (0)