Code Monkey home page Code Monkey logo

Comments (2)

Nicoretti avatar Nicoretti commented on July 28, 2024

Hi Jérémie,

thank you for your appreciation and feedback.

Let me quickly explain why I did remove the __version__ field.

From my point of view, it is a important to have a single source of truth for the package
metadata, like the version. Otherwise one may end up creating a release where the version shown by the package manager (pip) differs from the version reported by the package (__version__).

For sure there are solutions to this problem, like using pyproject.toml as the
single source of truth and adding some automated checks/updates. Still the margin
for error and the effort of maintanance increases.

Additionaly starting with python 3.8 a new mechansim to access package metadata was introduced.
Using this new mechanism you may be able to addresses your issue (see code snippet below),
if not please let me know.

>>> from importlib import metadata
>>> metadata.version('crc')
'3.0.0'

Best
Nico

from crc.

jchabloz avatar jchabloz commented on July 28, 2024

Hello Nicola,

Thanks for your detailed answer. I understand your point concerning properly maintaining the single source for the version number. To be honest, I never even thought about it before...
I was not aware of the relatively new metadata mechanism and will try it out. It won't completely solve my portability issue in all cases, but anyway, it is more of an inconvenience than a real issue!
I will close this issue.

Jérémie

from crc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.