pyopenapi/pyswagger

How can I determine the pyswagger version programatically?

MartinDelVecchio opened this issue · 7 comments

Most packages have a version attribute, but pyswagger does not. I have perused the source, and I haven't found any place where the pyswagger version is stored.

Am I missing something?

If not, can you please add a version attribute?

Thanks.

@MartinDelVecchio do you mean something like this? It indicates a __version__ property instead of version one.

Ah, my double underscores were eaten by the markup.

Yes, most of the packages I use have a __ version __ attribute. Usually a string such as '0.8.33', and I check minimum required versions like this

min_pytest_version = (3, 0, 7)
pytest_version = tuple (map (int, pytest.__version__.split ('.')))
if pytest_version < min_pytest_version:
    print >>sys.stderr, "Error:  requires py.test version %s; running %s" % (".".join (str (digit) for digit in min_pytest_version), ".".join (str (digit) for digit in pytest_version))
    sys.exit (1)

@MartinDelVecchio no problem, I'll add it in next release.

Thank you!

I wish I could star this project 100 times; it is exactly what I needed, and you have been super responsive to my pestering.

I just want to make this project a reliable component when using OpenAPI in python. Wish you could use it more and find more bugs before me :)

This issue should be fixed in v0.8.35, please feel free to open it if it's not working.

Verified. Thanks!