diff --git a/.gitea/workflows/package.yml b/.gitea/workflows/python-package.yml similarity index 83% rename from .gitea/workflows/package.yml rename to .gitea/workflows/python-package.yml index 90771b9..471efe9 100644 --- a/.gitea/workflows/package.yml +++ b/.gitea/workflows/python-package.yml @@ -1,4 +1,4 @@ -name: Python Package +name: Test and Package Python on: [push] jobs: @@ -8,7 +8,7 @@ jobs: uses: jmaa/workflows/.gitea/workflows/python-package.yaml@v6.21 with: REGISTRY_DOMAIN: gitfub.space - REGISTRY_ORGANIZATION: Jmaa + REGISTRY_ORGANIZATION: jmaa secrets: PIPY_REPO_USER: ${{ secrets.PIPY_REPO_USER }} PIPY_REPO_PASS: ${{ secrets.PIPY_REPO_PASS }} diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..a72a851 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +enforce_typing +frozendict diff --git a/requirements_test.txt b/requirements_test.txt new file mode 100644 index 0000000..e079f8a --- /dev/null +++ b/requirements_test.txt @@ -0,0 +1 @@ +pytest diff --git a/setup.py b/setup.py index e12c1d3..c2bc2ff 100644 --- a/setup.py +++ b/setup.py @@ -1,15 +1,21 @@ #!/usr/bin/env python +# +# WARNING +# +# THIS IS AN AUTOGENERATED FILE. +# +# MANUAL CHANGES CAN AND WILL BE OVERWRITTEN. + import re -import pathlib from setuptools import setup -PACKAGE_NAME = "pbcabi" +PACKAGE_NAME = 'pbcabi' -with open("README.md") as f: +with open('README.md') as f: readme = f.read() -with open(PACKAGE_NAME + "/_version.py") as f: +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) @@ -17,7 +23,7 @@ with open(PACKAGE_NAME + "/_version.py") as f: def parse_requirements(text: str) -> list[str]: - return text.strip().split("\n") + return text.strip().split('\n') def read_requirements(path: str): @@ -26,12 +32,12 @@ def read_requirements(path: str): def get_short_description(readme: str): - readme = re.sub(r"#+[^\n]*\n+", "", readme) - m = re.search(r"^\s*(\w+[\w\s,`]+\.)", readme) + 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" + msg = 'Could not determine short description' raise Exception(msg) from err @@ -44,19 +50,20 @@ REQUIREMENTS_TEST = """ pytest """ + setup( name=PACKAGE_NAME, version=version, 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, + long_description_content_type='text/markdown', + author='Jmaa', + author_email='jonjmaa@gmail.com', + url='https://gitfub.space/Jmaa/' + PACKAGE_NAME, packages=[PACKAGE_NAME], install_requires=parse_requirements(REQUIREMENTS_MAIN), extras_require={ - "test": parse_requirements(REQUIREMENTS_TEST), + 'test': parse_requirements(REQUIREMENTS_TEST), }, - python_requires=">=3.9", + python_requires='>=3.9', )