Skip to content

Commit

Permalink
Merge pull request #319 from ceteri/fix_unit_tests
Browse files Browse the repository at this point in the history
Fix unit tests, try to integrate `pyproject.toml`
  • Loading branch information
ceteri authored Aug 9, 2023
2 parents 14b364d + 271ad28 commit 0146377
Show file tree
Hide file tree
Showing 7 changed files with 406 additions and 101 deletions.
11 changes: 3 additions & 8 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ python-dateutil = ">=2.8"
pyvis = ">=0.1.9"
rdflib = ">=6.1"
requests = ">=2.27"
scikit-learn = "==1.1.2"
scikit-learn = "==1.1.3"
scipy = ">=1.8.0"
statsmodels = ">=0.13"
tqdm = ">=4.63"
Expand Down Expand Up @@ -55,17 +55,12 @@ pylint = ">=2.12"
pymdown-extensions = ">=9.2"
pytest = ">=7.1"
responses = ">=0.19"
scikit-learn = ">=1.0"
scikit-learn = ">=1.1"
selenium = ">=4.1"
twine = ">=3.8"
types-python-dateutil = ">=2.8"
types-requests = ">=2.27"
xmltodict = ">=0.12"

[requires]
# python_version = "3.11"
# python_version = "3.10"
# python_version = "3.9"
# python_version = "3.8"
# python_version = "3.7"
# python_version = "3"
python_version = "3.7"
39 changes: 19 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,62 +36,59 @@ Morph-KGC, pythonPSL, and many more.
See the ["Getting Started"](https://derwen.ai/docs/kgl/start/)
section of the online documentation.

## Useing kglab as a package for your project

### We recommend installing from [PyPi](https://pypi.python.org/pypi/kglab):
### Using `kglab` as a library for your Python project

#### pip
```bash
python3 -m pip install kglab
```
We recommend installing from [PyPi](https://pypi.python.org/pypi/kglab) or [conda](https://anaconda.org/anaconda/conda):

#### 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
```
#### `pip`

If you have not specified the python version in your Pipfile, you can install kglab with:
```bash
pipenv install --python 3.7 kglab
python3 -m pip install kglab
```

#### poetry
You can install into you existing poetry project with:
#### `pipenv`

```bash
potery add kglab
pipenv install kglab
```

#### conda
#### `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
conda activate kglab
```

### Sample Code

Then to run some simple uses of this library:

```python
import kglab

Expand Down Expand Up @@ -136,12 +133,14 @@ Also, container images for each release are available on DockerHub:
<https://hub.docker.com/repository/docker/derwenai/kglab>

To build a container image and run it for the tutorials:

```bash
docker build --pull --rm -f "docker/Dockerfile" -t kglab:latest .
docker run -p 8888:8888 -it kglab
```

To build and run a container image for testing:

```bash
docker build --pull --rm -f "docker/testsuite.Dockerfile" -t kglabtest:latest .
docker run --rm -it kglabtest
Expand Down
5 changes: 5 additions & 0 deletions for_poetry/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#### `poetry`

```bash
poetry add kglab
```
148 changes: 148 additions & 0 deletions for_poetry/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@


[tool.poetry]
name = "kglab"
version = "0.6.7"
description = "a simple abstraction layer in Python for building knowledge graphs"
license = "MIT"
authors = ["Paco Nathan"]
maintainers = ["kglab contributors"]
repository = "https://github.com/DerwenAI/kglab"
homepage = "https//derwen.ai/docs/kgl/"
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"
100 changes: 29 additions & 71 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,65 +1,11 @@
[build-system]
requires = ["flit_core >=3.2,<4"]
build-backend = "flit_core.buildapi"

[project]
name = "kglab"
version = "0.6.7"
authors = [
{name = "Paco Nathan", email = "info@derwen.ai"}
{name = "Paco Nathan", email = "paco@derwen.ai"},
]
description = "A simple abstraction layer in Python for building knowledge graphs"
readme = "README.md"
license = {file = "LICENSE"}
description = "a simple abstraction layer in Python for building knowledge graphs"
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 = [
"Development Status :: 5 - Production/Stable",
"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",
]
license = {text = "MIT"}
keywords = [
"controlled vocabulary",
"cugraph",
Expand Down Expand Up @@ -93,18 +39,30 @@ keywords = [
"statistical relational learning",
"topology",
"turtle",
"validation",
"validation"
]
dynamic = ["version"]

[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"
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"
]
dynamic = ["dependencies", "readme"]

[project.entry-points."rdf.plugins.store"]
kglab = "kglab:PropertyStore"
[tool.setuptools.dynamic]
dependencies = {file = ["requirements.txt"]}
readme = {file = ["README.md"]}
Loading

0 comments on commit 0146377

Please sign in to comment.