Skip to content

Commit

Permalink
Project: update misc scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
loathingKernel committed Jun 29, 2024
1 parent 4efde54 commit 202045d
Show file tree
Hide file tree
Showing 9 changed files with 50 additions and 34 deletions.
4 changes: 2 additions & 2 deletions freeze.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
from rare import __version__

name = 'Rare'
author = 'Dummerle'
description = 'A GUI for Legendary'
author = 'RareDevs'
description = 'A gui for legendary'

shortcut_table = [
("DesktopShortcut", # Shortcut
Expand Down
8 changes: 6 additions & 2 deletions misc/generate_version_name.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,9 @@
core = LegendaryCore()
core.login()

print(" ".join(map(lambda game: game.app_name,
random.choices(list(filter(lambda x: len(x.app_name) != 32, core.get_game_list(False))), k=2))))
print(" ".join(
map(
lambda game: game.app_name,
random.choices(list(filter(lambda x: len(x.app_name) != 32, core.get_game_list(False))), k=2)
)
))
2 changes: 2 additions & 0 deletions misc/nuitka_build.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/bash

python -m nuitka \
--assume-yes-for-downloads \
--mingw64 \
Expand Down
6 changes: 2 additions & 4 deletions misc/py2ts.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
#!/bin/sh
#!/usr/bin/env bash

cwd="$(pwd)"
cd "$(dirname "$0")"/.. || exit

#py_files=$(find rare -iname "*.py" -not -path rare/ui)
#ui_files=$(find rare/ui -iname "*.ui")

# shellcheck disable=SC2046
pylupdate5 -noobsolete $(find rare/ -iname "*.py") -ts rare/resources/languages/source.ts

cd "$cwd" || exit
15 changes: 10 additions & 5 deletions misc/qrc2py.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/bin/bash
#!/usr/bin/env bash
_rcc_cmd="pyrcc5 -compress 6 -threshold 0"

cwd="$(pwd)"
cd "$(dirname "$0")"/../ || exit
cd "$(dirname "${0}")"/../ || exit

resources=(
"rare/resources/images/"
Expand All @@ -10,6 +11,10 @@ resources=(
)

resources_changed=0
if [[ "$1" == "--force" ]]
then
resources_changed=1
fi

for r in "${resources[@]}"
do
Expand All @@ -22,15 +27,15 @@ done
if [[ $resources_changed -eq 1 ]]
then
echo "Re-compiling main resources"
pyrcc5 -compress 6 \
$_rcc_cmd \
rare/resources/resources.qrc \
-o rare/resources/resources.py
fi

if [[ $(git diff --name-only HEAD "rare/resources/stylesheets/RareStyle/") ]]
then
echo "Re-compiling RareStyle stylesheet resources"
pyrcc5 -compress 6 \
$_rcc_cmd \
rare/resources/stylesheets/RareStyle/stylesheet.qrc \
-o rare/resources/stylesheets/RareStyle/__init__.py
fi
Expand All @@ -39,7 +44,7 @@ fi
if [[ $(git diff --name-only HEAD "rare/resources/stylesheets/ChildOfMetropolis/") ]]
then
echo "Re-compiling ChildOfMetropolis stylesheet resources"
pyrcc5 -compress 6 \
$_rcc_cmd \
rare/resources/stylesheets/ChildOfMetropolis/stylesheet.qrc \
-o rare/resources/stylesheets/ChildOfMetropolis/__init__.py
fi
Expand Down
1 change: 1 addition & 0 deletions misc/ts2qm.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env python3
import os

for f in os.listdir(os.path.join(os.path.dirname(__file__), "../rare/resources/languages/")):
Expand Down
2 changes: 1 addition & 1 deletion misc/ui2py.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash

if [ -n "${1}" ]; then
if [ ! -f "${1}" ]; then
Expand Down
32 changes: 18 additions & 14 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.black]
line-length = 120
target-version = ['py39', 'py310', 'py311']
target-version = ['py39', 'py310', 'py311', 'py312']
include = '\.py$'
force-exclude = '''
/(
Expand All @@ -13,27 +13,27 @@ force-exclude = '''
[tool.poetry]
name = "rare"
version = "1.10.11"
description = "A GUI for Legendary"
authors = ["Dummerle"]
description = "A gui for legendary"
authors = ["RareDevs"]
license = "GPL3"
readme = "README.md"
repository = "https://github.com/RareDevs/Rare"

[tool.poetry.dependencies]
python = "^3.9"
PyQt5 = "^5.15.7"
requests = "^2.28.1"
PyQt5 = "^5.15.7"
QtAwesome = "^1.1.1"
pypresence = { version = "^4.2.1", optional = true }
pywin32 = { version = "^304", markers = "platform_system == 'Windows'" }
legendary-gl = "^0.20.34"
pywebview = [
{ version = "^3.6.3", extras = ["cef"], platform = "windows", optional = true },
{ version = "^3.6.3", extras = ["gtk"], platform = "linux", optional = true },
{ version = "^3.6.3", extras = ["gtk"], platform = "freebsd", optional = true },
]
legendary-gl = "^0.20.34"
orjson = "^3.8.0"
vdf = "^4.3"
pywin32 = { version = "^304", markers = "platform_system == 'Windows'" }
pypresence = { version = "^4.2.1", optional = true }

[tool.poetry.scripts]
start = "rare.main:main"
Expand All @@ -50,22 +50,26 @@ PyQt5-stubs = "^5.15.6.0"

[nuitka]
assume-yes-for-downloads = true
follow-imports = true
prefer-source-code = true
mingw64 = true
lto = true
lto = false
jobs = 4
static-libpython = false
standalone = true
show-scons = false
enable-plugin = ["anti-bloat", "pyqt5"]
show-anti-bloat-changes = true
nofollow-import-to = ["*.tests", "*.distutils"]
follow-stdlib = true
follow-imports = true
nofollow-import-to = ["*.tests", "*.distutils", "distutils", "unittest", "pydoc", "tkinter", "test"]
prefer-source-code = true
include-package = "pypresence"
include-package-data = "qtawesome"
include-data-dir = "rare/resources/images=rare/resources/images"
include-data-files = "rare/resources/languages=rare/resources/laguanges=*.qm"
include-data-dir = "rare/resources/images/=rare/resources/images/"
include-data-files = "rare/resources/languages/=rare/resources/laguanges/=rare_*.qm"
windows-icon-from-ico = "rare/resources/images/Rare.ico"
windows-company-name = "Rare"
windows-product-name = "Rare"
windows-file-version = "1.9.0"
windows-product-version = "1.9.0"
windows-file-version = "1.10.11.0"
windows-product-version = "1.10.11.0"
windows-disable-console = true
14 changes: 8 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@

requirements = [
"requests<3.0",
"legendary-gl>=0.20.34",
"orjson",
"setuptools",
"wheel",
"PyQt5",
"QtAwesome",
"wheel",
"setuptools",
"legendary-gl>=0.20.34",
"orjson",
"vdf"
'pywin32; platform_system == "Windows"',
]

Expand All @@ -28,9 +29,9 @@
setuptools.setup(
name="Rare",
version=version,
author="Dummerle",
author="RareDevs",
license="GPL-3",
description="A gui for Legendary",
description="A gui for legendary",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/Dummerle/Rare",
Expand All @@ -40,6 +41,7 @@
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)',
"Operating System :: OS Independent"
],
Expand Down

0 comments on commit 202045d

Please sign in to comment.