GithubHelp home page GithubHelp logo

Comments (9)

smarie avatar smarie commented on June 15, 2024

An alternative that I like and recommend is to use setuptools_scm.

This is how you make it work: https://smarie.github.io/python-getversion/#package-versioning-best-practices. (note that the getversion library where this recommendation is hosted, is not used in the pattern - it is only useful when a library doesn't have a version attribute)

from pyjson_tricks.

hmaarrfk avatar hmaarrfk commented on June 15, 2024

Right. I am using pkg resources which I guess is the same thing.

Thanks for considering.

This stuff is a moving target, and there isn't always a good reason to change.

Feel free to close

from pyjson_tricks.

smarie avatar smarie commented on June 15, 2024

I am using pkg resources which I guess is the same thing.

No, getversion is a bit more complete - it relies on several strategies, pkg resources is only one of them but is a bit limited as it does not cover all cases (unzipped wheels, project sources added to python path by your IDE such as PyCharm, etc.). But this is another discussion :)

For the present ticket I agree with you that something should be done so that __version__ is set. Let's wait for maintainer's feedback then. Thanks for the discussion !

from pyjson_tricks.

hmaarrfk avatar hmaarrfk commented on June 15, 2024

getversion does work in the problematic use cases i've had where pip detects the version at install time, but for dependencies that I am depeveloping, that often goes out of sync at run time.

Not sure if I want to depend on it just yet.
0.2.3+31.g8cafa99, but seems cool.

Either case, I sympathesize with the maintainer not wanting to have to keep track of two numbers, one in setup..py and the other in __init__.py.

from pyjson_tricks.

mverleg avatar mverleg commented on June 15, 2024

Hmm doesn't it seem a bit unnecessary to add a dependency for something that is just a few lines of code?

It's probably a good idea to add this though, I can see how it would be useful since there is already logic depending on sys.version_info in this project.

from pyjson_tricks.

hmaarrfk avatar hmaarrfk commented on June 15, 2024

Are you referring to versioneer?

from pyjson_tricks.

mverleg avatar mverleg commented on June 15, 2024

By the dependencies I mean both (this was my quick impression, maybe I'm wrong). With a few lines I mean adding the version in a text file and reading that.

Currently any changes are blocked by #60 though...

from pyjson_tricks.

hmaarrfk avatar hmaarrfk commented on June 15, 2024

Depends how much of burden you see in changing those two lines. I hate it. I just want to tag and move on.

from pyjson_tricks.

mverleg avatar mverleg commented on June 15, 2024

From v3.13.2 it works for me and for the automated test

from pyjson_tricks.

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.