-
Notifications
You must be signed in to change notification settings - Fork 37
YAML #328
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
YAML #328
+4
−3
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Replace importlib.resources.files() with Path(__file__).parent for
loading config YAML files in R2EGymEnv and SWESmithEnv.
## Problem
When debug-gym is installed as an editable package using pip 23.1+,
pip uses the PEP 660 editable install format by default. This format
is incompatible with importlib.resources.files() in Python 3.12,
causing a NotADirectoryError:
NotADirectoryError: MultiplexedPath only supports directories
This breaks imports and prevents tests from running.
## Root Cause
- PEP 660 was introduced in 2021, but pip didn't make it the default
until version 23.1 (April 2023)
- The old editable install format used .egg-link files
- The new PEP 660 format uses __editable__*.pth files
- importlib.resources.files() has known issues with PEP 660 in
Python 3.12
When users reinstall debug-gym with modern pip versions, they get
the new format, which breaks the importlib_files() calls.
## Solution
Use Path(__file__).parent to locate config files relative to the
source file. This approach:
- Works with all installation methods (editable and non-editable)
- Works with both old and new editable install formats
- Is simpler and more direct
- Avoids the importlib.resources compatibility issues
Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
Replace importlib.resources.files() with Path(__file__).parent for
loading config YAML files in R2EGymEnv and SWESmithEnv.
## Problem
When debug-gym is installed as an editable package with setuptools >= 64,
setuptools uses the PEP 660 editable install format. This format is
incompatible with importlib.resources.files() in Python 3.12, causing:
NotADirectoryError: MultiplexedPath only supports directories
This breaks imports and prevents tests from running.
## Root Cause
The editable install method depends on setuptools version, not pip version:
- setuptools >= 64: Uses PEP 660 format (__editable__*.pth files)
- setuptools < 64: Uses legacy format (.egg-link files)
When users reinstall debug-gym with modern setuptools (>= 64), they get
the PEP 660 format, which is incompatible with importlib.resources.files()
in Python 3.12.
Previous installations likely used setuptools < 64 (legacy format), which
worked fine. After upgrading setuptools and reinstalling, the new format
breaks the importlib_files() calls even though the code hasn't changed.
## Solution
Use Path(__file__).parent to locate config files relative to the source
file. This approach:
- Works with all installation methods (editable and non-editable)
- Works with both legacy and PEP 660 editable install formats
- Is simpler and more direct
- Avoids the importlib.resources compatibility issues
Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
… into minof_fix_jan8
- Fix MANIFEST.in path: debug_gym/gym/envs/configs/*.yaml (was incorrectly debug_gym/envs/configs/) - Remove non-existent scripts/templates/*.jinja from MANIFEST.in - Add package-data configuration to pyproject.toml for wheel distributions This ensures YAML config files are properly included in both sdist and wheel distributions. Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
Reverts PR #328 changes that switched from importlib.resources.files() to Path(__file__).parent. Since debug-gym requires Python >= 3.12 (as documented in README), the stdlib importlib.resources.files() works correctly with PEP 660 editable installs. The Path(__file__).parent workaround is unnecessary. Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
MANIFEST.in with include_package_data=true is sufficient for including non-Python files in both sdist and wheel distributions. Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
- Remove MANIFEST.in - Add [tool.setuptools.package-data] section with YAML configs - Package-data is sufficient for files inside Python packages - Excludes configs/templates/*.jinja (outside package, not needed in distribution) Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
MarcCote
approved these changes
Jan 9, 2026
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Modernizes package data configuration by migrating from MANIFEST.in to pyproject.toml's package-data section.
Changes
Replace MANIFEST.in with package-data in pyproject.toml
[tool.setuptools.package-data]section to pyproject.tomlgym/envs/configs/*.yamlfor YAML config filesImpact
debug_gym/gym/envs/configs/will be properly included in both source and wheel distributions