Repository navigation
Allow running from source (when not installed) by using version number from local metadata - #879
Conversation
5bdbeb8 to
8819d53
Compare
| <property name="valign">center</property> | ||
| <property name="margin-top">10</property> | ||
| <property name="margin-bottom">10</property> | ||
| <property name="label">Safe Eyes 3.4.0</property> |
There was a problem hiding this comment.
This is removed because this is already injected with this code https://github.com/slgobinath/safeeyes/blob/master/safeeyes/ui/about_dialog.py#L60
8819d53 to
93d422b
Compare
deltragon
left a comment
There was a problem hiding this comment.
The about dialog change seems good to me.
The part about parsing the version from pyproject.toml can also be merged as-is. I'd prefer a proper parser, I think, but since we need this as a fallback anyways that can also be added later.
Suppose it is already installed and we run a different version from source. Then it will show the version number for the source, not the version number of (older) installed version
|
Ready from my side. In case you think it is ready, and want to merge, please squash and merge so that it creates only one commit. |
| pyproject_path = Path(__file__).resolve().parent.parent / "pyproject.toml" | ||
|
|
||
| # Running from a source checkout: use the local project metadata. | ||
| if pyproject_path.is_file(): |
There was a problem hiding this comment.
In theory, if some installation method somehow kept the pyproject.toml file, this would be incorrect... But that isn't the case currently (neither for pip/PyPA, deb or flatpak), and seems unlikely to be the case in the future, so I'm fine with it.
Fixes #876
When not installed, safeeyes was failing to load as it could not find the version number. But now it loads the version number from python metadata.