Skip to content

Conversation

@yatharth
Copy link
Contributor

@yatharth yatharth commented Dec 18, 2025

What this PR does

We had test called test_forbidden_imports() to prevent imports from metta in cogames.

However, it only tested code in cogames/src, meaning cogames/tests could still import from metta, as was the case in #4421.

Why this PR does that

It's important in publishing cogames as a stand-alone package that the tests run by themselves without reference to a private repository.

Asana Task

# Check all Python files in the cogames package
for py_file in iter_python_files(repo_root):
# Skip this test file itself
if py_file.name == "test_forbidden_imports.py":
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can maybe use __file__ or something

continue
# Skip explicitly excluded files
rel_path = str(py_file.relative_to(repo_root))
if rel_path in EXCLUDE_FILES:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems we should just remove EXCLUDE_FILES usage

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants