Skip to content

Commit be454b1

Browse files
author
Alexander Ororbia
committed
patched pkg_resources to align w/ ngclearn v3.1.0 - this is now ngcsimlib v3.1.0
1 parent 0300a9b commit be454b1

3 files changed

Lines changed: 16 additions & 6 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ $ pip install --editable . # OR pip install -e .
4141
</pre>
4242

4343
**Version:**<br>
44-
3.0.0 <!-- -Beta --> <!-- -Alpha -->
44+
3.1.0 <!-- -Beta --> <!-- -Alpha -->
4545

4646
Authors:
4747
William Gebhardt, Alexander G. Ororbia II<br>

ngcsimlib/__init__.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,22 @@
44
from ngcsimlib._src.deprecators import deprecated, deprecate_args
55
from ngcsimlib._src.configManager import init_config
66
from ngcsimlib._src.configManager import get_config, provide_namespace
7-
import argparse, os, json
7+
import sys, argparse, os, json
88

9-
import pkg_resources
10-
from pkg_resources import get_distribution
9+
########################################################################################################################
10+
if sys.version_info >= (3, 8): ## for new versions of python/ngc-learn
11+
from importlib.metadata import version, distributions, PackageNotFoundError
12+
else: ## for older versions of python before 3.8
13+
from importlib_metadata import version, distributions, PackageNotFoundError
1114

12-
__version__ = get_distribution('ngcsimlib').version
15+
## Following obtains ngc-learn's version
16+
from importlib.metadata import version
17+
__version__ = version("ngcsimlib")
18+
19+
## these two lines below are deprecated if using newer python(s) (had to do this for ngc-learn)
20+
# from pkg_resources import get_distribution
21+
# __version__ = get_distribution('ngcsimlib').version
22+
########################################################################################################################
1323

1424
def configure():
1525
parser = argparse.ArgumentParser(description='Build and run a model using ngclearn')

pyproject.toml

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

55
[project]
66
name = "ngcsimlib"
7-
version = "3.0.0"
7+
version = "3.1.0"
88

99
description = "Simulation software backend for ngc-learn."
1010
authors = [

0 commit comments

Comments
 (0)