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

Fix pre-prompt ccds version error #426

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

chrisjkuch
Copy link
Contributor

@chrisjkuch chrisjkuch commented Feb 17, 2025

This fixes an issue introduced in #336 (hotfixed in #427 ) that added a pre-prompt hook to warn about the newly introduced versioning system.

However, the pre-prompt script was unable to access certain module-level imports from the ccds package. (I'm still trying to figure out / think about why that's the case) I think this is because we simultaneously changed the versioning structure and mechanism in #336 by adding a version.py that computed the package version, and people with the old version of ccds installed were looking for the version of ccds in a module that didn't exist in their version of the package.

Migrating version extraction from a separate version.py module into __init__.py seems to fix this, since the version can be determined directly by importlib without needing separate imports from the ccds module.

Comment on lines 3 to 6
from ccds import __version__

if __name__ == "__main__":
if version < "2.0.1":
if __version__ < "2.0.1":
Copy link
Member

@jayqi jayqi Feb 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any scenario where this would still break? You could potentially put this in a try-except.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I think that's a good idea regardless.

@chrisjkuch chrisjkuch added this to the v2.0.1 milestone Feb 18, 2025
Copy link
Member

@pjbull pjbull left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change looks reasonable. How did you manually test different configs?

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.

3 participants