Giter VIP home page Giter VIP logo

universions's Introduction

universions

Python library to get the version of other tools

PyPI pyversions
PyPI version
Anaconda-Server Badge
Code style: black

Read the documentation

Install

with pip

pip install universions

with conda

conda install -c conda-forge universions

Examples

In python code :

>>> from universions.java import get_java_version
>>> get_java_version()
Version(major=10, minor=0, patch=2, prerelease=None, build=None)
>>> get_java_version() > (1, 8)
True

In the command line :

>>> universions java
11.0
>>> universions node -v
12.6.0

Languages and other tools supported

Open an issue if you want more ! If you want to contribute read the contributing guide.

universions's People

Contributors

fabiencelier avatar kineolyan avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

universions's Issues

Add get_maven_version

On my ubuntu :

mvn --version
Apache Maven 3.6.2 (40f52333136460af0dc0d7232c0dc0bcf0d9e117; 2019-08-27T17:06:16+02:00)
Maven home: /home/fabien/.sdkman/candidates/maven/current
Java version: 10.0.2, vendor: Oracle Corporation, runtime: /home/fabien/.sdkman/candidates/java/10.0.2-open
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "5.3.0-19-generic", arch: "amd64", family: "unix"
$ mvn --version
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T17:41:47+01:00)
Maven home: /home/fabien/.sdkman/candidates/maven/current
Java version: 10.0.2, vendor: Oracle Corporation
Java home: /home/fabien/.sdkman/candidates/java/10.0.2-open
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "5.3.0-19-generic", arch: "amd64", family: "unix"

Add PHP support

php -v should work

Example output from SO :

> php -v

PHP 5.6.26 (cli) (built: Sep 15 2016 18:12:07)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies

other example from php.net

$ php -v
PHP 5.3.1 (cli) (built: Dec 11 2009 19:55:07)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2009 Zend Technologies

Add get_go_version

On my ubuntu I can do go version which returns :
go version go1.12.10 linux/amd64

other Ubuntu results found on SO :
go version go1.1.1 linux/amd64
go version go1.6beta1 linux/amd64

Also version with only major minor on medium :
go version go1.8 linux/amd64

Windows looks similar on this blog
go version go1.10 windows/amd64

And apparently similar on macos :
go version go1.13.3 darwin/amd64

Beta version : go version go1.11beta1 darwin/amd64

Could not find any alpha or rc

Support for helm

It would be so nice to add support for helm.
Currently, the version is a bit too technical.

Client: &version.Version{SemVer:"v2.15.1", GitCommit:"cf1de4f8ba70eded310918a8af3a96bfe8e7683b", GitTreeState:"clean"}
Server: &version.Version{SemVer:"v2.15.1", GitCommit:"cf1de4f8ba70eded310918a8af3a96bfe8e7683b", GitTreeState:"clean"}

It would be nice just to have the semver, that is 2.15.1.
I don't know if this should make a distinction between client and server or simply return a tuple.

Support for kubectl

It would be so nice to add support for kubectl.
Currently, the version is a bit too technical.

Client Version: version.Info{Major:"1", Minor:"16", GitVersion:"v1.16.2", GitCommit:"c97fe5036ef3df2967d086711e6c0c405941e14b", GitTreeState:"clean", BuildDate:"2019-10-15T19:18:23Z", GoVersion:"go1.12.10", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"14+", GitVersion:"v1.14.6-eks-5047ed", GitCommit:"5047edce664593832e9b889e447ac75ab104f527", GitTreeState:"clean", BuildDate:"2019-08-21T22:32:40Z", GoVersion:"go1.12.9", Compiler:"gc", Platform:"linux/amd64"}

It would be nice just to have the git version, that is 1.16.2.
I don't know if this should make a distinction between client and server or simply return a tuple.

Use universions as CLI

I agree with @Kineolyan that universions should be usable as a CLI command.

I add into the roadmap for 1.0.0

I will also create a tag for the CLI issues

Disable builds for master on forks

Currently, the Github actions are running when a fork updates its master branch.
This causes the release workflow to be run and particularly trying to release the documentation.
As there are no way to control the state of those distant master branches, it is safer to prevent them from releasing anything.

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.