Skip to content

Commit 7f5cafd

Browse files
authored
Remove imp dependency and test on python 3.12 (#673)
* Remove imp dependency and test on python 3.12 * inline version * one more tweak * do not lint on 3.12
1 parent 682dc6f commit 7f5cafd

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

.github/workflows/push.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- '3.9'
1717
- '3.10'
1818
- '3.11'
19-
19+
- '3.12'
2020
env:
2121
PYTHON_VERSION: ${{ matrix.python-version }}
2222
steps:
@@ -29,7 +29,7 @@ jobs:
2929
python-version: ${{ matrix.python-version }}
3030

3131
- name: Install pip
32-
run: pip install --upgrade pip
32+
run: pip install --upgrade pip setuptools
3333

3434
- name: Install development dependencies
3535
run: pip install --upgrade -r dev-requirements.txt
@@ -41,6 +41,7 @@ jobs:
4141
run: pytest tests --cov=./
4242

4343
- name: Run lint
44+
if: matrix.python-version != '3.12' # new lint rules in 3.12 don't pass
4445
run: prospector --profile ./prospector.yaml -t dodgy -t mccabe -t profile-validator -t pyflakes -t pylint
4546

4647
- name: Run rstcheck
@@ -61,7 +62,7 @@ jobs:
6162
- '3.9'
6263
- '3.10'
6364
- '3.11'
64-
65+
- '3.12'
6566
env:
6667
PYTHON_VERSION: ${{ matrix.python-version }}
6768
steps:
@@ -74,7 +75,7 @@ jobs:
7475
python-version: ${{ matrix.python-version }}
7576

7677
- name: Install pip
77-
run: pip install --upgrade pip
78+
run: pip install --upgrade pip setuptools
7879

7980
- name: Install dependencies
8081
run: |

setup.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,14 @@
2121
# See the License for the specific language governing permissions and
2222
# limitations under the License.
2323

24-
import imp
2524
import io
2625
import os
2726
from setuptools import setup, find_packages
27+
from importlib.machinery import SourceFileLoader
2828

29-
version = imp.load_source(
30-
'databricks_cli.version', os.path.join('databricks_cli', 'version.py')).version
29+
path_to_module = os.path.join('databricks_cli', 'version.py')
30+
loaded_module = SourceFileLoader('databricks_cli.version', path_to_module).load_module()
31+
version = loaded_module.version
3132

3233
setup(
3334
name='databricks-cli',

0 commit comments

Comments
 (0)