Skip to content

refactor: move some imports of commands/venv into type checking#3725

Merged
frostming merged 4 commits intopdm-project:mainfrom
waketzheng:maintain/improve-startup-speed
Jan 21, 2026
Merged

refactor: move some imports of commands/venv into type checking#3725
frostming merged 4 commits intopdm-project:mainfrom
waketzheng:maintain/improve-startup-speed

Conversation

@waketzheng
Copy link
Contributor

Pull Request Checklist

  • A news fragment is added in news/ describing what is new.
  • Test cases added for changed code.

Describe what you have changed in this PR.

  1. Move some imports of cli/commands/venv/*.py into TYPE_CHECKING in order to improve startup speed
  2. Fix some issues that complaint by ruff check --extend-select=SIM src/pdm/cli/commands/venv

@codecov
Copy link

codecov bot commented Jan 18, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.92%. Comparing base (1d31c8d) to head (26dc50b).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3725      +/-   ##
==========================================
+ Coverage   85.91%   85.92%   +0.01%     
==========================================
  Files         118      118              
  Lines       12372    12364       -8     
  Branches     2061     2058       -3     
==========================================
- Hits        10629    10624       -5     
+ Misses       1170     1169       -1     
+ Partials      573      571       -2     
Flag Coverage Δ
unittests 85.78% <100.00%> (+0.01%) ⬆️

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 956ff17 into pdm-project:main Jan 21, 2026
26 checks passed
@frostming
Copy link
Collaborator

Thank you for working on this.

intelfx added a commit to intelfx/pdm that referenced this pull request Jan 28, 2026
…ype checking (pdm-project#3725)"

This reverts commit 956ff17.

That commit converts ternary expressions into if-else chains on grounds
of readability, except for one specific case where it does the opposite
thus actually hurting readability. Undo this specific hunk.
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.

2 participants

Comments