Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: lazy import to reduce the startup time #1929

Merged
merged 2 commits into from
May 16, 2023
Merged

Conversation

frostming
Copy link
Collaborator

Signed-off-by: Frost Ming [email protected]

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.

Before change:

$ time pdm install --help
0.16s user 0.04s system 88% cpu 0.228 total

After change

$ time pdm install --help
0.12s user 0.04s system 92% cpu 0.168 total

frostming added 2 commits May 16, 2023 15:26
Signed-off-by: Frost Ming <[email protected]>
Signed-off-by: Frost Ming <[email protected]>
@codecov-commenter
Copy link

codecov-commenter commented May 16, 2023

Codecov Report

Patch coverage: 90.00% and project coverage change: -0.05 ⚠️

Comparison is base (44480a6) 85.19% compared to head (e30eadd) 85.15%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1929      +/-   ##
==========================================
- Coverage   85.19%   85.15%   -0.05%     
==========================================
  Files          99       99              
  Lines        9241     9243       +2     
  Branches     2010     2010              
==========================================
- Hits         7873     7871       -2     
- Misses        934      938       +4     
  Partials      434      434              
Flag Coverage Δ
unittests 84.96% <90.00%> (-0.05%) ⬇️

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

Impacted Files Coverage Δ
src/pdm/cli/commands/publish/repository.py 53.04% <57.14%> (-1.83%) ⬇️
src/pdm/cli/utils.py 83.57% <66.66%> (ø)
src/pdm/environments/base.py 70.07% <75.00%> (-0.30%) ⬇️
src/pdm/models/repositories.py 73.86% <83.33%> (+0.18%) ⬆️
src/pdm/cli/actions.py 80.60% <100.00%> (ø)
src/pdm/cli/commands/publish/__init__.py 84.70% <100.00%> (ø)
src/pdm/cli/commands/publish/package.py 75.93% <100.00%> (+0.36%) ⬆️
src/pdm/cli/options.py 94.44% <100.00%> (ø)
src/pdm/core.py 93.52% <100.00%> (-0.05%) ⬇️
src/pdm/formats/flit.py 73.03% <100.00%> (-0.88%) ⬇️
... and 9 more

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@frostming frostming merged commit 9b4386c into main May 16, 2023
@frostming frostming deleted the refactor/lazy-import branch May 16, 2023 08:00
oedokumaci added a commit to oedokumaci/template-python that referenced this pull request May 29, 2023
this is to update pdm see pdm-project/pdm#1929
@j178 j178 mentioned this pull request Apr 3, 2024
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