Skip to content

Commit

Permalink
Merge pull request #235 from Neradoc/fix-version-read-1
Browse files Browse the repository at this point in the history
Slight improvement to reading MPY files module version
  • Loading branch information
dhalbert authored Dec 29, 2024
2 parents 27284f3 + 1bc332b commit 1eaca64
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
8 changes: 6 additions & 2 deletions circup/shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,18 @@ def _get_modules_file(path, logger):
py_files = glob.glob(os.path.join(package_path, "**/*.py"), recursive=True)
mpy_files = glob.glob(os.path.join(package_path, "**/*.mpy"), recursive=True)
all_files = py_files + mpy_files
# put __init__ first if any, assumed to have the version number
all_files.sort()
# default value
result[name] = {"path": package_path, "mpy": bool(mpy_files)}
# explore all the submodules to detect bad ones
for source in [f for f in all_files if not os.path.basename(f).startswith(".")]:
metadata = extract_metadata(source, logger)
if "__version__" in metadata:
metadata["path"] = package_path
result[name] = metadata
# don't replace metadata if already found
if "__version__" not in result[name]:
metadata["path"] = package_path
result[name] = metadata
# break now if any of the submodules has a bad format
if metadata["__version__"] == BAD_FILE_FORMAT:
break
Expand Down
1 change: 0 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@
import sphinx_rtd_theme

html_theme = "sphinx_rtd_theme"
html_theme_path = [sphinx_rtd_theme.get_html_theme_path(), "."]
except:
html_theme = "default"
html_theme_path = ["."]
Expand Down

0 comments on commit 1eaca64

Please sign in to comment.