From 92a2433c7e35b61012a4e319e4a9cdd27a93fbfd Mon Sep 17 00:00:00 2001 From: jake Date: Wed, 23 Nov 2022 17:26:21 -0700 Subject: [PATCH 1/7] Updated README.md, pyproject.toml .pre-commit-config.yaml and created a Pipfile updated .gitignore. Need to check some args in pre-commit-config not 100% clear on what is needed. --- .gitignore | 3 ++ .pre-commit-config.yaml | 15 ++++++ Pipfile | 66 +++++++++++++++++++++++ README.md | 30 ++++++++++- pyproject.toml | 116 ++++++++++++++++++++++++++++++++++++++++ 5 files changed, 229 insertions(+), 1 deletion(-) create mode 100644 Pipfile create mode 100644 pyproject.toml diff --git a/.gitignore b/.gitignore index 8746a56..14b3566 100644 --- a/.gitignore +++ b/.gitignore @@ -144,3 +144,6 @@ dmypy.json .pyre/ report-* +Pipfile.lock +poetry.lock +/BKUP_pyproject.toml.bkup diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9f2fb3c..0ab2cb7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -37,3 +37,18 @@ repos: exclude: ^examples\/|.*\.ipynb language: python types: [text] +- repo: https://github.com/python-poetry/poetry + rev: '' # add version here + hooks: + - id: poetry-check + - id: poetry-lock + - id: poetry-export + # TODO: check is it a single argument or multiple arguments + args: ["-f", "requirements.txt", "-o", "requirements.txt"] + args: ["--dev", "-f", "requirements-dev.txt", "-o", "requirements-dev.txt"] + args: ["--tut"-f", "requirements-tut.txt", "-o", "requirements-tut.txt"] + + verbose: true + + + diff --git a/Pipfile b/Pipfile new file mode 100644 index 0000000..4f54b95 --- /dev/null +++ b/Pipfile @@ -0,0 +1,66 @@ +[[source]] +url = "https://pypi.org/simple" +verify_ssl = true +name = "pypi" + +[packages] +aiohttp = ">=3.8" +chocolate = ">=0.0.2" +csvwlib = ">=0.3.2" +cryptography = ">=35.0" +decorator = ">=5.1" +fsspec = {version = ">=2022.2", extras = ["gs", "s3"]} +gcsfs = ">=2022.2" +icecream = ">=2.1" +morph-kgc = ">=2.0.0" +networkx = ">=2.7" +numpy = ">=1.23.0" +owlrl = ">=6.0.2" +oxrdflib = ">=0.3.1" +pandas = ">=1.4" +pslpython = ">=2.2.2" +pyarrow = ">=7.0" +pynvml = ">=11.4" +pyshacl = ">=0.18" +python-dateutil = ">=2.8" +pyvis = ">=0.1.9" +rdflib = ">=6.1" +requests = ">=2.27" +scikit-learn = "==1.1.2" +scipy = ">=1.8.0" +statsmodels = ">=0.13" +tqdm = ">=4.63" +urlpath = ">=1.2" + +[dev-packages] +black = "*" +bandit = ">=1.7" +codespell = ">=2.1" +coverage = ">=6.3" +flask = ">=2.0" +grayskull = ">=1.1" +jupyterlab = ">=3.3" +mistune = ">=0.8" +mkdocs-git-revision-date-plugin = ">=0.3" +mkdocs-material = ">=8.2" +mknotebooks = ">=0.7" +mypy = ">=0.940" +nbconvert = ">=6.4" +nbmake = ">=1.3" +notebook = ">=6.4" +pipdeptree = ">=2.2" +pre-commit = ">=2.17" +pygments = ">=2.11" +pylint = ">=2.12" +pymdown-extensions = ">=9.2" +pytest = ">=7.1" +responses = ">=0.19" +scikit-learn = ">=1.0" +selenium = ">=4.1" +twine = ">=3.8" +types-python-dateutil = ">=2.8" +types-requests = ">=2.27" +xmltodict = ">=0.12" + +[requires] +python_version = "3.10" diff --git a/README.md b/README.md index 8c6ae5c..9c2f0ed 100644 --- a/README.md +++ b/README.md @@ -38,18 +38,46 @@ Morph-KGC, pythonPSL, and many more. See the ["Getting Started"](https://derwen.ai/docs/kgl/start/) section of the online documentation. -We recommend installing from [PyPi](https://pypi.python.org/pypi/kglab): +## Useing kglab as a package for your project + +### We recommend installing from [PyPi](https://pypi.python.org/pypi/kglab): + +#### pip ```bash python3 -m pip install kglab ``` +#### pipenv +```bash +pipenv install kglab +``` + +#### poetry +```bash +potery add kglab +``` + +#### conda +```bash +conda env create -n kglab +conda activate kglab +pip install kglab +``` + +### Or, install from source: If you work directly from this Git repo, be sure to install the dependencies: +#### pip ```bash python3 -m pip install -U pip python3 -m pip install -r requirements.txt ``` +#### pipenv +```bash +pipenv install --dev +# NEED TO HAVE a Pipfile +``` Alternatively, to install dependencies using `conda`: ```bash conda env create -f environment.yml --force diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..43ab3f2 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,116 @@ +[tool.poetry] +name = "kglab" +version = "0.1.0" +description = "a simple abstraction layer in Python for building knowledge graphs" +license = "MIT" +authors = ["Paco Nathan, Derwen, Inc"] +maintainers = ["KGLab Contributors <"] +repository = "https://github.com/DerwenAI/kglab" +homepage = "derwen.ai" +readme = "README.md" +documentation = "https://derwen.ai/docs/kgl/" +keywords = [ + "controlled vocabulary", "cugraph", "deep learning", "embedding", "gpu", "graph algorithms", "igraph", "inference", + "interactive visualization", "json-ld", "knowledge graph", "managing namespaces", "morph-kgc", "n3", "networkx", + "owl", "pandas", "parquet", "probabilistic soft logic", "psl", "pyvis", "rapids", "rdf", "rml", "roam research", + "serialization", "shacl", "skos", "sparql", "statistical relational learning", "topology", "turtle", "validation" + ] +classifiers = [ + "Programming Language :: Python", "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", + "Operating System :: OS Independent", + "License :: OSI Approved :: MIT License", + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Developers", "Intended Audience :: Education", + "Intended Audience :: Information Technology", "Intended Audience :: Science/Research", + "Topic :: Scientific/Engineering :: Artificial Intelligence", + "Topic :: Scientific/Engineering :: Human Machine Interfaces", + "Topic :: Scientific/Engineering :: Information Analysis", + "Topic :: Software Development :: Libraries :: Python Modules", + "Topic :: Text Processing :: Indexing", + ] + + + + +[tool.poetry.dependencies] +python = "^3.10" +aiohttp = "^3.8.1" +chocolate = "^0.0.2" +csvwlib = "^0.3.2" +cryptography = "^38.0.1" +decorator = "^5.1.1" +fsspec = {extras = ["gs", "s3"], version = "^2022.8.2"} +gcsfs = "^2022.8.2" +icecream = "^2.1.3" +morph-kgc = "^2.2.0" +networkx = "^2.8.6" +numpy = "^1.23.3" +owlrl = "^6.0.2" +oxrdflib = "^0.3.2" +pandas = "^1.4.4" +pslpython = "^2.3.0" +pyarrow = "^9.0.0" +pynvml = "^11.4.1" +pyshacl = "^0.20.0" +python-dateutil = "^2.8.2" +pyvis = "^0.2.1" +rdflib = "^6.2.0" +requests = "^2.28.1" +tqdm = "^4.64.1" +urlpath = "^1.2.0" +bandit = "^1.7.4" +codespell = "^2.2.1" +coverage = "^6.4.4" +Flask = "^2.2.2" +grayskull = "^1.8.3" +mistune = "^2.0.4" +mkdocs-git-revision-date-plugin = "^0.3.2" +mkdocs-material = "^8.5.1" +pipdeptree = "^2.3.1" +Pygments = "^2.13.0" +pymdown-extensions = "^9.5" +responses = "^0.21.0" +selenium = "^4.4.3" +twine = "^4.0.1" +types-python-dateutil = "^2.8.19" +types-requests = "^2.28.10" +wheel = "^0.37.1" +xmltodict = "^0.13.0" + +[tool.poetry.group.dev.dependencies] +pytest = "^7.1.3" +pre-commit = "^2.20.0" +mypy = "^0.971" +black = "^22.8.0" +flake8 = "^5.0.4" +mypy = "^0.971" +pylint = "^2.15.2" +flake8-pylint = "^0.1.3" +bandit = "^1.7.4" +flake8-bandit = "^4.1.1" +mkdocs-git-revision-date-plugin = "^0.3.2" +mkdocs-material = "^8.5.1" + + +[tool.poetry.group.tut.dependencies] +cairocffi = "^1.3" +gensim = "^3.8" +igraph = "^0.9" +jupyterlab = "^3.1.4" +leidenalg = "^0.8" +matplotlib = "^3.3.4" +pylev = "^1.3" + + + + +tool.poetry.scripts = [ + "Makefile = Makefile:main", + +] + +[build-system] +requires = ["poetry-core"] +build-backend = "poetry.core.masonry.api" From 46a1d0754f8de5212faf6d8c13ff44d451c80c2c Mon Sep 17 00:00:00 2001 From: jake Date: Wed, 23 Nov 2022 17:28:56 -0700 Subject: [PATCH 2/7] Updated README.md, pyproject.toml .pre-commit-config.yaml and created a Pipfile updated .gitignore. Need to check some args in pre-commit-config not 100% clear on what is needed. --- .gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitignore b/.gitignore index 14b3566..5863eb2 100644 --- a/.gitignore +++ b/.gitignore @@ -146,4 +146,3 @@ dmypy.json report-* Pipfile.lock poetry.lock -/BKUP_pyproject.toml.bkup From 98fd04514e82ae9e3b1eb7f5ffd9b25397593684 Mon Sep 17 00:00:00 2001 From: jake Date: Mon, 28 Nov 2022 12:47:29 -0700 Subject: [PATCH 3/7] clean up for pipenv and poetry installs --- .gitignore | 8 +- .pre-commit-config.yaml | 2 +- pyproject.toml | 24 ++--- wip/poetry_build/.pre-commit-config.yaml | 53 ++++++++++++ wip/poetry_build/pyproject.toml | 106 +++++++++++++++++++++++ 5 files changed, 173 insertions(+), 20 deletions(-) create mode 100644 wip/poetry_build/.pre-commit-config.yaml create mode 100644 wip/poetry_build/pyproject.toml diff --git a/.gitignore b/.gitignore index 5ff9f54..36af156 100644 --- a/.gitignore +++ b/.gitignore @@ -106,7 +106,7 @@ ipython_config.py # However, in case of collaboration, if having platform-specific dependencies or dependencies # having no cross-platform support, pipenv may install dependencies that don't work, or not # install all needed dependencies. -#Pipfile.lock +Pipfile.lock # PEP 582; used by e.g. github.com/David-OConnor/pyflow __pypackages__/ @@ -146,5 +146,9 @@ dmypy.json .pyre/ report-* -Pipfile.lock + +# poetry lock file poetry.lock + +*.zip +.DS_Store diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 044840a..3c9beeb 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -36,7 +36,7 @@ repos: exclude: ^examples\/|.*\.ipynb language: python types: [text] -- repo: https://github.com/python-poetry/poetry +- repot status: https://github.com/python-poetry/poetry rev: '' # add version here hooks: - id: poetry-check diff --git a/pyproject.toml b/pyproject.toml index 43ab3f2..2156f7f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ version = "0.1.0" description = "a simple abstraction layer in Python for building knowledge graphs" license = "MIT" authors = ["Paco Nathan, Derwen, Inc"] -maintainers = ["KGLab Contributors <"] +maintainers = ["KGLab Contributors "] repository = "https://github.com/DerwenAI/kglab" homepage = "derwen.ai" readme = "README.md" @@ -31,9 +31,6 @@ classifiers = [ "Topic :: Text Processing :: Indexing", ] - - - [tool.poetry.dependencies] python = "^3.10" aiohttp = "^3.8.1" @@ -60,9 +57,6 @@ rdflib = "^6.2.0" requests = "^2.28.1" tqdm = "^4.64.1" urlpath = "^1.2.0" -bandit = "^1.7.4" -codespell = "^2.2.1" -coverage = "^6.4.4" Flask = "^2.2.2" grayskull = "^1.8.3" mistune = "^2.0.4" @@ -78,11 +72,10 @@ types-python-dateutil = "^2.8.19" types-requests = "^2.28.10" wheel = "^0.37.1" xmltodict = "^0.13.0" - [tool.poetry.group.dev.dependencies] pytest = "^7.1.3" pre-commit = "^2.20.0" -mypy = "^0.971" +# mypy = "^0.971" black = "^22.8.0" flake8 = "^5.0.4" mypy = "^0.971" @@ -92,7 +85,8 @@ bandit = "^1.7.4" flake8-bandit = "^4.1.1" mkdocs-git-revision-date-plugin = "^0.3.2" mkdocs-material = "^8.5.1" - +codespell = "^2.2.1" +coverage = "^6.4.4" [tool.poetry.group.tut.dependencies] cairocffi = "^1.3" @@ -103,13 +97,9 @@ leidenalg = "^0.8" matplotlib = "^3.3.4" pylev = "^1.3" - - - -tool.poetry.scripts = [ - "Makefile = Makefile:main", - -] +# tool.poetry.scripts = [ +# "Makefile = Makefile:main", +# ] [build-system] requires = ["poetry-core"] diff --git a/wip/poetry_build/.pre-commit-config.yaml b/wip/poetry_build/.pre-commit-config.yaml new file mode 100644 index 0000000..3c9beeb --- /dev/null +++ b/wip/poetry_build/.pre-commit-config.yaml @@ -0,0 +1,53 @@ +# See https://pre-commit.com for more information +# See https://pre-commit.com/hooks.html for more hooks +default_stages: [commit, push] +default_language_version: + python: python3 +exclude: "dat" +repos: +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v3.4.0 + hooks: + - id: check-builtin-literals + - id: check-merge-conflict + - id: debug-statements + - id: detect-private-key +- repo: https://github.com/PyCQA/bandit + rev: 1.7.0 + hooks: + - id: bandit # security vulnerabilities + args: [ "--exclude", "setup.py,bin,tests" ] +- repo: https://github.com/pre-commit/mirrors-mypy + rev: v0.812 + hooks: + - id: mypy # type annotations + exclude: ^examples/,^wip/,^tests/ +- repo: https://github.com/PyCQA/pylint + rev: pylint-2.7.2 + hooks: + - id: pylint + exclude: ^wip/,^tests/ + files: ^kglab/ +- repo: https://github.com/codespell-project/codespell + rev: v2.0.0 + hooks: + - id: codespell # spell-check source code + args: ["-L", "wit,fils,basf"] # comma separated list of words to ignore. + exclude: ^examples\/|.*\.ipynb + language: python + types: [text] +- repot status: https://github.com/python-poetry/poetry + rev: '' # add version here + hooks: + - id: poetry-check + - id: poetry-lock + - id: poetry-export + # TODO: check is it a single argument or multiple arguments + args: ["-f", "requirements.txt", "-o", "requirements.txt"] + args: ["--dev", "-f", "requirements-dev.txt", "-o", "requirements-dev.txt"] + args: ["--tut"-f", "requirements-tut.txt", "-o", "requirements-tut.txt"] + + verbose: true + + + diff --git a/wip/poetry_build/pyproject.toml b/wip/poetry_build/pyproject.toml new file mode 100644 index 0000000..2156f7f --- /dev/null +++ b/wip/poetry_build/pyproject.toml @@ -0,0 +1,106 @@ +[tool.poetry] +name = "kglab" +version = "0.1.0" +description = "a simple abstraction layer in Python for building knowledge graphs" +license = "MIT" +authors = ["Paco Nathan, Derwen, Inc"] +maintainers = ["KGLab Contributors "] +repository = "https://github.com/DerwenAI/kglab" +homepage = "derwen.ai" +readme = "README.md" +documentation = "https://derwen.ai/docs/kgl/" +keywords = [ + "controlled vocabulary", "cugraph", "deep learning", "embedding", "gpu", "graph algorithms", "igraph", "inference", + "interactive visualization", "json-ld", "knowledge graph", "managing namespaces", "morph-kgc", "n3", "networkx", + "owl", "pandas", "parquet", "probabilistic soft logic", "psl", "pyvis", "rapids", "rdf", "rml", "roam research", + "serialization", "shacl", "skos", "sparql", "statistical relational learning", "topology", "turtle", "validation" + ] +classifiers = [ + "Programming Language :: Python", "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", + "Operating System :: OS Independent", + "License :: OSI Approved :: MIT License", + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Developers", "Intended Audience :: Education", + "Intended Audience :: Information Technology", "Intended Audience :: Science/Research", + "Topic :: Scientific/Engineering :: Artificial Intelligence", + "Topic :: Scientific/Engineering :: Human Machine Interfaces", + "Topic :: Scientific/Engineering :: Information Analysis", + "Topic :: Software Development :: Libraries :: Python Modules", + "Topic :: Text Processing :: Indexing", + ] + +[tool.poetry.dependencies] +python = "^3.10" +aiohttp = "^3.8.1" +chocolate = "^0.0.2" +csvwlib = "^0.3.2" +cryptography = "^38.0.1" +decorator = "^5.1.1" +fsspec = {extras = ["gs", "s3"], version = "^2022.8.2"} +gcsfs = "^2022.8.2" +icecream = "^2.1.3" +morph-kgc = "^2.2.0" +networkx = "^2.8.6" +numpy = "^1.23.3" +owlrl = "^6.0.2" +oxrdflib = "^0.3.2" +pandas = "^1.4.4" +pslpython = "^2.3.0" +pyarrow = "^9.0.0" +pynvml = "^11.4.1" +pyshacl = "^0.20.0" +python-dateutil = "^2.8.2" +pyvis = "^0.2.1" +rdflib = "^6.2.0" +requests = "^2.28.1" +tqdm = "^4.64.1" +urlpath = "^1.2.0" +Flask = "^2.2.2" +grayskull = "^1.8.3" +mistune = "^2.0.4" +mkdocs-git-revision-date-plugin = "^0.3.2" +mkdocs-material = "^8.5.1" +pipdeptree = "^2.3.1" +Pygments = "^2.13.0" +pymdown-extensions = "^9.5" +responses = "^0.21.0" +selenium = "^4.4.3" +twine = "^4.0.1" +types-python-dateutil = "^2.8.19" +types-requests = "^2.28.10" +wheel = "^0.37.1" +xmltodict = "^0.13.0" +[tool.poetry.group.dev.dependencies] +pytest = "^7.1.3" +pre-commit = "^2.20.0" +# mypy = "^0.971" +black = "^22.8.0" +flake8 = "^5.0.4" +mypy = "^0.971" +pylint = "^2.15.2" +flake8-pylint = "^0.1.3" +bandit = "^1.7.4" +flake8-bandit = "^4.1.1" +mkdocs-git-revision-date-plugin = "^0.3.2" +mkdocs-material = "^8.5.1" +codespell = "^2.2.1" +coverage = "^6.4.4" + +[tool.poetry.group.tut.dependencies] +cairocffi = "^1.3" +gensim = "^3.8" +igraph = "^0.9" +jupyterlab = "^3.1.4" +leidenalg = "^0.8" +matplotlib = "^3.3.4" +pylev = "^1.3" + +# tool.poetry.scripts = [ +# "Makefile = Makefile:main", +# ] + +[build-system] +requires = ["poetry-core"] +build-backend = "poetry.core.masonry.api" From 1fadfa1e6732cf21f640b748c3ca427bdea0bc74 Mon Sep 17 00:00:00 2001 From: jake Date: Mon, 28 Nov 2022 13:03:26 -0700 Subject: [PATCH 4/7] Update Pipfile python version --- Pipfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Pipfile b/Pipfile index 4f54b95..136f770 100644 --- a/Pipfile +++ b/Pipfile @@ -63,4 +63,4 @@ types-requests = ">=2.27" xmltodict = ">=0.12" [requires] -python_version = "3.10" +python_version = ">=python 3.7" From d7b4ccc165c28026862e01a9ada93279396cf09c Mon Sep 17 00:00:00 2001 From: jake Date: Mon, 28 Nov 2022 13:15:19 -0700 Subject: [PATCH 5/7] clean up wip dir --- wip/poetry_build/.pre-commit-config.yaml | 53 ------------ wip/poetry_build/pyproject.toml | 106 ----------------------- 2 files changed, 159 deletions(-) delete mode 100644 wip/poetry_build/.pre-commit-config.yaml delete mode 100644 wip/poetry_build/pyproject.toml diff --git a/wip/poetry_build/.pre-commit-config.yaml b/wip/poetry_build/.pre-commit-config.yaml deleted file mode 100644 index 3c9beeb..0000000 --- a/wip/poetry_build/.pre-commit-config.yaml +++ /dev/null @@ -1,53 +0,0 @@ -# See https://pre-commit.com for more information -# See https://pre-commit.com/hooks.html for more hooks -default_stages: [commit, push] -default_language_version: - python: python3 -exclude: "dat" -repos: -- repo: https://github.com/pre-commit/pre-commit-hooks - rev: v3.4.0 - hooks: - - id: check-builtin-literals - - id: check-merge-conflict - - id: debug-statements - - id: detect-private-key -- repo: https://github.com/PyCQA/bandit - rev: 1.7.0 - hooks: - - id: bandit # security vulnerabilities - args: [ "--exclude", "setup.py,bin,tests" ] -- repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.812 - hooks: - - id: mypy # type annotations - exclude: ^examples/,^wip/,^tests/ -- repo: https://github.com/PyCQA/pylint - rev: pylint-2.7.2 - hooks: - - id: pylint - exclude: ^wip/,^tests/ - files: ^kglab/ -- repo: https://github.com/codespell-project/codespell - rev: v2.0.0 - hooks: - - id: codespell # spell-check source code - args: ["-L", "wit,fils,basf"] # comma separated list of words to ignore. - exclude: ^examples\/|.*\.ipynb - language: python - types: [text] -- repot status: https://github.com/python-poetry/poetry - rev: '' # add version here - hooks: - - id: poetry-check - - id: poetry-lock - - id: poetry-export - # TODO: check is it a single argument or multiple arguments - args: ["-f", "requirements.txt", "-o", "requirements.txt"] - args: ["--dev", "-f", "requirements-dev.txt", "-o", "requirements-dev.txt"] - args: ["--tut"-f", "requirements-tut.txt", "-o", "requirements-tut.txt"] - - verbose: true - - - diff --git a/wip/poetry_build/pyproject.toml b/wip/poetry_build/pyproject.toml deleted file mode 100644 index 2156f7f..0000000 --- a/wip/poetry_build/pyproject.toml +++ /dev/null @@ -1,106 +0,0 @@ -[tool.poetry] -name = "kglab" -version = "0.1.0" -description = "a simple abstraction layer in Python for building knowledge graphs" -license = "MIT" -authors = ["Paco Nathan, Derwen, Inc"] -maintainers = ["KGLab Contributors "] -repository = "https://github.com/DerwenAI/kglab" -homepage = "derwen.ai" -readme = "README.md" -documentation = "https://derwen.ai/docs/kgl/" -keywords = [ - "controlled vocabulary", "cugraph", "deep learning", "embedding", "gpu", "graph algorithms", "igraph", "inference", - "interactive visualization", "json-ld", "knowledge graph", "managing namespaces", "morph-kgc", "n3", "networkx", - "owl", "pandas", "parquet", "probabilistic soft logic", "psl", "pyvis", "rapids", "rdf", "rml", "roam research", - "serialization", "shacl", "skos", "sparql", "statistical relational learning", "topology", "turtle", "validation" - ] -classifiers = [ - "Programming Language :: Python", "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", - "Operating System :: OS Independent", - "License :: OSI Approved :: MIT License", - "Development Status :: 5 - Production/Stable", - "Intended Audience :: Developers", "Intended Audience :: Education", - "Intended Audience :: Information Technology", "Intended Audience :: Science/Research", - "Topic :: Scientific/Engineering :: Artificial Intelligence", - "Topic :: Scientific/Engineering :: Human Machine Interfaces", - "Topic :: Scientific/Engineering :: Information Analysis", - "Topic :: Software Development :: Libraries :: Python Modules", - "Topic :: Text Processing :: Indexing", - ] - -[tool.poetry.dependencies] -python = "^3.10" -aiohttp = "^3.8.1" -chocolate = "^0.0.2" -csvwlib = "^0.3.2" -cryptography = "^38.0.1" -decorator = "^5.1.1" -fsspec = {extras = ["gs", "s3"], version = "^2022.8.2"} -gcsfs = "^2022.8.2" -icecream = "^2.1.3" -morph-kgc = "^2.2.0" -networkx = "^2.8.6" -numpy = "^1.23.3" -owlrl = "^6.0.2" -oxrdflib = "^0.3.2" -pandas = "^1.4.4" -pslpython = "^2.3.0" -pyarrow = "^9.0.0" -pynvml = "^11.4.1" -pyshacl = "^0.20.0" -python-dateutil = "^2.8.2" -pyvis = "^0.2.1" -rdflib = "^6.2.0" -requests = "^2.28.1" -tqdm = "^4.64.1" -urlpath = "^1.2.0" -Flask = "^2.2.2" -grayskull = "^1.8.3" -mistune = "^2.0.4" -mkdocs-git-revision-date-plugin = "^0.3.2" -mkdocs-material = "^8.5.1" -pipdeptree = "^2.3.1" -Pygments = "^2.13.0" -pymdown-extensions = "^9.5" -responses = "^0.21.0" -selenium = "^4.4.3" -twine = "^4.0.1" -types-python-dateutil = "^2.8.19" -types-requests = "^2.28.10" -wheel = "^0.37.1" -xmltodict = "^0.13.0" -[tool.poetry.group.dev.dependencies] -pytest = "^7.1.3" -pre-commit = "^2.20.0" -# mypy = "^0.971" -black = "^22.8.0" -flake8 = "^5.0.4" -mypy = "^0.971" -pylint = "^2.15.2" -flake8-pylint = "^0.1.3" -bandit = "^1.7.4" -flake8-bandit = "^4.1.1" -mkdocs-git-revision-date-plugin = "^0.3.2" -mkdocs-material = "^8.5.1" -codespell = "^2.2.1" -coverage = "^6.4.4" - -[tool.poetry.group.tut.dependencies] -cairocffi = "^1.3" -gensim = "^3.8" -igraph = "^0.9" -jupyterlab = "^3.1.4" -leidenalg = "^0.8" -matplotlib = "^3.3.4" -pylev = "^1.3" - -# tool.poetry.scripts = [ -# "Makefile = Makefile:main", -# ] - -[build-system] -requires = ["poetry-core"] -build-backend = "poetry.core.masonry.api" From b2a841300454f74c7bee94d91d1d660dcbe4ac0b Mon Sep 17 00:00:00 2001 From: jake Date: Mon, 28 Nov 2022 13:22:39 -0700 Subject: [PATCH 6/7] cleanup for testing --- .pre-commit-config.yaml | 15 ---- Pipfile | 7 +- pyproject.toml | 194 ++++++++++++++++++++-------------------- 3 files changed, 105 insertions(+), 111 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3c9beeb..a7d0f85 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -36,18 +36,3 @@ repos: exclude: ^examples\/|.*\.ipynb language: python types: [text] -- repot status: https://github.com/python-poetry/poetry - rev: '' # add version here - hooks: - - id: poetry-check - - id: poetry-lock - - id: poetry-export - # TODO: check is it a single argument or multiple arguments - args: ["-f", "requirements.txt", "-o", "requirements.txt"] - args: ["--dev", "-f", "requirements-dev.txt", "-o", "requirements-dev.txt"] - args: ["--tut"-f", "requirements-tut.txt", "-o", "requirements-tut.txt"] - - verbose: true - - - diff --git a/Pipfile b/Pipfile index 136f770..d85b2d7 100644 --- a/Pipfile +++ b/Pipfile @@ -63,4 +63,9 @@ types-requests = ">=2.27" xmltodict = ">=0.12" [requires] -python_version = ">=python 3.7" +# python_version = "3.11" +# python_version = "3.10" +# python_version = "3.9" +# python_version = "3.8" +# python_version = "3.7" +# python_version = "3" diff --git a/pyproject.toml b/pyproject.toml index 2156f7f..f3528d0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,106 +1,110 @@ -[tool.poetry] +[build-system] +requires = ["flit_core >=3.2,<4"] +build-backend = "flit_core.buildapi" + +[project] name = "kglab" -version = "0.1.0" -description = "a simple abstraction layer in Python for building knowledge graphs" -license = "MIT" -authors = ["Paco Nathan, Derwen, Inc"] -maintainers = ["KGLab Contributors "] -repository = "https://github.com/DerwenAI/kglab" -homepage = "derwen.ai" +authors = [ + {name = "Paco Nathan", email = "info@derwen.ai"} +] +description = "A simple abstraction layer in Python for building knowledge graphs" readme = "README.md" -documentation = "https://derwen.ai/docs/kgl/" -keywords = [ - "controlled vocabulary", "cugraph", "deep learning", "embedding", "gpu", "graph algorithms", "igraph", "inference", - "interactive visualization", "json-ld", "knowledge graph", "managing namespaces", "morph-kgc", "n3", "networkx", - "owl", "pandas", "parquet", "probabilistic soft logic", "psl", "pyvis", "rapids", "rdf", "rml", "roam research", - "serialization", "shacl", "skos", "sparql", "statistical relational learning", "topology", "turtle", "validation" - ] +license = {file = "LICENSE"} +requires-python = ">=3.7" +dependencies = [ + "aiohttp >= 3.8", + "chocolate >= 0.0.2", + "csvwlib >= 0.3.2", + "cryptography >= 35.0", + "decorator >= 5.1", + "fsspec[gs,s3] >= 2022.2", + "gcsfs >= 2022.2", + "icecream >= 2.1", + "morph-kgc >= 2.0.0", + "networkx >= 2.7", + "numpy >= 1.23.0", + "owlrl >= 6.0.2", + "oxrdflib >= 0.3.1", + "pandas >= 1.4", + "pslpython >= 2.2.2", + "pyarrow >= 7.0", + "pynvml >= 11.4", + "pyshacl >= 0.18", + "python-dateutil >= 2.8", + "pyvis >= 0.1.9", + "rdflib >= 6.1", + "requests >= 2.27", + "scikit-learn == 1.1.3", + "scipy >= 1.8.0", + "statsmodels >= 0.13", + "tqdm >= 4.63", + "urlpath >= 1.2", +] classifiers = [ - "Programming Language :: Python", "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", - "Operating System :: OS Independent", - "License :: OSI Approved :: MIT License", "Development Status :: 5 - Production/Stable", - "Intended Audience :: Developers", "Intended Audience :: Education", - "Intended Audience :: Information Technology", "Intended Audience :: Science/Research", + "Intended Audience :: Developers", + "Intended Audience :: Education", + "Intended Audience :: Information Technology", + "Intended Audience :: Science/Research", + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python", "Topic :: Scientific/Engineering :: Artificial Intelligence", "Topic :: Scientific/Engineering :: Human Machine Interfaces", "Topic :: Scientific/Engineering :: Information Analysis", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Text Processing :: Indexing", - ] - -[tool.poetry.dependencies] -python = "^3.10" -aiohttp = "^3.8.1" -chocolate = "^0.0.2" -csvwlib = "^0.3.2" -cryptography = "^38.0.1" -decorator = "^5.1.1" -fsspec = {extras = ["gs", "s3"], version = "^2022.8.2"} -gcsfs = "^2022.8.2" -icecream = "^2.1.3" -morph-kgc = "^2.2.0" -networkx = "^2.8.6" -numpy = "^1.23.3" -owlrl = "^6.0.2" -oxrdflib = "^0.3.2" -pandas = "^1.4.4" -pslpython = "^2.3.0" -pyarrow = "^9.0.0" -pynvml = "^11.4.1" -pyshacl = "^0.20.0" -python-dateutil = "^2.8.2" -pyvis = "^0.2.1" -rdflib = "^6.2.0" -requests = "^2.28.1" -tqdm = "^4.64.1" -urlpath = "^1.2.0" -Flask = "^2.2.2" -grayskull = "^1.8.3" -mistune = "^2.0.4" -mkdocs-git-revision-date-plugin = "^0.3.2" -mkdocs-material = "^8.5.1" -pipdeptree = "^2.3.1" -Pygments = "^2.13.0" -pymdown-extensions = "^9.5" -responses = "^0.21.0" -selenium = "^4.4.3" -twine = "^4.0.1" -types-python-dateutil = "^2.8.19" -types-requests = "^2.28.10" -wheel = "^0.37.1" -xmltodict = "^0.13.0" -[tool.poetry.group.dev.dependencies] -pytest = "^7.1.3" -pre-commit = "^2.20.0" -# mypy = "^0.971" -black = "^22.8.0" -flake8 = "^5.0.4" -mypy = "^0.971" -pylint = "^2.15.2" -flake8-pylint = "^0.1.3" -bandit = "^1.7.4" -flake8-bandit = "^4.1.1" -mkdocs-git-revision-date-plugin = "^0.3.2" -mkdocs-material = "^8.5.1" -codespell = "^2.2.1" -coverage = "^6.4.4" - -[tool.poetry.group.tut.dependencies] -cairocffi = "^1.3" -gensim = "^3.8" -igraph = "^0.9" -jupyterlab = "^3.1.4" -leidenalg = "^0.8" -matplotlib = "^3.3.4" -pylev = "^1.3" +] +keywords = [ + "controlled vocabulary", + "cugraph", + "deep learning", + "embedding", + "gpu", + "graph algorithms", + "igraph", + "inference", + "interactive visualization", + "json-ld", + "knowledge graph", + "managing namespaces", + "morph-kgc", + "n3", + "networkx", + "owl", + "pandas", + "parquet", + "probabilistic soft logic", + "psl", + "pyvis", + "rapids", + "rdf", + "rml", + "roam research", + "serialization", + "shacl", + "skos", + "sparql", + "statistical relational learning", + "topology", + "turtle", + "validation", +] +dynamic = ["version"] -# tool.poetry.scripts = [ -# "Makefile = Makefile:main", -# ] +[project.urls] +Home = "https://derwen.ai/docs/kgl/" +DOI = "https://doi.org/10.5281/zenodo.6360664" +Discussions = "https://www.linkedin.com/groups/6725785/" +DockerHub = "https://hub.docker.com/r/derwenai/kglab" +Tutorial = "https://derwen.ai/docs/kgl/tutorial/" +Issues = "https://github.com/DerwenAI/kglab/issues" +Source = "https://github.com/DerwenAI/kglab" -[build-system] -requires = ["poetry-core"] -build-backend = "poetry.core.masonry.api" +[project.entry-points."rdf.plugins.store"] +kglab = "kglab:PropertyStore" From be3dd395e51cbbbbd6937d145f8e390980bb5d5f Mon Sep 17 00:00:00 2001 From: jake Date: Mon, 28 Nov 2022 13:30:45 -0700 Subject: [PATCH 7/7] Update README.md --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index 0fd5404..1f9f9e0 100644 --- a/README.md +++ b/README.md @@ -48,11 +48,20 @@ python3 -m pip install kglab ``` #### pipenv +Kglab supports python 3.7 and above. +You will need to specify the python version in your Pipfile or whne creating the pipenv +If you have specified the python version in your Pipfile, you can install kglab with: ```bash pipenv install kglab ``` +If you have not specified the python version in your Pipfile, you can install kglab with: +```bash +pipenv install --python 3.7 kglab +``` + #### poetry +You can install into you existing poetry project with: ```bash potery add kglab ```