8000 0.8.2 (#72) · pwwang/python-varname@47f2852 · GitHub
[go: up one dir, main page]

Skip to content

Commit 47f2852

Browse files
authored
0.8.2 (#72)
* 🩹 Use sysconfig instead of distutils.sysconfig to avoid deprecatewarning for python 3.10+ * 👷 Add python3.10 in CI * 🔖 0.8.2
1 parent 2ebc654 commit 47f2852

File tree

5 files changed

+22
-7
lines changed

5 files changed

+22
-7
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
runs-on: ubuntu-latest
1414
strategy:
1515
matrix:
16-
python-version: [3.6, 3.7, 3.8, 3.9]
16+
python-version: [3.6, 3.7, 3.8, 3.9, "3.10"]
1717

1818
steps:
1919
- uses: actions/checkout@v2

docs/CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
1+
## v0.8.2
2+
3+
### Fixes
4+
- 🩹 Use sysconfig instead of distutils.sysconfig to avoid deprecatewarning for python 3.10+
5+
6+
### Housekeeping
7+
- 👷 Add python3.10 in CI
8+
- 📄 Add license back
9+
110
## v0.8.1
11+
212
- Handle inspect raises "could not get source code" when printing rich exception message
313

414
## v0.8.0

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "poetry.masonry.api"
44

55
[tool.poetry]
66
name = "varname"
7-
version = "0.8.1"
7+
version = "0.8.2"
88
description = "Dark magics about variable names in python."
99
authors = [ "pwwang <pwwang@pwwang.com>",]
1010
license = "MIT"

varname/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
)
1414
from .core import varname, nameof, will, argname, argname2
1515

16-
__version__ = "0.8.1"
16+
__version__ = "0.8.2"

varname/ignore.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
"""
2020
import sys
2121
import inspect
22-
from distutils import sysconfig
2322
import warnings
2423
from os import path
2524
from pathlib import Path
@@ -30,6 +29,14 @@
3029

3130
from executing import Source
3231

32+
try:
33+
import sysconfig # 3.10+
34+
except ImportError: # pragma: no cover
35+
from distutils import sysconfig
36+
STANDLIB_PATH = sysconfig.get_python_lib(standard_lib=True)
37+
else:
38+
STANDLIB_PATH = sysconfig.get_path('stdlib')
39+
3340
from .utils import (
3441
IgnoreElemType,
3542
IgnoreType,
@@ -317,9 +324,7 @@ def create(
317324
ignore = [ignore]
318325

319326
ignore_list = [
320-
IgnoreStdlib( # type: ignore
321-
sysconfig.get_python_lib(standard_lib=True)
322-
)
327+
IgnoreStdlib(STANDLIB_PATH) # type: ignore
323328
] # type: List[IgnoreElem]
324329
if ignore_varname:
325330
ignore_list.append(create_ignore_elem(sys.modules[__package__]))

0 commit comments

Comments
 (0)
0