Skip to content

Commit

Permalink
Merge pull request #20 from glaserL/master
Browse files Browse the repository at this point in the history
Support PEP517
  • Loading branch information
Callidon committed Jun 2, 2023
2 parents ccc17e0 + 53101a2 commit b6b5860
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 39 deletions.
19 changes: 0 additions & 19 deletions build-release.sh

This file was deleted.

8 changes: 0 additions & 8 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,8 @@ command -v pip >/dev/null 2>&1 || { echo >&2 "pip is required for the installati
command -v curl >/dev/null 2>&1 || { echo >&2 "curl is required for the installation of rdflib_hdt! Aborting installation..."; exit 1; }
command -v unzip >/dev/null 2>&1 || { echo >&2 "unzip is required for the installation of rdflib_hdt! Aborting installation..."; exit 1; }

echo "Downloading HDT..."
curl -LO https://github.com/rdfhdt/hdt-cpp/archive/v1.3.3.zip
unzip -qq v1.3.3.zip

echo "Installing dependencies..."
pipenv install

echo "Installing pyHDT..."
pipenv run python setup.py install

echo "Cleaning up..."
rm v1.3.3.zip
rm -rf hdt-cpp-1.3.3/
17 changes: 17 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[project]
name = "rdflib_hdt"
authors = [{ name = "Thomas Minier", email = "tminier01@gmail.com" }]
description = "A Store back-end for rdflib to allow for reading and querying HDT documents"
keywords = ["rdflib", "hdt", "rdf", "semantic web", "search"]
readme = "README.rst"
license = { text = "MIT License" }
dynamic = ["version"]
dependencies = ["rdflib>=4.2", "pybind11>=2.2.4"]

[project.urls]
homepage = "https://rdflib.dev/rdflib-hdt"
repository = "https://github.com/RDFLib/rdflib-hdt.git"

[build-system]
requires = ["pybind11", "setuptools >= 40.8.0", "wheel"]
build-backend = "setuptools.build_meta"
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[metadata]
description-file = README.rst
description_file = README.rst

[flake8]
ignore = E501
25 changes: 14 additions & 11 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
# setup.py
# Author: Thomas MINIER - MIT License 2017-2019
from setuptools import find_packages, setup, Extension
from os import listdir
from os import listdir, remove
from shutil import unpack_archive, move, rmtree
import urllib.request
import pybind11

__rdflib_hdt_version__ = "3.0"

with open('README.rst') as file:
long_description = file.read()
def download_hdt_and_unzip():
print("Downloading HDT...")
urllib.request.urlretrieve("https://github.com/rdfhdt/hdt-cpp/archive/v1.3.3.zip", "v1.3.3.zip")
unpack_archive("v1.3.3.zip", "tmp")
move("tmp/hdt-cpp-1.3.3", "hdt-cpp-1.3.3")
rmtree("tmp")

download_hdt_and_unzip()

def list_files(path: str, extension=".cpp", exclude="S.cpp"):
"""List paths to all files that ends with a given extension"""
Expand Down Expand Up @@ -75,15 +82,11 @@ def list_files(path: str, extension=".cpp", exclude="S.cpp"):
language='c++')

setup(
name="rdflib_hdt",
version=__rdflib_hdt_version__,
author="Thomas Minier",
author_email="tminier01@gmail.com",
url="https://github.com/RDFLib/rdflib-hdt",
description="A Store back-end for rdflib to allow for reading and querying HDT documents",
long_description=long_description,
keywords=["rdflib", "hdt", "rdf", "semantic web", "search"],
license="MIT",
packages=find_packages(exclude=["tests"]),
ext_modules=[hdt_extension]
)

print("Cleaning up...")
rmtree("hdt-cpp-1.3.3")
remove("v1.3.3.zip")

0 comments on commit b6b5860

Please sign in to comment.