Skip to content

Commit

Permalink
exclude matcha and depedencies from build
Browse files Browse the repository at this point in the history
  • Loading branch information
PedroCotovio committed May 7, 2024
1 parent 1ff4188 commit acdf1e9
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 5 deletions.
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ Matcha-DL is an extension of the matching system Matcha to tackle semi-supervise

## Installation

**Still under development** :
The package is stil undergoing testing, we will have a distribution available on Pypi soon

To install Matcha DL, you can use pip:
```bash
pip install matcha-dl
Expand Down
32 changes: 32 additions & 0 deletions matcha_dl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,38 @@
import yaml
from deeponto import init_jvm

import tarfile
import os
import urllib.request

MATCHA_DL_DIR = Path(__file__).parent

print(MATCHA_DL_DIR)

# If matchaJar and dependencies don't exist, download them.

def download_macha():
url = "https://github.com/liseda-lab/Matcha-DL/releases/download/JARv0.1.0/matcha_jar.tar.gz"
download_path = MATCHA_DL_DIR / "impl/matcha/"
filename = download_path / "macha.tar.gz"

# Download the matcha directory
print("Downloading Matcha-DL jar and dependencies...")
urllib.request.urlretrieve(url, str(filename))

# Uncompress the tar.gz file
print("Uncompressing Matcha-DL jar and dependencies...")
with tarfile.open(str(filename), 'r:gz') as tar_ref:
tar_ref.extractall(download_path)

# Remove the tar.gz file
os.remove(str(filename))

# Check if the matcha directory exists
if not (MATCHA_DL_DIR / "impl/matcha/matcha/").exists():
print("Matcha-DL jar and dependencies not found. Downloading...")
download_macha()

# Init JVM to skip prompt

init_jvm("8G")
Expand Down
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
[tool.poetry]
name = "matcha-dl"
version = "0.1.0"
version = "0.1.1"
description = "Matcha-DL is a tool for supervised ontology alignment. It takes as input two ontologies and a set of mappings between them, and learns a model that can predict mappings between the two ontologies."
authors = ["Pedro Cotovio <[email protected]>"]
readme = "README.md"
repository = "https://github.com/liseda-lab/Matcha-DL"
packages = [
{ include = "matcha_dl" },
]

include = ["matcha_dl/**/*"]
exclude = ["matcha_dl/impl/matcha/matcha/**/*"]

[tool.poetry.dependencies]
python = "^3.10"
Expand Down

0 comments on commit acdf1e9

Please sign in to comment.