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: use VersionSpec as the canonical compat representation #2480

Merged
merged 1 commit into from
Apr 2, 2021

Conversation

00vareladavid
Copy link
Contributor

Inspired by the discussion in #2469. As stated in the discussion. a VersionSpec is a much more desirable representation because it can be modified more easily.

Changes:

  • immediately convert to VersionSpec when reading project file
  • keep raw string representation to write back out when operations complete

@DilumAluthge
Copy link
Member

Out of curiosity, what happens if the VersionSpec and the raw [compat] entry string get out of sync with each other?

@KristofferC
Copy link
Member

KristofferC commented Apr 2, 2021

Then you will have a bug when you write the TOML file. An assert could be added for the project writer that checks that the string is in sync. That is indeed probably a good idea.

@DilumAluthge
Copy link
Member

DilumAluthge commented Apr 2, 2021

An assert could be added for the project writer that checks that the string is in sync. That is indeed probably a good idea.

That sounds good. @00vareladavid want to do this in this PR?

Alternatively we can merge this PR, and add the check in the follow-up PR.

@00vareladavid
Copy link
Contributor Author

Ok, I added the check 👍

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