Giter VIP home page Giter VIP logo

Comments (7)

pulkomandy avatar pulkomandy commented on July 27, 2024

If I remember correctly, @kallisti5 already investigated this, and there are some differences in behavior. In particular, the handling of pre-releases is completely different: we use ~ instead of . as a separator to mark pre-releases.

So, in our case:

2.0 > 2.0~1
2.0 < 2.0.1

2.0 > 2.0.alpha
2.0 < 2.0~alpha

Maybe it is possible to achieve this with existing Python modules, but you have to be careful of handling all these situations, and the behavior must be similar to the C++ implementation in Haiku's package kit

from haikuporter.

jurgenwigg avatar jurgenwigg commented on July 27, 2024

Good point. Where can I find any documentation about versioning in Haiku? It would be very helpful to investigate if packaging.version can be used. I've found some hacks to use custom regex to parse the version but it looks like our own pattern should be created (original one is already strange and looks a bit odd).

from haikuporter.

pulkomandy avatar pulkomandy commented on July 27, 2024

Documentation is here: https://www.haiku-os.org/docs/develop/packages/BuildingPackages.html#version-strings but it is not complete, for example it does not specify how the strings in each component of the version are compared (it is some kind of "natural" order, so that numbers are sorted numerically and other strings are compared as strings)

from haikuporter.

jurgenwigg avatar jurgenwigg commented on July 27, 2024

Thanks for the link - I'll check if it's possible to adapt existing packaging and if it's worth the effort.

from haikuporter.

jurgenwigg avatar jurgenwigg commented on July 27, 2024

I've created PoC for adapting packaging.version to HaikuPorter (#261). I've checked the documentation and I think it should be easier to implement than I thought. If there are some differences between real world and the documentation for version strings please let me know - I will include such cases in unit tests for the new solution. Please let me know also what do you think about such change. I was planning to introduce it in two parts:

  1. Implement new versioning mechanism.
  2. Replace the old one with new one.

from haikuporter.

waddlesplash avatar waddlesplash commented on July 27, 2024

I don't know if we want to replace this class. Even if we can get 1:1 identical behavior with Haiku's specification, what's the point? We aren't packaging Python applications, so why would we use a class intended to deal with Python package version numbers? If the Python class's behavior changed in the future, we'd have to adapt things in HaikuPorter again, which just seems like needless work.

from haikuporter.

jurgenwigg avatar jurgenwigg commented on July 27, 2024

I agree with you. While I was digging deeper and looking at all of issues that pylint showed and many other things I came up with thought that this replacement is not needed at all. There are a lot more work to do now (UT for example or removing cyclic imports, etc.). I'm closing this discussion and PR.

from haikuporter.

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.