kipe / nordpool

Python library for fetching Nord Pool spot prices.
MIT License
105 stars 39 forks source link

Breaking Change in Version 0.4.3: CurrencyMismatch Import Error #56

Open AEkman opened 2 weeks ago

AEkman commented 2 weeks ago

Description: It appears that the update from version 0.4.2 to 0.4.3 introduced a breaking change regarding the location of the CurrencyMismatch class. Specifically, code that previously imported CurrencyMismatch using: https://github.com/kipe/nordpool/compare/0.4.2...0.4.3

from nordpool.base import CurrencyMismatch
now results in a ModuleNotFoundError due to the class being moved or redefined elsewhere.

Suggested Solution: Documentation Update: Provide clear release notes explaining the new location of CurrencyMismatch and how to properly import it. Versioning Compliance: Since this change is not backward-compatible, the version increment should have followed SemVer and used a MAJOR version bump (e.g., from 0.4.x to 1.0.0) to indicate breaking changes.

Steps to Reproduce: Use version 0.4.3 of the library. Attempt to import CurrencyMismatch from nordpool.base. Observe the ModuleNotFoundError.

Expected Behavior: For breaking changes, users should be notified through a version increment that respects semantic versioning (a MAJOR version bump), so they can update their code accordingly.

Recommendations for Users: Update the import paths in your code to match the new location of CurrencyMismatch. Refer to the release notes or documentation for more details on where the class has been moved.

kipe commented 2 weeks ago

Oh, damn. Didn't think that someone would actually import that, but now that I think of it, those CurrencyMismatch issues actually used to be a thing when not using EUR in the previous implementation.

I won't do anything about this for now, but I'll take this into account in future changes. So the suggested path for the HA integration would be to fix the import issue and pin the version to >=0.4.3,<1.

Leaving this open for now, so if other people will find the information as well.