Giter Site home page Giter Site logo

Add rich.__version__ about rich HOT 9 CLOSED

textualize avatar textualize commented on May 23, 2024 1
Add rich.__version__

from rich.

Comments (9)

wookayin avatar wookayin commented on May 23, 2024 1

Thanks for the feedback. But why is it closed (it's still unimplemented)? Even though poetry is used, we could add this property with a workaround.

from rich.

willmcgugan avatar willmcgugan commented on May 23, 2024

I use poetry to do packaging, which recommends pkg_resources to get the version from meta data. They initially recommended dropping __version__ entirely. Fortunately there some to be some movement on that front, and we may get __version__ back.

from rich.

willmcgugan avatar willmcgugan commented on May 23, 2024

Keeping the version in two places is problematic. But if poetry hasn't got a solution when I release a 1.0 version, that's what I might have to do. In the meantime, the lack of a __version__ isn't going to break anything that I know of, and pkg_resources.get_distribution("rich").version can be used to get the version.

from rich.

thebigmunch avatar thebigmunch commented on May 23, 2024

Just a note. For Python 3.8+, importlib.metadata should probably be used instead. And the importlib_metadata backaport exists for other Python 3 versions. It was created to replace pkgresources metadata functionality.

Here's how I use it to deduplicate my package metadata. I use poetry, too, and I couldn't wait any longer. I already had that module and was manually updating it.

from rich.

willmcgugan avatar willmcgugan commented on May 23, 2024

I may end up doing something similar...

from rich.

LewisGaul avatar LewisGaul commented on May 23, 2024

Thanks for the feedback. But why is it closed (it's still unimplemented)? Even though poetry is used, we could add this property with a workaround.

Still seems to be missing __version__, if the intention was for it to be added by v1.0 then perhaps this issue should have been left open...

from rich.

willmcgugan avatar willmcgugan commented on May 23, 2024

Don't know where you got that idea from.

from rich.

LewisGaul avatar LewisGaul commented on May 23, 2024

I didn't mean to sound adversarial! It was your message above that gave me this impression:

Keeping the version in two places is problematic. But if poetry hasn't got a solution when I release a 1.0 version, that's what I might have to do.

Personally I agree with the OP that it's pretty standard to provide this, but it's up to you of course.

from rich.

willmcgugan avatar willmcgugan commented on May 23, 2024

It was a standard of sorts, but now importlib is recommended, and __version__ is a convenience.

Unless poetry has an answer to this that doesn't require a backport of importlib, I'm afraid there is no motivation to change it.

from rich.

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.