Conditional dependency resolution
Use when a Python library exposes functionality that depends on external packages (like sqlalchemy, pandas, or lxml) that are not required for core operations.From its SKILL.md
npx -y skills add HolobiomicsLab/asb-skill-collections --skill conditional-dependency-resolutionAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 15 stars15 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its file declares
Copied from the file, not written here
The file declares its own license as CC-BY-4.0. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.
SKILL.md
5.8 KB, 920 tokens by cl100k_base, as published. Nobody here has run it
conditional-dependency-resolution
Summary
Verify that a Python module correctly initializes and functions when its optional (conditional) dependencies are installed, ensuring the module gracefully handles both presence and absence of those dependencies. This skill is essential for validating library architecture in projects that support modular functionality.
When to use
Apply this skill when a Python library exposes functionality that depends on external packages (like sqlalchemy, pandas, or lxml) that are not required for core operations. Use it specifically when you need to confirm that a module can be imported and instantiated successfully when the optional dependency is present, and that the conditional import mechanism works as designed.
When NOT to use
- When testing the module WITHOUT the optional dependency installed (that requires a separate 'graceful absence' test, not this skill).
- When the optional dependency is declared but the module never actually uses it (requires code inspection, not runtime verification).
- When the module is already known to work; this is a validation/regression test, not a discovery technique.
Inputs
- Python environment with base package installed
- Optional dependency package (e.g., sqlalchemy, pandas, lxml)
- Module or submodule name that declares conditional dependency
Outputs
- Confirmation that module imports without exception
- Instantiated accessor/database object (e.g., Unimod object)
- Absence of ImportError or ModuleNotFoundError during initialization
How to apply
First, install the optional dependency using pip (e.g., pip install sqlalchemy). Then, in a Python interpreter or script, attempt to import the module that declares a conditional dependency on that package. Instantiate any accessor or database classes provided by that module (e.g., the Unimod database accessor in pyteomics.mass.unimod). Verify that no ImportError or ModuleNotFoundError exceptions are raised during initialization. The rationale is that conditional dependencies are advertised to users as optional enhancements; verification proves the feature is actually usable when the dependency is satisfied.
Related tools
- Python (Execution environment for importing and instantiating the module)
- pip (Package manager for installing the optional dependency)
- sqlalchemy (Example optional dependency used by pyteomics.mass.unimod for Unimod database access) — https://www.sqlalchemy.org/
Examples
pip install sqlalchemy && python -c "from pyteomics.mass.unimod import Unimod; u = Unimod(); print('Unimod initialized successfully')"
Evaluation signals
- Module import succeeds without ImportError or AttributeError
- Accessor class (e.g., Unimod) instantiates with no exceptions raised
- No silent failures or fallback-to-stub behavior when the dependency is present
- Object state is populated correctly (e.g., database connection is active, not mocked)
- Subsequent method calls on the instantiated object succeed (e.g., querying the Unimod database)
Limitations
- This skill validates only the presence case; a separate test is needed to confirm graceful degradation when the dependency is absent.
- Does not verify the quality or correctness of results returned by the module's functionality—only that it initializes.
- Assumes the optional dependency itself is installed correctly; installation errors are out of scope.
- Does not test versioning constraints (e.g., minimum/maximum sqlalchemy version compatibility).
Evidence
- [other] The pyteomics.mass.unimod module depends on sqlalchemy as a conditional dependency for accessing the Unimod database.: "The pyteomics.mass.unimod module depends on sqlalchemy as a conditional dependency for accessing the Unimod database."
- [other] Install sqlalchemy dependency using pip install sqlalchemy. 2. Import the pyteomics.mass.unimod module in a Python interpreter or script. 3. Instantiate the Unimod database accessor class and confirm initialization succeeds with no exceptions raised.: "Install sqlalchemy dependency using pip install sqlalchemy. 2. Import the pyteomics.mass.unimod module in a Python interpreter or script. 3. Instantiate the Unimod database accessor class and confirm"
- [other] sqlalchemy (used by :py:mod:
pyteomics.mass.unimod);: "sqlalchemy (used by :py:mod:pyteomics.mass.unimod);" - [readme] Pyteomics is a collection of lightweight and handy tools for Python that help to handle various sorts of proteomics data.: "Pyteomics is a collection of lightweight and handy tools for Python that help to handle various sorts of proteomics data."
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.