Skip to content

Commit 8f9c436

Browse files
committed
fix: packaging
1 parent 06a5ed2 commit 8f9c436

File tree

4 files changed

+28
-13
lines changed

4 files changed

+28
-13
lines changed

.github/workflows/build_tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
- name: Setup Python
1414
uses: actions/setup-python@v1
1515
with:
16-
python-version: 3.8
16+
python-version: "3.11"
1717
- name: Install Build Tools
1818
run: |
1919
python -m pip install build wheel

.github/workflows/publish_stable.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
- name: Setup Python
2727
uses: actions/setup-python@v1
2828
with:
29-
python-version: 3.8
29+
python-version: "3.11"
3030
- name: Install Build Tools
3131
run: |
3232
python -m pip install build wheel

.github/workflows/release_workflow.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
- name: Setup Python
4747
uses: actions/setup-python@v1
4848
with:
49-
python-version: 3.8
49+
python-version: "3.11"
5050
- name: Install Build Tools
5151
run: |
5252
python -m pip install build wheel

setup.py

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,38 @@ def required(requirements_file):
1616
if pkg.strip() and not pkg.startswith("#")]
1717

1818

19-
with open("README.md", "r") as f:
20-
long_description = f.read()
2119

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

23-
with open("./version.py", "r", encoding="utf-8") as v:
24-
for line in v.readlines():
25-
if line.startswith("__version__"):
26-
if '"' in line:
27-
version = line.split('"')[1]
28-
else:
29-
version = line.split("'")[1]
23+
def get_version():
24+
""" Find the version of the package"""
25+
version_file = os.path.join(BASEDIR, 'ovos_solver_failure_plugin', 'version.py')
26+
major, minor, build, alpha = (None, None, None, None)
27+
with open(version_file) as f:
28+
for line in f:
29+
if 'VERSION_MAJOR' in line:
30+
major = line.split('=')[1].strip()
31+
elif 'VERSION_MINOR' in line:
32+
minor = line.split('=')[1].strip()
33+
elif 'VERSION_BUILD' in line:
34+
build = line.split('=')[1].strip()
35+
elif 'VERSION_ALPHA' in line:
36+
alpha = line.split('=')[1].strip()
37+
38+
if ((major and minor and build and alpha) or
39+
'# END_VERSION_BLOCK' in line):
40+
break
41+
version = f"{major}.{minor}.{build}"
42+
if alpha and int(alpha) > 0:
43+
version += f"a{alpha}"
44+
return version
3045

3146

3247
PLUGIN_ENTRY_POINT = 'ovos-solver-failure-plugin=ovos_solver_failure_plugin:FailureSolver'
3348
setup(
3449
name='ovos-solver-failure-plugin',
35-
version=version,
50+
version=get_version(),
3651
description='A question solver plugin for ovos/neon/mycroft',
3752
url='https://github.com/OpenVoiceOS/ovos-solver-failure-plugin',
3853
author='jarbasai',

0 commit comments

Comments
 (0)