Updated workflows to v6.21
This commit is contained in:
parent
369674d846
commit
5f14771b8b
|
@ -2,8 +2,13 @@ name: Python Package
|
|||
on: [push]
|
||||
|
||||
jobs:
|
||||
Test:
|
||||
uses: jmaa/workflows/.gitea/workflows/python-test.yaml@v6.21
|
||||
Package:
|
||||
uses: jmaa/workflows/.gitea/workflows/python-package.yaml@main
|
||||
uses: jmaa/workflows/.gitea/workflows/python-package.yaml@v6.21
|
||||
with:
|
||||
REGISTRY_DOMAIN: gitfub.space
|
||||
REGISTRY_ORGANIZATION: jmaa
|
||||
secrets:
|
||||
PIPY_REPO_USER: ${{ secrets.PIPY_REPO_USER }}
|
||||
PIPY_REPO_PASS: ${{ secrets.PIPY_REPO_PASS }}
|
||||
|
|
|
@ -1,2 +1,3 @@
|
|||
# Datagraph
|
||||
|
||||
Utility for working with scheme+ld and other datagraph formats.
|
||||
Utility for working with scheme+ld and other data-graph and semantic web formats.
|
||||
|
|
3
requirements.txt
Normal file
3
requirements.txt
Normal file
|
@ -0,0 +1,3 @@
|
|||
requests
|
||||
ratelimit
|
||||
wikidata
|
1
requirements_test.txt
Normal file
1
requirements_test.txt
Normal file
|
@ -0,0 +1 @@
|
|||
pytest
|
67
setup.py
67
setup.py
|
@ -1,31 +1,70 @@
|
|||
|
||||
#!/usr/bin/env python
|
||||
from setuptools import setup
|
||||
#
|
||||
# WARNING
|
||||
#
|
||||
# THIS IS AN AUTOGENERATED FILE.
|
||||
#
|
||||
# MANUAL CHANGES CAN AND WILL BE OVERWRITTEN.
|
||||
|
||||
import re
|
||||
|
||||
from setuptools import setup
|
||||
|
||||
PACKAGE_NAME = 'datagraph'
|
||||
|
||||
with open('README.md', 'r') as f:
|
||||
with open('README.md') 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
|
||||
with open(PACKAGE_NAME + '/_version.py') as f:
|
||||
text = f.read()
|
||||
match = re.match(r'^__version__\s*=\s*(["\'])([\d\.]+)\1$', text)
|
||||
version = match.group(2)
|
||||
del match, text
|
||||
|
||||
|
||||
def parse_requirements(text: str) -> list[str]:
|
||||
return text.strip().split('\n')
|
||||
|
||||
|
||||
def read_requirements(path: str):
|
||||
with open(path) as f:
|
||||
return parse_requirements(f.read())
|
||||
|
||||
|
||||
def get_short_description(readme: str):
|
||||
readme = re.sub(r'#+[^\n]*\n+', '', readme)
|
||||
m = re.search(r'^\s*(\w+[\w\s,`-]+\.)', readme)
|
||||
try:
|
||||
return m.group(1)
|
||||
except AttributeError as err:
|
||||
msg = 'Could not determine short description'
|
||||
raise Exception(msg) from err
|
||||
|
||||
|
||||
REQUIREMENTS_MAIN = """
|
||||
requests
|
||||
ratelimit
|
||||
wikidata
|
||||
"""
|
||||
|
||||
REQUIREMENTS_TEST = """
|
||||
pytest
|
||||
"""
|
||||
|
||||
|
||||
setup(
|
||||
name=PACKAGE_NAME,
|
||||
version=version,
|
||||
description='Extensions to wikidata library',
|
||||
description=get_short_description(readme),
|
||||
long_description=readme,
|
||||
long_description_content_type='text/markdown',
|
||||
author='Jmaa',
|
||||
author_email='jonjmaa@gmail.com',
|
||||
url='https://gitfub.space/Jmaa/'+PACKAGE_NAME,
|
||||
url='https://gitfub.space/Jmaa/' + PACKAGE_NAME,
|
||||
packages=[PACKAGE_NAME],
|
||||
install_requires=['requests', 'ratelimit', 'wikidata'],
|
||||
keywords=[],
|
||||
classifiers=[],
|
||||
include_package_data=True,
|
||||
zip_safe=False
|
||||
install_requires=parse_requirements(REQUIREMENTS_MAIN),
|
||||
extras_require=dict(
|
||||
test=parse_requirements(REQUIREMENTS_TEST),
|
||||
),
|
||||
python_requires='>=3.9',
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue
Block a user