diff --git a/.github/workflows/publish_test_build.yml b/.github/workflows/publish_test_build.yml index 893a4a1..249a235 100644 --- a/.github/workflows/publish_test_build.yml +++ b/.github/workflows/publish_test_build.yml @@ -12,3 +12,5 @@ jobs: build_and_publish_pypi: uses: neongeckocom/.github/.github/workflows/publish_alpha_release.yml@master secrets: inherit + with: + version_file: "version.py" diff --git a/setup.py b/setup.py index 0c0358e..63d0b11 100644 --- a/setup.py +++ b/setup.py @@ -17,8 +17,11 @@ from os import path, getenv +BASE_PATH = path.abspath(path.dirname(__file__)) + + def get_requirements(requirements_filename: str): - requirements_file = path.join(path.abspath(path.dirname(__file__)), "requirements", requirements_filename) + requirements_file = path.join(BASE_PATH, "requirements", requirements_filename) with open(requirements_file, 'r', encoding='utf-8') as r: requirements = r.readlines() requirements = [r.strip() for r in requirements if r.strip() and not r.strip().startswith("#")] @@ -35,10 +38,10 @@ def get_requirements(requirements_filename: str): return requirements -with open("README.md", "r") as f: +with open(path.join(BASE_PATH, "README.md"), "r") as f: long_description = f.read() -with open("./version.py", "r", encoding="utf-8") as v: +with open(path.join(BASE_PATH, "version.py"), "r", encoding="utf-8") as v: for line in v.readlines(): if line.startswith("__version__"): if '"' in line: diff --git a/version_bump.py b/version_bump.py deleted file mode 100644 index a55f158..0000000 --- a/version_bump.py +++ /dev/null @@ -1,45 +0,0 @@ -# NEON AI (TM) SOFTWARE, Software Development Kit & Application Development System -# -# Copyright 2008-2021 Neongecko.com Inc. | All Rights Reserved -# -# Notice of License - Duplicating this Notice of License near the start of any file containing -# a derivative of this software is a condition of license for this software. -# Friendly Licensing: -# No charge, open source royalty free use of the Neon AI software source and object is offered for -# educational users, noncommercial enthusiasts, Public Benefit Corporations (and LLCs) and -# Social Purpose Corporations (and LLCs). Developers can contact developers@neon.ai -# For commercial licensing, distribution of derivative works or redistribution please contact licenses@neon.ai -# Distributed on an "AS IS” basis without warranties or conditions of any kind, either express or implied. -# Trademarks of Neongecko: Neon AI(TM), Neon Assist (TM), Neon Communicator(TM), Klat(TM) -# Authors: Guy Daniels, Daniel McKnight, Regina Bloomstine, Elon Gasper, Richard Leeds -# -# Specialized conversational reconveyance options from Conversation Processing Intelligence Corp. -# US Patents 2008-2021: US7424516, US20140161250, US20140177813, US8638908, US8068604, US8553852, US10530923, US10530924 -# China Patent: CN102017585 - Europe Patent: EU2156652 - Patents Pending - -import fileinput -from os.path import join, dirname - -with open(join(dirname(__file__), "version.py"), "r", encoding="utf-8") as v: - for line in v.readlines(): - if line.startswith("__version__"): - if '"' in line: - version = line.split('"')[1] - else: - version = line.split("'")[1] - -if "a" not in version: - parts = version.split('.') - parts[-1] = str(int(parts[-1]) + 1) - version = '.'.join(parts) - version = f"{version}a0" -else: - post = version.split("a")[1] - new_post = int(post) + 1 - version = version.replace(f"a{post}", f"a{new_post}") - -for line in fileinput.input(join(dirname(__file__), "version.py"), inplace=True): - if line.startswith("__version__"): - print(f"__version__ = \"{version}\"") - else: - print(line.rstrip('\n'))