Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

version file open method #340

Copy link
Copy link
Closed
Closed
Copy link
@curtisma

Description

@curtisma
Issue body actions

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 issueDocumentation related issueEnhancementNot a bug, but increases or improves in value, quality, desirability, or attractivenessNot 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

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.