Skip to content

Commit

Permalink
fix: packaging
Browse files Browse the repository at this point in the history
  • Loading branch information
JarbasAl committed Jan 31, 2025
1 parent a55ac26 commit 888fe95
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v1
with:
python-version: 3.8
python-version: "3.11"
- name: Install Build Tools
run: |
python -m pip install build wheel
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/license_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v1
with:
python-version: 3.8
python-version: "3.11"
- name: Install Build Tools
run: |
python -m pip install build wheel
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish_stable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v1
with:
python-version: 3.8
python-version: "3.11"
- name: Install Build Tools
run: |
python -m pip install build wheel
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v1
with:
python-version: 3.8
python-version: "3.11"
- name: Install Build Tools
run: |
python -m pip install build wheel
Expand Down
4 changes: 3 additions & 1 deletion ovos_solver_aiml_plugin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ def get_spoken_answer(self, query: str,


if __name__ == "__main__":
print(AimlBot.XDG_PATH)

bot = AIMLSolver()
print(bot.spoken_answer("hello!"))
print(bot.spoken_answer("Olá!", lang= "pt-pt"))
print(bot.spoken_answer("Qual é a tua comida favorita?", lang="pt-pt"))
34 changes: 24 additions & 10 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,37 @@ def required(requirements_file):
if pkg.strip() and not pkg.startswith("#")]


with open("README.md", "r") as f:
with open(f"{BASEDIR}/README.md", "r") as f:
long_description = f.read()


with open("./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]
def get_version():
""" Find the version of the package"""
version_file = os.path.join(BASEDIR, 'ovos_solver_aiml_plugin', 'version.py')
major, minor, build, alpha = (None, None, None, None)
with open(version_file) as f:
for line in f:
if 'VERSION_MAJOR' in line:
major = line.split('=')[1].strip()
elif 'VERSION_MINOR' in line:
minor = line.split('=')[1].strip()
elif 'VERSION_BUILD' in line:
build = line.split('=')[1].strip()
elif 'VERSION_ALPHA' in line:
alpha = line.split('=')[1].strip()

if ((major and minor and build and alpha) or
'# END_VERSION_BLOCK' in line):
break
version = f"{major}.{minor}.{build}"
if alpha and int(alpha) > 0:
version += f"a{alpha}"
return version


PLUGIN_ENTRY_POINT = 'ovos-solver-aiml-plugin=ovos_solver_aiml_plugin:AIMLSolver'
setup(
name='ovos-solver-aiml-plugin',
version=version,
version=get_version(),
description='A question solver plugin for ovos/neon/mycroft',
url='https://github.com/OpenVoiceOS/ovos-solver-aiml-plugin',
author='jarbasai',
Expand Down

0 comments on commit 888fe95

Please sign in to comment.