From aaa3e7f38ac14e046e756648b7d2c1b5185f7f4b Mon Sep 17 00:00:00 2001 From: Mohammad Mahdi Mohajer Date: Wed, 2 Nov 2022 22:20:49 -0400 Subject: [PATCH] version:0.1.2 --> pathlib has been added. you should not use relative path in python packages --- MANIFEST.in | 1 + pyproject.toml | 3 +-- src/pyccmetrics/__init__.py | 2 +- src/pyccmetrics/metrics.py | 3 ++- 4 files changed, 5 insertions(+), 4 deletions(-) create mode 100644 MANIFEST.in diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..ae2020b --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1 @@ +include src/pyccmetrics/lib/my-languages.so \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index f808ff7..8f5e84e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "pyccmetrics" -version = "0.1.1" +version = "0.1.2" authors = [ { name="Mohammad Mahdi Mohajer", email="mmohajer9@hotmail.com" }, ] @@ -15,7 +15,6 @@ dependencies = [ "tree-sitter>=0.20.1", ] classifiers = [ - "Development Status :: 3 - Alpha", "Programming Language :: Python :: 3", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", diff --git a/src/pyccmetrics/__init__.py b/src/pyccmetrics/__init__.py index 37e207d..331983c 100644 --- a/src/pyccmetrics/__init__.py +++ b/src/pyccmetrics/__init__.py @@ -5,7 +5,7 @@ """ -__version__ = "0.1.0" +__version__ = "0.1.2" __author__ = "Mohammad Mahdi Mohajer" # __credits__ = "" diff --git a/src/pyccmetrics/metrics.py b/src/pyccmetrics/metrics.py index 4a5c30a..00efb0e 100644 --- a/src/pyccmetrics/metrics.py +++ b/src/pyccmetrics/metrics.py @@ -6,12 +6,13 @@ initial_metrics_dict, remove_comments_and_blanks, ) +from pathlib import Path class Metrics: def __init__(self, file_path): - self.java_lang = Language("lib/my-languages.so", "java") + self.java_lang = Language(Path(__file__).parent / "lib/my-languages.so", "java") self.parser = Parser() self.parser.set_language(self.java_lang)