From 101d3ec17c4feaf4b2f682b485105f3a5c0d7523 Mon Sep 17 00:00:00 2001 From: Chris Badahdah Date: Wed, 30 Oct 2024 21:35:46 -0700 Subject: [PATCH 1/2] Add support for cljc files fixes #668 --- src/basilisp/importer.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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): From 988622105173f0a93faaf28c6471cabc594b7561 Mon Sep 17 00:00:00 2001 From: Chris Badahdah Date: Thu, 31 Oct 2024 21:11:01 -0700 Subject: [PATCH 2/2] Update CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) 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)