banesullivan / scooby

🐶 🕵️ Great Dane turned Python environment detective
MIT License
47 stars 12 forks source link

Update __init__.py with dev version #91

Closed akaszynski closed 2 years ago

akaszynski commented 2 years ago

Ideally we would use single source versioning. That's for another PR...

banesullivan commented 2 years ago

Thanks for catching this

prisae commented 2 years ago

Oh, I wasn't even aware we were not using single source versioning... The question is what is your preference? I use setuptools_scm on most of my things, I am happy to implement that. However, I am fine with anything else if you prefer other tools.

prisae commented 2 years ago

(setuptools_scm having the benefit of easily adding the git-hash for non-released version, so that a version is always unique - but then it has a little initial overhead to implement.)

akaszynski commented 2 years ago

(setuptools_scm having the benefit of easily adding the git-hash for non-released version, so that a version is always unique - but then it has a little initial overhead to implement.)

Meh, I'm a fan of:

try:
    import importlib.metadata as importlib_metadata
except ModuleNotFoundError:  # pragma: no cover
    import importlib_metadata

__version__ = importlib_metadata.version(__name__.replace(".", "-"))

I also think moving over to pyproject.toml would be fine for this project, but we don't need to change it now.

prisae commented 2 years ago

That is fine by me @akaszynski - again, scooby is simple enough so we keep it as simple as possible. I prefer in more complicated packages to have the git hash in the dev-versions, but for scooby that is really not necessary, so I am fine with your suggestion.

akaszynski commented 2 years ago

That is fine by me @akaszynski - again, scooby is simple enough so we keep it as simple as possible. I prefer in more complicated packages to have the git hash in the dev-versions, but for scooby that is really not necessary, so I am fine with your suggestion.

Feel free to implement! Let's keep it simple, and actually, single source versioning will make things even easier to maintain.

banesullivan commented 2 years ago

Let's keep it simple, and actually, single source versioning will make things even easier to maintain.

agreed

prisae commented 2 years ago

Actually, @akaszynski , single source versioning already, sort of, is in place through bumpversion, see https://github.com/banesullivan/scooby/blob/main/.bumpversion.cfg#L1-L8 - you just didn't use it.

In this sense, @banesullivan, setuptools_scm would simply replace the build requirement bumpversion.