Skip to content

make qcodes.__version__ lazy#5931

Draft
jenshnielsen wants to merge 5 commits into
microsoft:mainfrom
jenshnielsen:jenshnielsen/lazy_version
Draft

make qcodes.__version__ lazy#5931
jenshnielsen wants to merge 5 commits into
microsoft:mainfrom
jenshnielsen:jenshnielsen/lazy_version

Conversation

@jenshnielsen
Copy link
Copy Markdown
Collaborator

@jenshnielsen jenshnielsen commented Apr 5, 2024

This speeds up importing qcodes from an editable install with ~ 0.6-0.7 s assuming that you do not actually make use of the __version__ attribute. The downside is that we do lose some of the static typing of this attribute. See inline comments

Edit. Adding a type to __version__ partially resolves this but its probably better to make version an lazily evaluated property and reference that

@jenshnielsen jenshnielsen requested a review from a team as a code owner April 5, 2024 09:31
@jenshnielsen jenshnielsen marked this pull request as draft April 5, 2024 09:31
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 5, 2024

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 71.02%. Comparing base (f77c1e0) to head (952ca6a).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5931   +/-   ##
=======================================
  Coverage   71.02%   71.02%           
=======================================
  Files         301      301           
  Lines       31896    31896           
=======================================
  Hits        22655    22655           
  Misses       9241     9241           

☔ 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.

@jenshnielsen jenshnielsen changed the title make qcodes version lazy make qcodes.__version__ lazy Apr 5, 2024
@jenshnielsen jenshnielsen force-pushed the jenshnielsen/lazy_version branch from 9bd9158 to 27fce61 Compare June 9, 2024 18:00
@jenshnielsen jenshnielsen force-pushed the jenshnielsen/lazy_version branch from 27fce61 to 55ea07f Compare May 13, 2026 14:22
@jenshnielsen jenshnielsen force-pushed the jenshnielsen/lazy_version branch from 55ea07f to f24d220 Compare May 13, 2026 14:26
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.

1 participant