Skip to content

Conversation

frostming
Copy link
Collaborator

Summary

Fixes #3573 - This resolves an issue where running pdm export --lockfile pylock.toml would produce empty
requirements.txt files.

Problem

The issue was that group information from pylock markers was not being properly extracted and assigned to requirements,
causing the export logic to skip all packages due to group filtering mismatches.

Co-Authored-By: Claude noreply@anthropic.com

This fixes an issue where running `pdm export --lockfile pylock.toml`
would produce empty requirements.txt files. The problem was that groups
information from pylock markers was not being properly extracted and
assigned to requirements, causing the export logic to skip all packages.

Changes:
- Added group extraction from pylock markers in _read_pylock()
- Modified export command to use evaluate_candidates() for proper filtering
- Added _extract_groups_from_marker() method to handle complex marker patterns
- Added comprehensive tests for pylock export functionality

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Copy link

codecov bot commented Jul 21, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.23%. Comparing base (94c6cf2) to head (15be1f6).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3575      +/-   ##
==========================================
+ Coverage   85.17%   85.23%   +0.06%     
==========================================
  Files         118      118              
  Lines       12017    12012       -5     
  Branches     1961     1959       -2     
==========================================
+ Hits        10235    10238       +3     
+ Misses       1217     1209       -8     
  Partials      565      565              
Flag Coverage Δ
unittests 85.08% <100.00%> (+0.06%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@frostming frostming merged commit a14f86e into main Jul 21, 2025
24 checks passed
@frostming frostming deleted the fix/pylock-export-empty-requirements-3573 branch July 21, 2025 02:15
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.

Cannot export pylock.toml to requirements.txt
1 participant