Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Poetry build #300

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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__/
Expand Down Expand Up @@ -146,3 +146,9 @@ dmypy.json
.pyre/

report-*
Pipfile.lock
poetry.lock
/*.zip
env_install_test/pipenv_install/*
env_install_test/poetry_install/*
env_install_test/build
16 changes: 15 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ repos:
rev: pylint-2.7.2
hooks:
- id: pylint
exclude: ^wip/,^tests/
exclude: ^wip/,^tests/,^env_install_test/
files: ^kglab/
- repo: https://github.com/codespell-project/codespell
rev: v2.0.0
Expand All @@ -36,3 +36,17 @@ 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



66 changes: 66 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -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"
30 changes: 29 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 wheel
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
Expand Down
115 changes: 115 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
[tool.poetry]
name = "kglab"
version = "0.1.1a3"
description = "a simple abstraction layer in Python for building knowledge graphs"
license = "MIT"
authors = ["Paco Nathan, Derwen, Inc"]
maintainers = ["KGLab Team <[email protected]>"]
repository = "https://github.com/DerwenAI/kglab"
homepage = "https://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",
]

exclude = ["tests/rdf_tests/*"]


[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"
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.group.tests.dependencies]
# sk-learn
# scipy

# tool.poetry.scripts = [
# "Makefile = Makefile:main"
#]


[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"