File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1414from rad import resources
1515from rad ._parser import archive_schema , super_schema
1616
17- DIRECT_URL = json .loads (Distribution .from_name ("rad" ).read_text ("direct_url.json" ))
18- # Needs to be a bit complicated because tox still creates a wheel, it just does it a bit differently
19- # to preserve editable installs
20- IS_EDITABLE = DIRECT_URL ["dir_info" ].get ("editable" , False ) if "dir_info" in DIRECT_URL else "editable" in DIRECT_URL ["url" ]
17+ _DIRECT_URL = Distribution .from_name ("rad" ).read_text ("direct_url.json" )
18+
19+ # If no text is found, then you maybe running from a directory with a `rad` subdirectory
20+ # Distribution will then search for `rad` within that subdirectory, so we assume not editable
21+ if _DIRECT_URL is None :
22+ IS_EDITABLE = False
23+ else :
24+ _DIRECT_URL_JSON = json .loads (_DIRECT_URL )
25+ # Needs to be a bit complicated because tox still creates a wheel, it just does it a bit differently
26+ # to preserve editable installs
27+ IS_EDITABLE = (
28+ _DIRECT_URL_JSON ["dir_info" ].get ("editable" , False )
29+ if "dir_info" in _DIRECT_URL_JSON
30+ else "editable" in _DIRECT_URL_JSON ["url" ]
31+ )
2132
2233
2334class TestLastestResources :
You can’t perform that action at this time.
0 commit comments