sylikc / pyexiftool

PyExifTool (active PyPI project) - A Python library to communicate with an instance of Phil Harvey's ExifTool command-line application. Runs one process with special -stay_open flag, and pipes data to/from. Much more efficient than running a subprocess for each command!
Other
144 stars 17 forks source link

Add versioning information directly to module #34

Closed sylikc closed 2 years ago

sylikc commented 2 years ago

@jangop I see an issue opened with the original source https://github.com/smarnach/pyexiftool/issues/18 , and I've read through the PEP but wasn't sure how to do it exactly...

Where does __version__ go? Does it go into __init__.py or does it go like into the top of the different py files... or does it go into the class level? like in the ExifTool class?

I think the PEP 396 referenced is outdated (it's marked as Rejected)... latest I believe is PEP 440

It's unclear where I would put the version information... any clues?

jangop commented 2 years ago

It goes into __init__.py; the top-level one that describes the module.

I suppose other things, such as classes, could have their own __version__s, but I don't know about that. It's surely not what you want. ☺️

Ideally, the version should only be specified in exactly one place, and so for packaging (which you are doing with this project), there is info on Single-sourcing the package version. version = attr: package.__version__ seems nice enough. ☺️

sylikc commented 2 years ago

thanks for the help. I guess I'm definitely doing it wrong in one of my other personal projects... I have __version__ tags like everywhere... package, module, class . . .

sylikc commented 2 years ago

closed by d94ff05547b4fb05a019b306b64320d90ae397fc

jangop commented 2 years ago

I really do not know whether __version__ is used for anything but a module's version! 🤷

Oh well. I don't remember ever seeing it used for classes.

sylikc commented 2 years ago

Yeah it's good... the way that the Python single version truth describes it, it definitely only belongs on the Package level...

Yeah... I have this big monolithic project that I put all my helper functions into, and ... whelp hehe.