Skip to content

Commit

Permalink
added info about version of the program (#120)
Browse files Browse the repository at this point in the history
  • Loading branch information
StrikerRUS authored and izeigerman committed Nov 20, 2019
1 parent 45a1269 commit e0bae16
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 7 deletions.
4 changes: 4 additions & 0 deletions MANIFEST.in
@@ -0,0 +1,4 @@
include LICENSE
recursive-include m2cgen VERSION.txt
recursive-include m2cgen linear_algebra.*
global-exclude *.py[cod]
1 change: 1 addition & 0 deletions m2cgen/VERSION.txt
@@ -0,0 +1 @@
0.4.1
6 changes: 6 additions & 0 deletions m2cgen/__init__.py
@@ -1,3 +1,5 @@
import os

from .exporters import (
export_to_c,
export_to_go,
Expand All @@ -13,3 +15,7 @@
export_to_go,
export_to_javascript,
]

with open(os.path.join(os.path.dirname(os.path.realpath(__file__)),
"VERSION.txt")) as version_file:
__version__ = version_file.read().strip()
3 changes: 3 additions & 0 deletions m2cgen/cli.py
Expand Up @@ -60,6 +60,9 @@
help="Sets the maximum depth of the Python interpreter stack. "
"No limit by default",
default=MAX_RECURSION_DEPTH)
parser.add_argument(
"--version", "-v", action="version",
version='%(prog)s {}'.format(m2cgen.__version__))


def parse_args(args):
Expand Down
3 changes: 2 additions & 1 deletion setup.cfg
@@ -1,6 +1,7 @@
[metadata]
description-file = README.md
license-file = LICENSE
version = m2cgen/VERSION.txt

[flake8]
exclude = .git,generated_code_examples/
exclude = .git,generated_code_examples/
12 changes: 6 additions & 6 deletions setup.py
Expand Up @@ -3,19 +3,19 @@
with open("README.md", encoding="utf-8") as f:
long_description = f.read()

with open("m2cgen/VERSION.txt") as f:
version = f.read().strip()

setup(
name="m2cgen",
version="0.4.1",
version=version,
url="https://github.com/BayesWitnesses/m2cgen",
description="Code-generation for various ML models into native code.",
long_description=long_description,
long_description_content_type="text/markdown",
license="MIT",
packages=find_packages(exclude=["tests.*", "tests"]),
package_data={
"": ["linear_algebra.java", "linear_algebra.c", "linear_algebra.go",
"linear_algebra.js"],
},
packages=find_packages(exclude=["tests.*", "tests", "tools"]),
include_package_data=True,
classifiers=[
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
Expand Down

0 comments on commit e0bae16

Please sign in to comment.