| Summary: | Util scanpypi failes when package change - to _ in tar file (Trunk) | ||
|---|---|---|---|
| Product: | buildroot | Reporter: | mzweerspenko+bugzilla |
| Component: | Other | Assignee: | yegorslists |
| Status: | RESOLVED FIXED | ||
| Severity: | minor | CC: | buildroot |
| Priority: | P5 | ||
| Version: | 2018.05 | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Host: | Target: | ||
| Build: | |||
|
Description
mzweerspenko+bugzilla
2018-08-21 08:23:26 UTC
I now notice that the tar file has the same _. Ok. My end goal was to add socketio-client-nexus. I got the error when scanpypi is resolving dependencies. I tried to keep my bug report as small as possible.
I have made workaround. But python is new to me.
def load_setup(self):
"""
Loads the corresponding setup and store its metadata
"""
current_dir = os.getcwd()
self.tmp_extract = os.path.join(os.path.dirname(self.tmp_extract),self.filename.split(".tar")[0])
#print("MGZ: {0} {1}".format(self.tmp_extract,extract_dir))
os.chdir(self.tmp_extract)
sys.path.append(self.tmp_extract)
s_file, s_path, s_desc = imp.find_module('setup', [self.tmp_extract])
setup = imp.load_module('setup', s_file, s_path, s_desc)
try:
self.setup_metadata = self.setup_args[self.metadata_name]
except KeyError:
# This means setup was not called which most likely mean that it is
# called through the if __name__ == '__main__' directive.
# In this case, we can only pray that it is called through a
# function called main() in setup.py.
setup.main() # Will raise AttributeError if not found
self.setup_metadata = self.setup_args[self.metadata_name]
# Here we must remove the module the hard way.
# We must do this because of a very specific case: if a package calls
# setup from the __main__ but does not come with a 'main()' function,
# for some reason setup.main() will successfully call the main
# function of a previous package...
sys.modules.pop('setup', None)
del setup
os.chdir(current_dir)
sys.path.remove(self.tmp_extract)
Please send your patch using git send-email via BR's mailing list. See http://nightly.buildroot.org/manual.html#submitting-patches for more information. Yegor, it seems like the person who submitted this bug never submitted a proper patch to the mailing list. Could you take care of submitting such a patch, so that we can close this bug ? Thanks a lot! Fixed by https://git.buildroot.org/buildroot/commit/?id=fd29797f659c09cbc2aeba33f8d6f5b992e65cd4. Thanks Yegor! |