Commit 7813ca4
authored
chore: add missing nox sessions and polish dependencies in sqlalchemy-spanner (googleapis#17285)
## Description
This PR implements missing nox sessions and refactors dependency
management inside `packages/sqlalchemy-spanner/noxfile.py` to align with
google-cloud standard practices.
---
## Key Changes
### 1. Constants Architecture
All dependencies and version definitions have been concentrated at the
top of `noxfile.py` in nestled constants:
* `UNIT_TEST_STANDARD_DEPENDENCIES`: Standard testing frameworks
(`mock`, `pytest`).
* `UNIT_TEST_EXTERNAL_DEPENDENCIES`: Telemetry requirements (fully
unpinned: `setuptools`, `opentelemetry-api`, `opentelemetry-sdk`,
`opentelemetry-instrumentation` to delegate version resolution strictly
to `setup.py` and `constraints`).
* `UNIT_TEST_DEPENDENCIES`: SQLAlchemy version specifications under test
(`sqlalchemy>=2.0`).
### 2. Expired database management
Updated the `create_test_database.py` file to add or tweak code to
ensure that expired databases are quickly deleted. During rapid
development cycles, the Spanner database count would quickly reach the
Spanner limit of 100 and system tests would fail. There were two
conditions that contributed being unable to quickly retest. In some
cases the system would not delete old databases at all because certain
triggers were not created. And in other cases, you needed to wait 4
hours before the databases would age off and you could run the system
tests again.
### NOTES:
* **`core_deps_from_source` & `prerelease_deps`**: Target packages are
cleanly overwritten with local source paths/pre-releases using pip's
native `--ignore-installed --no-deps` flags.
* **`mypy` & `docs` & `docfx`**: Configured to skip gracefully with
standard todos indicating that typehints and docs folders are not
present in this package.
* **`cover`**: Added standard coverage session which skips gracefully if
no `.coverage` database file has been created yet.
* **`format`**: Implemented Ruff format and check sessions, and
reformatted imports and code to team standards.
Fixes googleapis#17048 🦖1 parent 522d192 commit 7813ca4
80 files changed
Lines changed: 943 additions & 676 deletions
File tree
- packages/sqlalchemy-spanner
- google/cloud/sqlalchemy_spanner
- samples
- tests
- mockserver_tests
- system
- unit
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
68 | 69 | | |
69 | 70 | | |
70 | 71 | | |
71 | | - | |
72 | | - | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
73 | 80 | | |
74 | 81 | | |
75 | 82 | | |
76 | 83 | | |
77 | 84 | | |
78 | 85 | | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
84 | 96 | | |
85 | 97 | | |
86 | 98 | | |
| |||
Lines changed: 0 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | 16 | | |
18 | 17 | | |
19 | | - | |
20 | 18 | | |
Lines changed: 0 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | 19 | | |
21 | 20 | | |
22 | 21 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | 16 | | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
Lines changed: 20 additions & 36 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | 15 | | |
17 | 16 | | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
30 | | - | |
31 | | - | |
| 29 | + | |
| 30 | + | |
32 | 31 | | |
33 | 32 | | |
34 | 33 | | |
| 34 | + | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
37 | 38 | | |
38 | | - | |
| 39 | + | |
| 40 | + | |
39 | 41 | | |
40 | 42 | | |
41 | 43 | | |
42 | 44 | | |
43 | | - | |
44 | | - | |
| 45 | + | |
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
48 | | - | |
49 | 49 | | |
50 | | - | |
51 | 50 | | |
52 | | - | |
53 | 51 | | |
54 | | - | |
| 52 | + | |
55 | 53 | | |
56 | 54 | | |
57 | 55 | | |
| |||
223 | 221 | | |
224 | 222 | | |
225 | 223 | | |
226 | | - | |
227 | | - | |
228 | | - | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
229 | 227 | | |
230 | 228 | | |
231 | 229 | | |
| |||
416 | 414 | | |
417 | 415 | | |
418 | 416 | | |
419 | | - | |
| 417 | + | |
420 | 418 | | |
421 | 419 | | |
422 | 420 | | |
| |||
1025 | 1023 | | |
1026 | 1024 | | |
1027 | 1025 | | |
1028 | | - | |
1029 | | - | |
1030 | | - | |
| 1026 | + | |
1031 | 1027 | | |
1032 | 1028 | | |
1033 | 1029 | | |
| |||
1056 | 1052 | | |
1057 | 1053 | | |
1058 | 1054 | | |
1059 | | - | |
1060 | | - | |
1061 | | - | |
| 1055 | + | |
1062 | 1056 | | |
1063 | 1057 | | |
1064 | 1058 | | |
| |||
1087 | 1081 | | |
1088 | 1082 | | |
1089 | 1083 | | |
1090 | | - | |
1091 | | - | |
1092 | | - | |
| 1084 | + | |
1093 | 1085 | | |
1094 | 1086 | | |
1095 | 1087 | | |
| |||
1623 | 1615 | | |
1624 | 1616 | | |
1625 | 1617 | | |
1626 | | - | |
1627 | | - | |
1628 | | - | |
| 1618 | + | |
1629 | 1619 | | |
1630 | 1620 | | |
1631 | 1621 | | |
| |||
1661 | 1651 | | |
1662 | 1652 | | |
1663 | 1653 | | |
1664 | | - | |
1665 | | - | |
1666 | | - | |
| 1654 | + | |
1667 | 1655 | | |
1668 | 1656 | | |
1669 | 1657 | | |
| |||
1696 | 1684 | | |
1697 | 1685 | | |
1698 | 1686 | | |
1699 | | - | |
1700 | | - | |
1701 | | - | |
| 1687 | + | |
1702 | 1688 | | |
1703 | 1689 | | |
1704 | 1690 | | |
| |||
1723 | 1709 | | |
1724 | 1710 | | |
1725 | 1711 | | |
1726 | | - | |
1727 | | - | |
1728 | | - | |
| 1712 | + | |
1729 | 1713 | | |
1730 | 1714 | | |
1731 | 1715 | | |
| |||
0 commit comments