Skip to content

Commit 3a03a84

Browse files
authored
Merge pull request #3 from MisterZeus/master
various fixes to readme, upgrade module versions, get pytests closer to running ok
2 parents f93ea59 + 23ef0c0 commit 3a03a84

File tree

7 files changed

+83
-70
lines changed

7 files changed

+83
-70
lines changed

README.md

Lines changed: 57 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -13,43 +13,43 @@ This project is in open beta. It is not completely bulletproof, but it has been
1313
### Installation:
1414
* There is a zip file in the releases directory. Download this.
1515
* Navigate to where GOG stores the steam plugin.
16-
* For windows, this is `%localappdata%\GOG.com\Galaxy\plugins\installed\steam_ca27391f-2675-49b1-92c0-896d43afa4f8`
17-
* For MacOS, this is `~/Library/Application Support/GOG.com/Galaxy/plugins/installed/steam_ca27391f-2675-49b1-92c0-896d43afa4f8`
16+
* Windows:
17+
<br>`%localappdata%\GOG.com\Galaxy\plugins\installed\steam_ca27391f-2675-49b1-92c0-896d43afa4f8`
18+
* MacOS:
19+
<br>`~/Library/Application Support/GOG.com/Galaxy/plugins/installed/steam_ca27391f-2675-49b1-92c0-896d43afa4f8`
1820
* If the file does not exist, create it. If it does, delete everything inside it.
1921
* Extract the zip release so all the contents are in that file.
2022
* Start GOG Galaxy.
2123

2224
### Logging:
23-
We tried to kill as many bugs and test as many behaviors as possible, but we aren't perfect. You may find some case we haven't tested. Please raise an issue here, and in the comment, attach your logs. They can be found here:
24-
* For windows, this is `%programdata%\GOG.com\Galaxy\logs`
25-
* For MacOS, this is `/Users/Shared/GOG.com/Galaxy/Logs`
25+
We tried to kill as many bugs and test as many behaviors as possible, but we aren't perfect.
26+
<br>You may find some case we haven't tested.
27+
<br>Please raise an issue here, and in the comment, attach your logs.
28+
<br>They can be found here:
29+
* Windows:<br>`%programdata%\GOG.com\Galaxy\logs`
30+
* MacOS: <br>`/Users/Shared/GOG.com/Galaxy/Logs`
2631

2732
We typically only need the `steam_<numbers and letters>.log` file.
2833

2934
## Setup (For Developers)
30-
* Download Python 3.7.9 32-bit
35+
* Download [Python 3.7.9 32-bit][Python379]
3136
* Install it with the defaults
3237
* Create a new virtual env:
33-
- If you only have python 3.7.9<br/>
38+
- If you only have Python 3.7.9<br>
3439
`python -m venv .venv`
35-
- IF you have multiple python versions installed (assumes you have `py` as well)<br/>
40+
- If you have multiple Python versions installed (assumes you have `py` as well)<br>
3641
`py -3.7 -m venv .venv`
3742
* Activate the virtual env
38-
- Windows, Powershell:<br/>
39-
`.\.venv\Scripts\activate.ps1`
40-
- MacOS, terminal:<br/>
41-
`.venv/Scripts/activate
42-
* Downgrade/Upgrade `pip`<br/>
43-
- If you only have python 3.7.9<br/>
44-
`python -m pip install --upgrade pip==22.0.4`
45-
- IF you have multiple python versions installed (assumes you have `py` as well)<br/>
46-
`py -m pip install --upgrade pip==22.0.4`
47-
* Install the dev dependencies:<br/>
43+
- Windows, Powershell:<br>
44+
`.venv\Scripts\activate`
45+
- MacOS, terminal:<br>
46+
`.venv/Scripts/activate`
47+
* Install the dev dependencies:<br>
4848
`pip install -r requirements/dev.txt`
4949
* Make your edits
5050
* Update the protobufs (See README_UPDATE_PROTOBUF_FILES.md for more info)
51-
Take notice of the initial diff between the files in `protobuf_files` and `protobuf_files/orig`
52-
Generating the python files is done via:
51+
<br>Take notice of the initial diff between the files in `protobuf_files` and `protobuf_files/orig`
52+
<br>Generating the python files is done via:
5353
`inv GenerateProtobufMessages`
5454
* Build your edits:
5555
`inv build`
@@ -60,74 +60,70 @@ We typically only need the `steam_<numbers and letters>.log` file.
6060
* Build a release package (zip):
6161
`inv pack`
6262

63-
This is a fork of the repository from FriendsOfGalaxy, intended to continue development until they resume their work.
64-
65-
**This is unofficial and purely maintained by fans!**
66-
6763
## Installation (non-developers)
6864

6965
*~~The latest release should be available for download via the "Connect" button in Galaxy~~*
7066
We aren't ready to publish this project to Galaxy just yet. We have the tools to do so, but the code is not stable enough for us to consider that just yet.
7167

72-
In the meantime, we've provided a simplified version of the developer install process that only does the bare minimum to install the plugin. There are only a few commands you need to run, but if you want to know what they do, they are documented above each command. A tl;dr: version is below it. Please do the following:
68+
In the meantime, we've provided a simplified version of the developer install process that only does the bare minimum to install the plugin. There are only a few commands you need to run, but if you want to know what they do, they are documented above each command. A tl;dr: version is below it.
69+
70+
Please do the following:
7371
* Download or clone this repo. If you download a zip, make sure to extract it. You need to be in the main directory for this to work.
74-
* Download Python 3.7.9 32-bit. If you have another version of python installed, make sure `install py` is checked. This makes it easier to select which version of python you are using and we need our virtual environment in 3.7.9. Also, make sure you have the setting that adds python to the path environmental variable checked (windows). These should be the default, but make sure anyway.
72+
* Download [Python 3.7.9 32-bit][Python379].
73+
<br> If you have another version of python installed, make sure `install py` is checked.
74+
<br> This makes it easier to select which version of python you are using and we need our virtual environment in 3.7.9.
75+
<br> If using Windows, make sure you have enabled the setting that `adds Python to the PATH environmental variable`.
76+
<br> These should be the default settings, but make sure anyway.
7577
* Create a new virtual env:
76-
- If you only have python 3.7.9<br/>
78+
- If you only have python 3.7.9<br>
7779
`python -m venv .venv`
78-
- IF you have multiple python versions installed (assumes you have `py` as well)<br/>
80+
- IF you have multiple python versions installed (assumes you have `py` as well)<br>
7981
`py -3.7 -m venv .venv`
8082
* Activate the virtual env
81-
- Windows, Powershell:<br/>
82-
`.\.venv\Scripts\activate.ps1`
83-
- MacOS, terminal:<br/>
84-
`.venv/Scripts/activate.sh`
85-
* Downgrade/Upgrade `pip`<br/>
86-
- If you only have python 3.7.9<br/>
87-
`python -m pip install --upgrade pip==22.0.4`
88-
- IF you have multiple python versions installed (assumes you have `py` as well)<br/>
89-
`py -3.7 -m pip install --upgrade pip==22.0.4`
90-
* Use Pip to get the python tools we need to install the plugin. These will only be applied to the venv you created earlier:<br/>
83+
- Windows, Powershell:<br>
84+
`.venv\Scripts\activate`
85+
- MacOS, terminal:<br>
86+
`.venv/Scripts/activate`
87+
* Use Pip to get the python tools we need to install the plugin.
88+
<br>These will only be applied to the `.venv` virtual environment you created earlier:<br>
9189
`pip install -r requirements/install.txt`
92-
* Install the plugin. It should work if you have deleted the original plugin, but will patch it if it is there.<br/>
90+
* Install the plugin. It should work if you have deleted the original plugin, but will patch it if it is there.<br>
9391
`inv install`
9492

95-
### Installation (non-dev, Tl;Dr):
93+
### Installation (non-dev, TL;DR):
9694

9795
<b>Windows (Powershell recommended)</b>
9896
```
99-
echo I have installed python 3.7.9 (32 bit). If not, the rest of this won't work.
97+
@echo You must have installed python 3.7.9 (32 bit). If not, the rest of this won't work.
10098
py.exe -3.7 -m venv .venv
101-
echo if the previous command did not work, you do not have py installed or py is not in your PATH. If you only have python 3.7.9, run the next command. If it worked, skip the next command.
99+
@echo If the previous command did not work, you do not have py installed or py is not in your PATH.
100+
@echo If you only have python 3.7.9, run the next command.
101+
@echo If it worked, skip the next command.
102102
python.exe -m venv .venv
103-
echo virtual environment is installed. on to the next step.
104-
.\.venv\Scripts\activate.ps1
105-
echo i am downgrading pip.
106-
py.exe -m pip install --upgrade pip==22.0.4
107-
echo if the previous command did not work, you do not have py installed or py is not in your PATH. If you only have python 3.7.9, run the next command. If it worked, skip the next command.
108-
python.exe -m pip install --upgrade pip==22.0.4
103+
@echo virtual environment is installed. on to the next step.
104+
.venv\Scripts\activate
109105
pip install -r requirements/install.txt
110106
inv install
111107
```
112108

113109
<b>MacOS</b> (assumes your shell is bash, which is the default. if you are good enough to change that, you can figure out how to run these)
114110
```
115-
echo I have installed python 3.7.9 (MacOS). If not, the rest of this won't work.
111+
echo You must have installed python 3.7.9 (MacOS). If not, the rest of this won't work.
116112
py -3.7 -m venv .venv
117-
echo if the previous command did not work, you do not have py installed or py is not in your PATH. If you only have python 3.7.9, run the next command. If it worked, skip the next command.
113+
echo If the previous command did not work, you do not have py installed or py is not in your PATH.
114+
echo If you only have python 3.7.9, run the next command.
115+
echo If it worked, skip the next command.
118116
python -m venv .venv
119117
echo virtual environment is installed. on to the next step.
120-
./.venv/Scripts/activate.sh
121-
echo i am downgrading pip.
122-
py -m pip install --upgrade pip==22.0.4
123-
echo if the previous command did not work, you do not have py installed or py is not in your PATH. If you only have python 3.7.9, run the next command. If it worked, skip the next command.
124-
python -m pip install --upgrade pip==22.0.4
118+
.venv/Scripts/activate
125119
pip install -r requirements/install.txt
126120
inv install
127121
```
128122

129123
### Install Error fixes:
130-
If `inv install` throws a bunch of errors, make sure you have the proper python venv set up. It should complain about `getargspec`. If this happens, you created the wrong virtual environment. You can either delete .venv and reinstall it, or create a new virtual environment with a different name and use that. make sure you use `py -3.7` when creating your venv. If you don't have py, get it. You can specify the full path to python 3.7 instead if you want, but that's harder to do and harder to explain here.
124+
If `inv install` throws a bunch of errors, make sure you have the proper python venv set up. It should complain about `getargspec`. If this happens, you created the wrong virtual environment. You can either delete the `.venv` folder and reinstall it, or create a new virtual environment with a different name and use that.
125+
126+
Make sure you use `py -3.7` when creating your venv. If you don't have `py`, get it. You can specify the full path to python 3.7 instead if you want, but that's harder to do and harder to explain here.
131127

132128
## Why this fork?
133129

@@ -138,10 +134,10 @@ Well, without being too complicated, Steam changed how they do authentication. W
138134
### Current Version:
139135
This is a fork of https://github.com/FriendsOfGalaxy/galaxy-integration-steam
140136

141-
The new Authorization flow implementation is heavily influenced by SteamKit. https://github.com/SteamRE/SteamKit<br/>
137+
The new Authorization flow implementation is heavily influenced by SteamKit. https://github.com/SteamRE/SteamKit<br>
142138
While we have not utilized their source code, they have implemented the new authentication workflow before we did, and we used their knowledge of how to do so in order to implement it ourselves. If you are doing anything steam related in C#, you should check them out; their project has far more features than our own.
143139

144-
Some work was influenced by ValvePython. https://github.com/ValvePython/steam<br/>
140+
Some work was influenced by ValvePython. https://github.com/ValvePython/steam<br>
145141
Our projects do the same thing, but use different methods (we use asyncio, they use gevent, for example). Both projects were working on the new Auth Flow simultaneously, with little collaboration between us. That said, their scope is much larger than our own and lets you do a lot more things. If you are looking for a python means of implementing a steam network authentication, you should use their work instead.
146142

147143
### The names of individual developers will appear here, soon(ish). Any thanks can be directed there
@@ -155,3 +151,6 @@ Original Plugin was based on work and research done by others:
155151
* https://github.com/summersb92/aeolipile
156152
* https://github.com/rcpoison/steam-scraper
157153
* https://github.com/chmccc/steam-scraper
154+
155+
156+
[Python379]: https://www.python.org/downloads/release/python-379/

pytest.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[pytest]
22
python_paths = src
3-
testpaths = src tests
3+
testpaths = tests
44
addopts = --flakes --color=yes
55
markers = integration
6-
python_files = test_*.py
6+
python_files = *.py

requirements/app.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ vdf==3.2
66
pyobjc-framework-CoreServices==5.1.2; sys_platform == 'darwin'
77
websockets==8.1
88
dataclasses-json==0.4.2
9-
rsa==4.9
9+
rsa==4.9

requirements/dev.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
-r app.txt
22
-r install.txt
33

4+
pip-tools==5.1.2
5+
46
pytest==5.2.0
57
pytest-asyncio==0.10.0
68
pytest-mock==1.10.3
79
pytest-flakes==4.0.0
810
pytest-pythonpath==0.7.3
9-
pip-tools==5.1.2

requirements/install.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1+
#use specific pip version for dependencies to work nicely
2+
pip==22.0.4
3+
14
#protoc install.
25
requests
36

47
#install requirements.
58
invoke==1.2.0
69
wheel
710

8-
galaxy.plugin.api==0.69
11+
galaxy.plugin.api==0.69

tasks.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import requests
55
import tempfile
66
import zipfile
7-
from shutil import rmtree, copy2
7+
from shutil import rmtree, copy2, which
88
from distutils.dir_util import copy_tree
99
from io import BytesIO
1010

@@ -23,7 +23,11 @@
2323
if sys.platform == 'win32':
2424
DIST_DIR = os.environ['localappdata'] + '\\GOG.com\\Galaxy\\plugins\\installed'
2525
PLATFORM = "win32"
26-
PYTHON_EXE = "python.exe"
26+
27+
if which("py"):
28+
PYTHON_EXE = "py -3.7"
29+
else:
30+
PYTHON_EXE = "python"
2731

2832
PROTOC_EXE = os.path.join(PROTOC_DIR, "bin", "protoc.exe")
2933
PROTOC_INCLUDE_DIR = os.path.join(PROTOC_DIR, "include")
@@ -46,10 +50,10 @@ def build(c, output='output', ziparchive=None):
4650
rmtree(output)
4751

4852
print('--> Fixing a pip issue, failing to import `BAR_TYPES` from `pip._internal.cli.progress_bars`')
49-
c.run(PYTHON_EXE + ' -m pip install -U pip==22.0.4')
50-
c.run('pip install -U pip==22.0.4 wheel pip-tools setuptools')
53+
c.run(PYTHON_EXE + ' -m pip install --upgrade pip==22.0.4')
5154

52-
# Firstly dependencies needs to be "flatten" with pip-compile as pip requires --no-deps if --platform is used
55+
# Firstly dependencies need to be "flattened" with pip-compile,
56+
# as pip requires --no-deps if --platform is used.
5357
print('--> Flattening dependencies to temporary requirements file')
5458
with tempfile.NamedTemporaryFile(mode="w", delete=False) as tmp:
5559
c.run(f'pip-compile requirements/app.txt --output-file=-', out_stream=tmp)

tests/conftest.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
import pathlib
2-
from unittest.mock import MagicMock, PropertyMock, Mock, sentinel
3-
42
import pytest
3+
4+
from unittest.mock import MagicMock, PropertyMock, Mock, sentinel
55
from galaxy.unittest.mock import AsyncMock, async_return_value
66

7+
from os import path
8+
BASE_DIR = path.abspath(path.curdir)
9+
10+
import sys
11+
sys.path.append(path.join(BASE_DIR, "src"))
12+
713
from plugin import SteamPlugin, AUTH_SETUP_ON_VERSION__CACHE_KEY
814
from backend_interface import BackendInterface
915
from version import __version__

0 commit comments

Comments
 (0)