File tree 1 file changed +18
-0
lines changed
1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change 3
3
4
4
here = Path (__file__ ).parent
5
5
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
+
6
23
try :
7
24
from setuptools_scm import get_version
8
25
import pytoml
9
26
10
27
proj = pytoml .loads ((here .parent / 'pyproject.toml' ).read_text ())
11
28
metadata = proj ['tool' ]['flit' ]['metadata' ]
12
29
30
+ refresh_entry_points ()
13
31
__version__ = get_version (root = '..' , relative_to = __file__ )
14
32
__author__ = metadata ['author' ]
15
33
__email__ = metadata ['author-email' ]
You can’t perform that action at this time.
0 commit comments