tessl install tessl/pypi-ipython@9.5.0IPython: Productive Interactive Computing - An advanced interactive computing environment and command shell for Python.
Agent Success
Agent success rate when using this tile
86%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.09x
Baseline
Agent success rate without this tile
79%
Build a Python application that generates custom IPython configuration profiles for different development environments (development, production, and testing). The application should create profile directories with properly configured settings that control IPython's interactive behavior.
Your application should support three distinct profiles:
Each profile must configure the following IPython behaviors:
Display Settings
Auto-completion and Suggestions
History Management
Execution Behavior
Create a Python module profile_generator.py with the following:
A ProfileConfig class that holds configuration settings for a profile
A generate_profile(profile_name: str, config: ProfileConfig, output_dir: str) -> None function that:
Profile-specific configurations:
The generated configuration file should be valid Python code that IPython can load. Use the proper IPython configuration object structure (accessing c.InteractiveShell and related trait objects).
Provides the interactive Python environment and configuration system. Use the traitlets-based configuration to control IPython behavior.
Input: Generate a development profile
config = ProfileConfig(
max_display_items=100,
color_scheme='Linux',
auto_suggestions=True,
history_enabled=True,
history_length=10000,
autoindent=True,
confirm_exit=False,
automagic=True
)
generate_profile('profile_dev', config, '/tmp/test_profiles')Expected Output:
/tmp/test_profiles/profile_dev is created/tmp/test_profiles/profile_dev/ipython_config.py existsInput: Generate a production profile with minimal features
config = ProfileConfig(
max_display_items=20,
color_scheme='NoColor',
auto_suggestions=False,
history_enabled=False,
autoindent=False,
confirm_exit=True,
automagic=False
)
generate_profile('profile_prod', config, '/tmp/test_profiles')Expected Output:
/tmp/test_profiles/profile_prod is createdInput: Generate a testing profile for reproducible test runs
config = ProfileConfig(
max_display_items=50,
color_scheme='Neutral',
auto_suggestions=False,
history_enabled=False,
autoindent=True,
confirm_exit=False,
automagic=False
)
generate_profile('profile_test', config, '/tmp/test_profiles')Expected Output:
/tmp/test_profiles/profile_test is createdCreate a test file test_profile_generator.py that validates:
Run tests using pytest:
pytest test_profile_generator.py -v