This commit is contained in:
parent
43c7dddaec
commit
26891f95e8
|
@ -3,9 +3,7 @@ on: [push]
|
|||
|
||||
jobs:
|
||||
Package:
|
||||
uses: jmaa/workflows/.gitea/workflows/python-package.yaml@v3.26
|
||||
uses: jmaa/workflows/.gitea/workflows/python-package.yaml@main
|
||||
secrets:
|
||||
PIPY_REPO_USER: ${{ secrets.PIPY_REPO_USER }}
|
||||
PIPY_REPO_PASS: ${{ secrets.PIPY_REPO_PASS }}
|
||||
|
||||
|
||||
|
|
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,3 +1,4 @@
|
|||
__pycache__/
|
||||
*.egg-info/
|
||||
dist/
|
||||
*.sqlite
|
||||
|
|
|
@ -4,9 +4,9 @@
|
|||
import sys, os
|
||||
sys.path.append(os.path.join(os.path.dirname(__file__)))
|
||||
|
||||
from _version import __version__
|
||||
|
||||
import format
|
||||
import parse
|
||||
import schemeld
|
||||
import wikidata_ext
|
||||
|
||||
|
||||
|
|
1
datagraph/_version.py
Normal file
1
datagraph/_version.py
Normal file
|
@ -0,0 +1 @@
|
|||
__version__ = '0.1.1'
|
23
setup.py
23
setup.py
|
@ -1,13 +1,28 @@
|
|||
|
||||
#!/usr/bin/env python
|
||||
from setuptools import setup
|
||||
import re
|
||||
|
||||
PACKAGE_NAME = 'datagraph'
|
||||
|
||||
with open('README.md', 'r') as f:
|
||||
readme = f.read()
|
||||
|
||||
with open(PACKAGE_NAME+'/_version.py', 'r') as f:
|
||||
match = re.match(r'^__version__\s*=\s*"([\d\.]+)"$', f.read())
|
||||
version = match.group(1)
|
||||
del match
|
||||
|
||||
setup(
|
||||
name='datagraph',
|
||||
version='0.1.0',
|
||||
name=PACKAGE_NAME,
|
||||
version=version,
|
||||
description='Extensions to wikidata library',
|
||||
long_description=readme,
|
||||
long_description_content_type='text/markdown',
|
||||
author='Jmaa',
|
||||
author_email='jonjmaa@gmail.com',
|
||||
url='https://gitfub.space/Jmaa/socials-util',
|
||||
packages=['datagraph'],
|
||||
url='https://gitfub.space/Jmaa/'+PACKAGE_NAME,
|
||||
packages=[PACKAGE_NAME],
|
||||
install_requires=['requests', 'ratelimit', 'wikidata'],
|
||||
keywords=[],
|
||||
classifiers=[],
|
||||
|
|
|
@ -1,6 +1,14 @@
|
|||
import schemeld
|
||||
import wikidata
|
||||
import wikidata_ext
|
||||
import wikidata.client
|
||||
|
||||
import datagraph.schemeld
|
||||
import datagraph.wikidata_ext
|
||||
|
||||
import requests_cache
|
||||
|
||||
datagraph.wikidata_ext.REQUEST_SESSION = requests_cache.CachedSession('testing')
|
||||
|
||||
def test_version():
|
||||
assert datagraph.__version__ is not None
|
||||
|
||||
def test_get_triples():
|
||||
client = wikidata.client.Client()
|
||||
|
@ -9,5 +17,9 @@ def test_get_triples():
|
|||
schema_root = "https://schema.org/"
|
||||
schema_prop = "image"
|
||||
|
||||
triples = wikidata_ext.get_triples(client, predicate = EQV_PROPERTY, "{}{}".format(schema_root, schema_prop))
|
||||
|
||||
triples_iter = datagraph.wikidata_ext.get_triples(
|
||||
client = client,
|
||||
predicate = EQV_PROPERTY,
|
||||
object = "{}{}".format(schema_root, schema_prop),
|
||||
)
|
||||
assert triples_iter is not None
|
||||
|
|
Loading…
Reference in New Issue
Block a user