File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change 33
44here = Path (__file__ ).parent
55
6+
7+ def refresh_entry_points ():
8+ """\
9+ Under some circumstances, (e.g. when installing a PEP 517 package via pip),
10+ pkg_resources.working_set.entries is stale. This tries to fix that.
11+ """
12+ try :
13+ import sys
14+ import pkg_resources
15+
16+ ws : pkg_resources .WorkingSet = pkg_resources .working_set
17+ for entry in sys .path :
18+ ws .add_entry (entry )
19+ except Exception :
20+ pass
21+
22+
623try :
724 from setuptools_scm import get_version
825 import pytoml
926
1027 proj = pytoml .loads ((here .parent / 'pyproject.toml' ).read_text ())
1128 metadata = proj ['tool' ]['flit' ]['metadata' ]
1229
30+ refresh_entry_points ()
1331 __version__ = get_version (root = '..' , relative_to = __file__ )
1432 __author__ = metadata ['author' ]
1533 __email__ = metadata ['author-email' ]
You can’t perform that action at this time.
0 commit comments