File tree Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change 1- import pkg_resources
21try :
3- __version__ = pkg_resources .get_distribution (__name__ ).version
4- except pkg_resources .DistributionNotFound :
5- pass
2+ try :
3+ from importlib import metadata as importlib_metadata # py3.8+ stdlib
4+ except ImportError :
5+ import importlib_metadata # py3.7- shim
6+ __version__ = importlib_metadata .version (__package__ )
7+ except ImportError :
8+ # No importlib_metadata. This shouldn't normally happen, but some people prefer not installing
9+ # packages via pip at all, instead using PYTHONPATH directly or copying the package files into
10+ # `lib/pythonX.Y/site-packages`. Although not a recommended way, we still try to support it.
11+ __version__ = "unknown" # :nocov:
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ def local_scheme(version):
2222 setup_requires = ["wheel" , "setuptools" , "setuptools_scm" ],
2323 install_requires = [
2424 "nmigen>=0.2,<0.4" ,
25+ "importlib_metadata; python_version<'3.8'" ,
2526 ],
2627 packages = find_packages (),
2728 project_urls = {
You can’t perform that action at this time.
0 commit comments