Summary
pyproject2conda 0.23.0 (published to PyPI on 2026-04-29) raises AttributeError immediately when materialising any conda requirement. 0.22.1 works correctly with the same input.
Reproduction
pyproject.toml declares conda dependencies via dependency-groups/extras and we invoke:
pyproject2conda yaml -e dev -o /tmp/environment.generated.yml -n CausalPy \
-w force --no-header \
--python-include 'python>=3.12' \
-d make -d pip -d pymc-bart -r 'marimo[mcp]'
This succeeds on 0.22.1 and fails on 0.23.0 with:
File ".../pyproject2conda/_normalized_requirements.py", line 115, in _iter_parts
if self.channel:
^^^^^^^^^^^^
AttributeError: 'CondaRequirement' object has no attribute 'channel'
The traceback shows _iter_parts being reached via CondaRequirement.__hash__, so any code path that hashes a CondaRequirement (e.g. inserting into a set/dict during dependency aggregation) triggers it.
Likely cause
0.23.0 reworks validation onto pydantic (#92, "feat!: Use pydantic for validation"). It looks like the channel field was dropped or renamed on CondaRequirement during that migration, but _iter_parts in _normalized_requirements.py still reads self.channel unconditionally. Either the attribute should be restored (with a sensible default of None/empty), or _iter_parts should be updated to read the new field.
Environment
- Python 3.12 (Ubuntu, GitHub Actions
ubuntu-latest).
- Installed via
pip install pyproject2conda (resolves to 0.23.0).
- Same inputs work on 0.22.1.
Workaround
Downstream users can pin pyproject2conda<0.23 until this is resolved. Reporting from CausalPy (https://github.com/pymc-labs/CausalPy), where every PR opened since 2026-04-29 has had its check-environment-yml job fail. Tracked downstream in pymc-labs/CausalPy#878.
Happy to test a fix or provide a fuller minimal reproducer if useful — just let me know.
Summary
pyproject2conda 0.23.0(published to PyPI on 2026-04-29) raisesAttributeErrorimmediately when materialising any conda requirement.0.22.1works correctly with the same input.Reproduction
pyproject.tomldeclares conda dependencies viadependency-groups/extras and we invoke:This succeeds on
0.22.1and fails on0.23.0with:The traceback shows
_iter_partsbeing reached viaCondaRequirement.__hash__, so any code path that hashes aCondaRequirement(e.g. inserting into a set/dict during dependency aggregation) triggers it.Likely cause
0.23.0reworks validation onto pydantic (#92, "feat!: Use pydantic for validation"). It looks like thechannelfield was dropped or renamed onCondaRequirementduring that migration, but_iter_partsin_normalized_requirements.pystill readsself.channelunconditionally. Either the attribute should be restored (with a sensible default ofNone/empty), or_iter_partsshould be updated to read the new field.Environment
ubuntu-latest).pip install pyproject2conda(resolves to 0.23.0).Workaround
Downstream users can pin
pyproject2conda<0.23until this is resolved. Reporting from CausalPy (https://github.com/pymc-labs/CausalPy), where every PR opened since 2026-04-29 has had itscheck-environment-ymljob fail. Tracked downstream in pymc-labs/CausalPy#878.Happy to test a fix or provide a fuller minimal reproducer if useful — just let me know.