Skip to content

Commit a012634

Browse files
committed
removed dependence on pkg_resources
1 parent a86de88 commit a012634

4 files changed

Lines changed: 12 additions & 51 deletions

File tree

devpack/__init__.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@
33
import datetime
44
import os
55
from warnings import warn
6-
7-
import pkg_resources
8-
6+
from importlib.metadata import PackageNotFoundError
7+
from importlib import resources
98
from apppath import AppPath
109

1110
__project__ = "devpack"
@@ -38,13 +37,13 @@
3837
PROJECT_APP_PATH = AppPath(app_name=PROJECT_NAME, app_author=PROJECT_AUTHOR)
3938
PROJECT_ORGANISATION = "pything"
4039

41-
from warg import dist_is_editable
40+
from warg import package_is_editable
41+
42+
PACKAGE_DATA_PATH = resources.files(PROJECT_NAME) / "data"
4243

43-
distributions = {v.key: v for v in pkg_resources.working_set}
44-
if PROJECT_NAME in distributions:
45-
distribution = distributions[PROJECT_NAME]
46-
DEVELOP = dist_is_editable(distribution)
47-
else:
44+
try:
45+
DEVELOP = package_is_editable(PROJECT_NAME)
46+
except PackageNotFoundError as e:
4847
DEVELOP = True
4948

5049

devpack/batch_tools/alls.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,10 @@ def check_alls(path: Path, *, verbose: bool = True) -> None:
245245
print("WARNING library file with empty __all__ declaration")
246246

247247

248+
def has_multiple_alls() -> bool:
249+
...
250+
251+
248252
def recursive_check_alls(
249253
path: Path,
250254
exclusion_filter: Optional[Iterable[Callable]] = (negate(is_python_package),),

docs/source/conf.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,6 @@
8888
"""
8989
'''
9090

91-
# import pkg_resources
92-
# version = pkg_resources.get_distribution('myproject').version
9391
version = PROJECT_VERSION
9492
release = version # 'master'
9593

tests/req_unit_test.py

Lines changed: 0 additions & 40 deletions
This file was deleted.

0 commit comments

Comments
 (0)