Skip to content

Commit

Permalink
Merge pull request #467 from loathingKernel/develop
Browse files Browse the repository at this point in the history
Rare: limit PySide6 to versions up to 6.8.0 due to segmentation fault
  • Loading branch information
loathingKernel authored Oct 12, 2024
2 parents 6ec2998 + a47f3d6 commit b2f6b36
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 30 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/job_nuitka-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ jobs:
run: >-
python -m nuitka
--assume-yes-for-downloads
--clang
--lto=no
--jobs=4
--static-libpython=no
Expand Down Expand Up @@ -69,3 +68,4 @@ jobs:
with:
name: Rare-portable-linux-${{ inputs.version }}.zip
path: Rare.zip

3 changes: 2 additions & 1 deletion .github/workflows/job_nuitka-win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
run: >-
python -m nuitka
--assume-yes-for-downloads
--mingw64
--msvc=latest
--lto=no
--jobs=4
--static-libpython=no
Expand Down Expand Up @@ -69,3 +69,4 @@ jobs:
with:
name: Rare-portable-windows-${{ inputs.version }}.zip
path: Rare.zip

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ repository = "https://github.com/RareDevs/Rare"
[tool.poetry.dependencies]
python = "^3.9"
requests = "^2.28.1"
PySide6-Essentials = "^6.5.3"
PySide6-Essentials = ">=6.6.0, <6.8.0"
QtAwesome = "^1.1.1"
legendary-gl = "^0.20.34"
pywebview = [
Expand Down
4 changes: 2 additions & 2 deletions rare/models/game.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def __load_metadata_json() -> Dict:
metadata = {}
file = os.path.join(data_dir(), "game_meta.json")
try:
with open(file, "r") as f:
with open(file, "r", encoding="utf-8") as f:
metadata = json.load(f)
except FileNotFoundError:
logger.info("%s does not exist", file)
Expand All @@ -175,7 +175,7 @@ def __save_metadata(self):
metadata: Dict = self.__load_metadata_json()
# pylint: disable=unsupported-assignment-operation
metadata[self.app_name] = vars(self.metadata)
with open(os.path.join(data_dir(), "game_meta.json"), "w+") as file:
with open(os.path.join(data_dir(), "game_meta.json"), "w+", encoding="utf-8") as file:
json.dump(metadata, file, indent=2)

def update_game(self):
Expand Down
2 changes: 1 addition & 1 deletion rare/shared/image_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ def __download(self, updates: List, json_data: Dict, game: Game, use_async: bool
json_data["size"] = {"w": ImageSize.Tall.size.width(), "h": ImageSize.Tall.size.height()}

# write image.json
with open(self.__img_json(game.app_name), "w") as file:
with open(self.__img_json(game.app_name), "w", encoding="utf-8") as file:
json.dump(json_data, file)

return bool(updates)
Expand Down
2 changes: 1 addition & 1 deletion rare/shared/rare_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def core(self, init: bool = False) -> LegendaryCore:
else:
path = os.path.expanduser('~/.config/legendary')
logger.info("Creating config in path: %s", config_path)
with open(os.path.join(path, "config.ini"), "w") as config_file:
with open(os.path.join(path, "config.ini"), "w", encoding="utf-8") as config_file:
config_file.write("[Legendary]")
self.__core = LegendaryCore()

Expand Down
4 changes: 2 additions & 2 deletions rare/shared/wrappers.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def __init__(self):
self.__file = os.path.join(config_dir(), "wrappers.json")
self.__wrappers_dict = {}
try:
with open(self.__file) as f:
with open(self.__file, "r", encoding="utf-8") as f:
self.__wrappers_dict = json.load(f)
except FileNotFoundError:
logger.info("%s does not exist", self.__file)
Expand Down Expand Up @@ -114,7 +114,7 @@ def __save_wrappers(self):
self.__wrappers_dict["wrappers"] = self.__wrappers
self.__wrappers_dict["applists"] = self.__applists

with open(os.path.join(self.__file), "w+") as f:
with open(os.path.join(self.__file), "w+", encoding="utf-8") as f:
json.dump(self.__wrappers_dict, f, default=lambda o: vars(o), indent=2)


Expand Down
4 changes: 2 additions & 2 deletions requirements-full.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
requests
PySide6-Essentials
PySide6-Essentials >=6.6.0, <6.8.0
QtAwesome
setuptools
legendary-gl>=0.20.34; platform_system != "Windows" or platform_system != "Darwin"
legendary-gl >=0.20.34; platform_system != "Windows" or platform_system != "Darwin"
legendary-gl @ https://github.com/derrod/legendary/archive/3963382b3f33116154399be5dd2d2913336a1f0e.zip ; platform_system == "Windows" or platform_system == "Darwin"
orjson
vdf
Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
requests
PySide6-Essentials
PySide6-Essentials >=6.6.0, <6.8.0
QtAwesome
setuptools
legendary-gl>=0.20.34; platform_system != "Windows" or platform_system != "Darwin"
legendary-gl >=0.20.34; platform_system != "Windows" or platform_system != "Darwin"
legendary-gl @ https://github.com/derrod/legendary/archive/3963382b3f33116154399be5dd2d2913336a1f0e.zip ; platform_system == "Windows" or platform_system == "Darwin"
orjson
vdf
Expand Down
27 changes: 10 additions & 17 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,21 @@

from rare import __version__ as version


def parse_requirements(filename):
""" load requirements from a pip requirements file """
lineiter = (line.strip() for line in open(filename))
return [line for line in lineiter if line and not line.startswith("#")]


with open("README.md", "r") as fh:
long_description = fh.read()

requirements = [
"requests<3.0",
"PySide6-Essentials",
"QtAwesome",
"wheel",
"setuptools",
"legendary-gl>=0.20.34",
"orjson",
"vdf",
'pywin32; platform_system == "Windows"',
]
requirements = parse_requirements("requirements.txt")

optional_reqs = dict(
webview=[
'pywebview[gtk]; platform_system == "Linux"',
'pywebview[gtk]; platform_system == "FreeBSD"',
'pywebview[cef]; platform_system == "Windows"',
],
pypresence=["pypresence"]
webview=parse_requirements("requirements-webview.txt"),
pypresence=parse_requirements("requirements-presence.txt"),
)

setuptools.setup(
Expand Down

0 comments on commit b2f6b36

Please sign in to comment.