sherlock-project / sherlock

Hunt down social media accounts by username across social networks
https://sherlockproject.xyz
MIT License
58.24k stars 6.72k forks source link

Improved single source of truth for versioning #2229

Open ppfeister opened 2 months ago

ppfeister commented 2 months ago

Description

Current SSOT is .__version__ defined in __init__.py. This makes packaging locally less than ideal as the default version will always be zero.

We threw this together after realizing that no poetry plugins supported it -- but it really doesn't need poetry

It's suggested that we make the pyproject the SSOT and update __init__ to use the metadata submodule of importlib. Package is build with the version number from pyproj, and when processed by sherlock, it's pulled at runtime from whatever the created bin/entry is (in theory)

from importlib.metadata import version
__version__ = version('sherlock')

Code of Conduct

sdushantha commented 1 month ago

I support this suggestion for having SSOT

ppfeister commented 1 month ago

Note for later:

Make sure to validate against Windows, since Windows doesn't use standard binaries or entry points