1
0

Update to new pipelines
Some checks failed
Python Package / Python-Test (push) Failing after 17s
Python Package / Python-Package (push) Failing after 18s

This commit is contained in:
Jon Michael Aanes 2024-05-23 00:34:18 +02:00
parent 8b3ded9653
commit aa925275f1
Signed by: Jmaa
SSH Key Fingerprint: SHA256:Ab0GfHGCblESJx7JRE4fj4bFy/KRpeLhi41y4pF3sNA
4 changed files with 38 additions and 13 deletions

View File

@ -2,9 +2,13 @@ name: Python Package
on: [push] on: [push]
jobs: jobs:
Package: Python-Test:
uses: jmaa/workflows/.gitea/workflows/python-package.yaml@v6.02 uses: jmaa/workflows/.gitea/workflows/python-test.yaml@v6.21
Python-Package:
uses: jmaa/workflows/.gitea/workflows/python-package.yaml@v6.21
secrets: secrets:
PIPY_REPO_USER: ${{ secrets.PIPY_REPO_USER }} PIPY_REPO_USER: ${{ secrets.PIPY_REPO_USER }}
PIPY_REPO_PASS: ${{ secrets.PIPY_REPO_PASS }} PIPY_REPO_PASS: ${{ secrets.PIPY_REPO_PASS }}
with:
REGISTRY_DOMAIN: gitfub.space
REGISTRY_ORGANIZATION: jmaa

View File

@ -1,3 +1,5 @@
# Socials-util
Small utility for social sites. Used by one-page-internet. Python library for parsing and processing URLs of Social Media Sites.
Used by one-page-internet.

View File

@ -1,2 +0,0 @@
enforce-typing
aenum

View File

@ -5,24 +5,31 @@ from setuptools import setup
PACKAGE_NAME = 'socials-util' PACKAGE_NAME = 'socials-util'
PACKAGE_PATH = PACKAGE_NAME.replace('-', '_')
with open('README.md') as f: with open('README.md') as f:
readme = f.read() readme = f.read()
PACKAGE_PATH = PACKAGE_NAME.replace('-', '_')
with open(PACKAGE_PATH + '/_version.py') as f: with open(PACKAGE_PATH + '/_version.py') as f:
text = f.read() text = f.read()
match = re.match(r'^__version__\s*=\s*(["\'])([\d\.]+)\1$', text) match = re.match(r'^__version__\s*=\s*(["\'])([\d\.]+)\1$', text)
version = match.group(2) version = match.group(2)
del match, text del match, text
with open('requirements.txt') as f:
install_requires = f.read().strip().split('\n') 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): def get_short_description(readme: str):
readme = re.sub(r'#+[^\n]*\n+', '', readme) readme = re.sub(r'#+[^\n]*\n+', '', readme)
m = re.search(r'^\s*(\w+[\w\s,`]+\.)', readme) m = re.search(r'^\s*(\w+[\w\s,`-]+\.)', readme)
try: try:
return m.group(1) return m.group(1)
except AttributeError as err: except AttributeError as err:
@ -30,6 +37,16 @@ def get_short_description(readme: str):
raise Exception(msg) from err raise Exception(msg) from err
REQUIREMENTS_MAIN = """
enforce-typing
aenum
"""
REQUIREMENTS_TEST = """
pytest
"""
setup( setup(
name=PACKAGE_NAME, name=PACKAGE_NAME,
version=version, version=version,
@ -39,6 +56,10 @@ setup(
author='Jmaa', author='Jmaa',
author_email='jonjmaa@gmail.com', author_email='jonjmaa@gmail.com',
url='https://gitfub.space/Jmaa/' + PACKAGE_NAME, url='https://gitfub.space/Jmaa/' + PACKAGE_NAME,
packages=[PACKAGE_PATH], packages=[PACKAGE_NAME],
install_requires=install_requires, install_requires=parse_requirements(REQUIREMENTS_MAIN),
extras_require={
'test': parse_requirements(REQUIREMENTS_TEST),
},
python_requires='>=3.9',
) )