diff --git a/.github/workflows/publish_to_pypi.yaml b/.github/workflows/publish_to_pypi.yaml new file mode 100644 index 0000000..974ac7b --- /dev/null +++ b/.github/workflows/publish_to_pypi.yaml @@ -0,0 +1,46 @@ +name: Publish Python distributions to PyPI + +on: + push: + branches: ["main"] + tags: + - v* + - RC* + pull_request: + merge_group: + +jobs: + build-n-publish: + name: Build and publish Python distributions to PyPI + runs-on: ubuntu-latest + concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + steps: + - uses: actions/checkout@main + - uses: conda-incubator/setup-miniconda@v3 + with: + miniconda-version: "latest" + activate-environment: lemon + python-version: "3.10" + - name: Install pypa/build + run: >- + python -m pip install build --user + - name: Build a binary wheel and a source tarball + run: | + python -m build --sdist --wheel --outdir dist/ . + version=$(python setup.py --version) + echo "VERSION=$version" >> $GITHUB_ENV + - name: Test wheel + shell: bash -el {0} + run: | + python -m pip install --upgrade pip + pip install "dist/lemonade_arcade-${{ env.VERSION }}-py3-none-any.whl[dev]" + - name: Publish distribution package to PyPI + if: startsWith(github.ref, 'refs/tags/v') + uses: pypa/gh-action-pypi-publish@release/v1 + with: + password: ${{ secrets.PYPI_API_TOKEN }} + +# This file was originally licensed under Apache 2.0. It has been modified. +# Modifications Copyright (c) 2025 AMD \ No newline at end of file diff --git a/README.md b/README.md index e06942a..3fa8286 100644 --- a/README.md +++ b/README.md @@ -92,6 +92,15 @@ Navigate to the [Releases page](https://github.com/lemonade-sdk/lemonade-arcade/ ### Linux (and Windows Devs) +From PyPI (recommended): + +```bash +pip install lemonade-arcade +lemonade-arcade +``` + +From Source: + 1. Clone this repository: ```bash git clone https://github.com/lemonade-sdk/lemonade-arcade diff --git a/lemonade_arcade/main.py b/lemonade_arcade/main.py index 4edbaad..a9d34ed 100644 --- a/lemonade_arcade/main.py +++ b/lemonade_arcade/main.py @@ -27,7 +27,7 @@ from fastapi.templating import Jinja2Templates -LEMONADE_VERSION = "8.1.4" +LEMONADE_VERSION = "8.1.5" # Pygame will be imported on-demand to avoid early DLL loading issues pygame = None @@ -278,6 +278,7 @@ async def execute_lemonade_server_command( subprocess.CREATE_NO_WINDOW if sys.platform == "win32" else 0 ), shell=True, # Use shell=True to help with PATH resolution + env=os.environ.copy(), # Pass current environment ) # Store the successful command for future use @@ -298,6 +299,7 @@ async def execute_lemonade_server_command( text=True, timeout=timeout, shell=True, # Use shell=True to help with PATH resolution + env=os.environ.copy(), # Pass current environment ) logger.info(f"Command {i+1} returned code: {result.returncode}") logger.info(f"Command {i+1} stdout: '{result.stdout}'") @@ -366,7 +368,12 @@ async def check_lemonade_server_version(): if result is None: logger.error("All lemonade-server commands failed") - return {"installed": False, "version": None, "compatible": False} + return { + "installed": False, + "version": None, + "compatible": False, + "required_version": LEMONADE_VERSION, + } version_line = result.stdout.strip() logger.info(f"Raw version output: '{version_line}'") diff --git a/lemonade_arcade/version.py b/lemonade_arcade/version.py index bbab024..1276d02 100644 --- a/lemonade_arcade/version.py +++ b/lemonade_arcade/version.py @@ -1 +1 @@ -__version__ = "0.1.4" +__version__ = "0.1.5" diff --git a/setup.py b/setup.py index a61af4c..0163e77 100644 --- a/setup.py +++ b/setup.py @@ -28,6 +28,9 @@ ], }, python_requires=">=3.8", + package_data={ + "lemonade_arcade": ["static/**/*", "templates/**/*"], + }, ) # Copyright (c) 2025 AMD