Skip to content

Commit

Permalink
refactor: move decky_plugin under the poetry structure
Browse files Browse the repository at this point in the history
There's no need to special case it anymore, just treat it like any other Python module.
  • Loading branch information
K900 committed Nov 11, 2023
1 parent 8ccc1d0 commit fedfb3f
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/edit-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@ jobs:
with:
separator: ","
files: |
plugin/*
backend/decky_plugin.pyi
- name: Is stub changed
id: changed-stub
run: |
STUB_CHANGED="false"
PATHS=(plugin plugin/decky_plugin.pyi)
PATHS=(backend backend/decky_plugin.pyi)
SHA=${{ github.sha }}
SHA_PREV=HEAD^
FILES=$(git diff $SHA_PREV..$SHA --name-only -- ${PATHS[@]} | jq -Rsc 'split("\n")[:-1] | join (",")')
if [[ "$FILES" == *"plugin/decky_plugin.pyi"* ]]; then
if [[ "$FILES" == *"backend/decky_plugin.pyi"* ]]; then
STUB_CHANGED="true"
echo "Stub has changed, pushing updated stub"
else
Expand All @@ -48,7 +48,7 @@ jobs:
env:
API_TOKEN_GITHUB: ${{ secrets.GITHUB_TOKEN }}
with:
source_file: 'plugin/decky_plugin.pyi'
source_file: 'backend/decky_plugin.pyi'
destination_repo: 'SteamDeckHomebrew/decky-plugin-template'
user_email: '[email protected]'
user_name: 'TrainDoctor'
Expand Down
3 changes: 0 additions & 3 deletions backend/decky_loader/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,6 @@ def main():
if get_effective_user_id() != 0:
logger.warning(f"decky is running as an unprivileged user, this is not officially supported and may cause issues")

# Append the loader's plugin path to the recognized python paths
sys.path.append(path.join(path.dirname(__file__), "..", "plugin"))

# Append the system and user python paths
sys.path.extend(get_system_pythonpaths())

Expand Down
File renamed without changes.
File renamed without changes.
3 changes: 1 addition & 2 deletions backend/pyinstaller.spec
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@ a = Analysis(
['main.py'],
datas=[
('locales', 'locales'),
('../plugin', 'plugin'),
('static', 'static'),
] + copy_metadata('decky_loader'),
hiddenimports=['logging.handlers', 'sqlite3'],
hiddenimports=['logging.handlers', 'sqlite3', 'decky_plugin'],
)
pyz = PYZ(a.pure, a.zipped_data)

Expand Down
6 changes: 5 additions & 1 deletion backend/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ description = "A plugin loader for the Steam Deck"
license = "GPLv2"
readme = "../README.md"
authors = []
packages = [{include = "decky_loader"}]
packages = [
{include = "decky_loader"},
{include = "decky_plugin.py"},
{include = "decky_plugin.pyi"},
]
include = ["decky_loader/static/*"]

[tool.poetry.dependencies]
Expand Down

0 comments on commit fedfb3f

Please sign in to comment.