Skip to content

Commit 92a7306

Browse files
Add info about environment refreshes (#155)
1 parent a11ae80 commit 92a7306

File tree

1 file changed

+61
-0
lines changed

1 file changed

+61
-0
lines changed

CONTRIBUTING.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,3 +171,64 @@ Here are the example steps to submit your first contribution:
171171
request description to [automatically link it](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/using-keywords-in-issues-and-pull-requests#linking-a-pull-request-to-an-issue)
172172
to an existing issue.
173173
14. announce PR for the review
174+
175+
## Troubleshooting
176+
177+
### Environment Issues
178+
179+
Sometimes, when dependencies are updated via `dependabot` for example, the environment may report the following error:
180+
181+
```sh
182+
$ hatch run unit:test-cov-report
183+
ERROR: Cannot install databricks-labs-ucx[test]==0.0.3 and databricks-sdk~=0.8.0 because these package versions have conflicting dependencies.
184+
ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts
185+
```
186+
187+
The easiest fix is to remove the environment and have the re-run recreate it:
188+
189+
```sh
190+
`
191+
$ hatch env show
192+
Standalone
193+
┏━━━━━━━━━━━━━┳━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━┓
194+
┃ Name ┃ Type ┃ Dependencies ┃ Scripts ┃
195+
┡━━━━━━━━━━━━━╇━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━┩
196+
│ default │ virtual │ │ │
197+
├─────────────┼─────────┼────────────────────────────────┼─────────────────┤
198+
│ unit │ virtual │ databricks-labs-ucx[test] │ test
199+
│ │ │ delta-spark<3.0.0,>=2.4.0 │ test-cov-report │
200+
│ │ │ pyspark<=3.5.0,>=3.4.0 │ │
201+
├─────────────┼─────────┼────────────────────────────────┼─────────────────┤
202+
│ integration │ virtual │ databricks-labs-ucx[dbconnect] │ test
203+
│ │ │ databricks-labs-ucx[test] │ │
204+
│ │ │ delta-spark<3.0.0,>=2.4.0 │ │
205+
├─────────────┼─────────┼────────────────────────────────┼─────────────────┤
206+
│ lint │ virtual │ black>=23.1.0 │ fmt │
207+
│ │ │ isort>=2.5.0 │ verify │
208+
│ │ │ ruff>=0.0.243 │ │
209+
└─────────────┴─────────┴────────────────────────────────┴─────────────────┘
210+
211+
$ hatch env remove unit
212+
$ hatch run unit:test-cov-report
213+
========================================================================================== test session starts ===========================================================================================
214+
platform darwin -- Python 3.11.4, pytest-7.4.1, pluggy-1.3.0 -- /Users/lars.george/Library/Application Support/hatch/env/virtual/databricks-labs-ucx/H6b8Oom-/unit/bin/python
215+
cachedir: .pytest_cache
216+
rootdir: /Users/lars.george/projects/work/databricks/ucx
217+
configfile: pyproject.toml
218+
plugins: cov-4.1.0, mock-3.11.1
219+
collected 103 items
220+
221+
tests/unit/test_config.py::test_initialization PASSED
222+
tests/unit/test_config.py::test_reader PASSED
223+
...
224+
tests/unit/test_tables.py::test_uc_sql[table1-CREATE VIEW IF NOT EXISTS new_catalog.db.view AS SELECT * FROM table;] PASSED
225+
tests/unit/test_tables.py::test_uc_sql[table2-CREATE TABLE IF NOT EXISTS new_catalog.db.external_table LIKE catalog.db.external_table COPY LOCATION;ALTER TABLE catalog.db.external_table SET TBLPROPERTIES ('upgraded_to' = 'new_catalog.db.external_table');] PASSED
226+
227+
---------- coverage: platform darwin, python 3.11.4-final-0 ----------
228+
Coverage HTML written to dir htmlcov
229+
230+
========================================================================================== 103 passed in 12.61s ==========================================================================================
231+
$
232+
```
233+
234+
Note: The initial `hatch env show` is just to list the environments managed by Hatch and is not needed.

0 commit comments

Comments
 (0)