diff --git a/CHANGELOG.md b/CHANGELOG.md index 75f3d294c..e23e2c0bd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] ### Added * Added support for Python 3.13 (#1056) + * Added support for `.cljc` files (#1097) ### Fixed * Fix an issue with `basilisp test` standard streams output that can lead to failures on MS-Windows (#1080) diff --git a/src/basilisp/importer.py b/src/basilisp/importer.py index e66557b7d..1cca9a6c1 100644 --- a/src/basilisp/importer.py +++ b/src/basilisp/importer.py @@ -105,7 +105,7 @@ def _is_package(path: str) -> bool: or Python code file.""" for _, _, files in os.walk(path): for file in files: - if file.endswith(".lpy") or file.endswith(".py"): + if file.endswith(".lpy") or file.endswith(".py") or file.endswith(".cljc"): return True return False @@ -122,7 +122,7 @@ def _is_namespace_package(path: str) -> bool: for file in files: if file in {"__init__.lpy", "__init__.py"}: no_inits = False - elif file.endswith(".lpy"): + elif file.endswith(".lpy") or file.endswith(".cljc"): has_basilisp_files = True return no_inits and has_basilisp_files @@ -161,6 +161,8 @@ def find_spec( filenames = [ f"{os.path.join(root_path, '__init__')}.lpy", f"{root_path}.lpy", + f"{os.path.join(root_path, '__init__')}.cljc", + f"{root_path}.cljc", ] for filename in filenames: if os.path.isfile(filename):