Skip to content

version file open method #340

@curtisma

Description

@curtisma

Situation

I would like to have a simple text file in my repo, named "version", which contains only the semantic version number of the project. This could then be consumed by every place in the code that needs to know the package number.

For example, I may need it for the version attribute of the package, again for the documentation, and again for the Pip or Conda packaging configuration. Having all these share a single, simple source for the version number would make it easy to update the version number. It would also make it easy to get the version number for tools and packages written in other languages since it is stored as a simple text file that almost all languages can read. Especially since you have a CLI that would make it easy to use with other languages also.

Possible Solution/Idea

I propose adding a static or class method "open" which takes a string or path object pointing to the version file. The version file will only contain the semantic version. The method will read in the file and return a Version object.

Additional context

While it seems easy enough to open the file and pass it to the Version constructor as a string, this would require adding scripts or modules to each project to add this basic functionality. Python is all about "batteries included", right?

Metadata

Metadata

Assignees

No one assigned

    Labels

    DocDocumentation related issueEnhancementNot a bug, but increases or improves in value, quality, desirability, or attractiveness

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy