Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Fixed

- `__released__` now reports the release date of installed wheels instead of `"unreleased"` or the tag
date of whichever git repository the user's working directory belonged to. It is also exposed at the
package top level, like `solarfarmer.__version__`; previously `import solarfarmer as sf; sf.__released__`
raised `AttributeError`.

## [0.8.0] - 2026-10-28

### Added
Expand Down Expand Up @@ -37,8 +46,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
non-ASCII characters (e.g. in module or inverter file names) instead of escaping them as `\uXXXX`.
- `solarfarmer.__version__` no longer returns `"unknown"` for pip-installed packages; it now reads the
metadata of the `dnv-solarfarmer` distribution.
- `__released__` now reports the release date of installed wheels instead of `"unreleased"` or the tag
date of whichever git repository the user's working directory belonged to.

### Removed

Expand Down
3 changes: 2 additions & 1 deletion solarfarmer/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from . import custom_rotations, rcl
from .__version__ import __version__
from .__version__ import __released__, __version__
from .api import SolarFarmerAPIError
from .config import (
ABOUT_ENDPOINT_URL,
Expand Down Expand Up @@ -108,6 +108,7 @@
)

__all__ = [
"__released__",
"__version__",
"custom_rotations",
"custom_rotations_csv_to_protobuf",
Expand Down
9 changes: 9 additions & 0 deletions tests/test_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@ def test_version_format(self):
assert re.match(r"^\d+\.\d+\.\d+", __version__) or __version__ == "unknown"


class TestTopLevelExports:
def test_version_and_released_exposed_on_package(self):
"""Both attributes are reachable as ``solarfarmer.<attr>``, not only via the submodule."""
import solarfarmer as sf

assert sf.__version__ == __version__
assert sf.__released__ == __released__


class TestReleasedDate:
def test_released_format(self):
"""Released is either an ISO date (YYYY-MM-DD) or 'unreleased'."""
Expand Down
Loading