Skip to content

Commit 1417b8b

Browse files
authored
Fix lemonade server detection (#16)
1 parent 316fd50 commit 1417b8b

File tree

5 files changed

+68
-3
lines changed

5 files changed

+68
-3
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Publish Python distributions to PyPI
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
tags:
7+
- v*
8+
- RC*
9+
pull_request:
10+
merge_group:
11+
12+
jobs:
13+
build-n-publish:
14+
name: Build and publish Python distributions to PyPI
15+
runs-on: ubuntu-latest
16+
concurrency:
17+
group: ${{ github.workflow }}-${{ github.ref }}
18+
cancel-in-progress: true
19+
steps:
20+
- uses: actions/checkout@main
21+
- uses: conda-incubator/setup-miniconda@v3
22+
with:
23+
miniconda-version: "latest"
24+
activate-environment: lemon
25+
python-version: "3.10"
26+
- name: Install pypa/build
27+
run: >-
28+
python -m pip install build --user
29+
- name: Build a binary wheel and a source tarball
30+
run: |
31+
python -m build --sdist --wheel --outdir dist/ .
32+
version=$(python setup.py --version)
33+
echo "VERSION=$version" >> $GITHUB_ENV
34+
- name: Test wheel
35+
shell: bash -el {0}
36+
run: |
37+
python -m pip install --upgrade pip
38+
pip install "dist/lemonade_arcade-${{ env.VERSION }}-py3-none-any.whl[dev]"
39+
- name: Publish distribution package to PyPI
40+
if: startsWith(github.ref, 'refs/tags/v')
41+
uses: pypa/gh-action-pypi-publish@release/v1
42+
with:
43+
password: ${{ secrets.PYPI_API_TOKEN }}
44+
45+
# This file was originally licensed under Apache 2.0. It has been modified.
46+
# Modifications Copyright (c) 2025 AMD

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,15 @@ Navigate to the [Releases page](https://github.com/lemonade-sdk/lemonade-arcade/
9292

9393
### Linux (and Windows Devs)
9494

95+
From PyPI (recommended):
96+
97+
```bash
98+
pip install lemonade-arcade
99+
lemonade-arcade
100+
```
101+
102+
From Source:
103+
95104
1. Clone this repository:
96105
```bash
97106
git clone https://github.com/lemonade-sdk/lemonade-arcade

lemonade_arcade/main.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
from fastapi.templating import Jinja2Templates
2828

2929

30-
LEMONADE_VERSION = "8.1.4"
30+
LEMONADE_VERSION = "8.1.5"
3131

3232
# Pygame will be imported on-demand to avoid early DLL loading issues
3333
pygame = None
@@ -278,6 +278,7 @@ async def execute_lemonade_server_command(
278278
subprocess.CREATE_NO_WINDOW if sys.platform == "win32" else 0
279279
),
280280
shell=True, # Use shell=True to help with PATH resolution
281+
env=os.environ.copy(), # Pass current environment
281282
)
282283

283284
# Store the successful command for future use
@@ -298,6 +299,7 @@ async def execute_lemonade_server_command(
298299
text=True,
299300
timeout=timeout,
300301
shell=True, # Use shell=True to help with PATH resolution
302+
env=os.environ.copy(), # Pass current environment
301303
)
302304
logger.info(f"Command {i+1} returned code: {result.returncode}")
303305
logger.info(f"Command {i+1} stdout: '{result.stdout}'")
@@ -366,7 +368,12 @@ async def check_lemonade_server_version():
366368

367369
if result is None:
368370
logger.error("All lemonade-server commands failed")
369-
return {"installed": False, "version": None, "compatible": False}
371+
return {
372+
"installed": False,
373+
"version": None,
374+
"compatible": False,
375+
"required_version": LEMONADE_VERSION,
376+
}
370377

371378
version_line = result.stdout.strip()
372379
logger.info(f"Raw version output: '{version_line}'")

lemonade_arcade/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.1.4"
1+
__version__ = "0.1.5"

setup.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@
2828
],
2929
},
3030
python_requires=">=3.8",
31+
package_data={
32+
"lemonade_arcade": ["static/**/*", "templates/**/*"],
33+
},
3134
)
3235

3336
# Copyright (c) 2025 AMD

0 commit comments

Comments
 (0)