Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: gogcom/galaxy-integrations-python-api
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 0.46
Choose a base ref
...
head repository: gogcom/galaxy-integrations-python-api
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref

Commits on Jun 19, 2019

  1. platform name fixing

    gog-piotrmarzec committed Jun 19, 2019
    Copy the full SHA
    8d210e7 View commit details

Commits on Aug 2, 2019

  1. Turn on type checking

    rbierbasz-gog committed Aug 2, 2019
    Copy the full SHA
    c3bbeee View commit details
  2. Docs fixes

    rbierbasz-gog committed Aug 2, 2019
    Copy the full SHA
    a76345f View commit details

Commits on Aug 3, 2019

  1. Fix a comment typo

    vadim-su authored and apawlowskij committed Aug 3, 2019
    Copy the full SHA
    f5eb32a View commit details

Commits on Aug 13, 2019

  1. 2
    Copy the full SHA
    4cc8be8 View commit details
  2. Increment version

    rbierbasz-gog committed Aug 13, 2019
    Copy the full SHA
    cec3669 View commit details

Commits on Aug 14, 2019

  1. Copy the full SHA
    161122b View commit details
  2. Install wheel in deploy

    rbierbasz-gog committed Aug 14, 2019
    Copy the full SHA
    d4cd1ce View commit details

Commits on Aug 20, 2019

  1. Merge branch 'master' of https://gitlab.gog.com/galaxy-client/galaxy-…

    …plugin-api into platform_id_update
    
    # Conflicts:
    #	PLATFORM_IDs.md
    Pawel Czoppa committed Aug 20, 2019
    Copy the full SHA
    d8a00d5 View commit details
  2. Copy the full SHA
    ca85b24 View commit details

Commits on Aug 22, 2019

  1. Copy the full SHA
    dec59f4 View commit details

Commits on Aug 23, 2019

  1. Copy the full SHA
    b20fce0 View commit details
  2. Copy the full SHA
    0ab00e4 View commit details

Commits on Sep 2, 2019

  1. Copy the full SHA
    0294e2a View commit details
  2. Increment version

    rbierbasz-gog committed Sep 2, 2019
    Copy the full SHA
    bab0be9 View commit details

Commits on Sep 5, 2019

  1. 2
    Copy the full SHA
    8d6ec50 View commit details
  2. Increment version

    apawlowskij committed Sep 5, 2019
    Copy the full SHA
    aa7b398 View commit details

Commits on Sep 18, 2019

  1. Copy the full SHA
    d561022 View commit details
  2. Increment version

    rbierbasz-gog committed Sep 18, 2019
    Copy the full SHA
    4d6d3b8 View commit details

Commits on Sep 19, 2019

  1. Copy the full SHA
    392e4c5 View commit details

Commits on Sep 25, 2019

  1. Add RegistryMonitor

    rbierbasz-gog committed Sep 25, 2019
    Copy the full SHA
    4d3c9b7 View commit details

Commits on Sep 27, 2019

  1. Revert "Add ignoring not having windll to mypy"

    This reverts commit 55c7fcfd61e0391287e2717117da4fca03b77dec.
    goggalaxy committed Sep 27, 2019
    Copy the full SHA
    66085e2 View commit details
  2. Copy the full SHA
    f57e03d View commit details

Commits on Oct 1, 2019

  1. Increment version

    goggalaxy committed Oct 1, 2019
    Copy the full SHA
    2e2aa8c View commit details

Commits on Oct 2, 2019

  1. Copy the full SHA
    98cff9c View commit details

Commits on Oct 7, 2019

  1. Add Rockstar platform

    apawlowskij committed Oct 7, 2019
    Copy the full SHA
    a19a6cf View commit details

Commits on Oct 15, 2019

  1. Increment version

    goggalaxy committed Oct 15, 2019
    Copy the full SHA
    c9b1c8f View commit details

Commits on Oct 21, 2019

  1. Fix mypy ignores

    rbierbasz-gog committed Oct 21, 2019
    Copy the full SHA
    eb216a5 View commit details
  2. Revert "Add more logs"

    This reverts commit 21ab8bf33d3c2714b8c7af2da8036fe8baae20ea.
    rbierbasz-gog committed Oct 21, 2019
    Copy the full SHA
    2dc5657 View commit details
  3. Increment version

    rbierbasz-gog committed Oct 21, 2019
    Copy the full SHA
    c874bc1 View commit details
  4. Copy the full SHA
    062d6a9 View commit details
  5. Increment version

    apawlowskij committed Oct 21, 2019
    Copy the full SHA
    92caf68 View commit details

Commits on Oct 22, 2019

  1. Copy the full SHA
    1585bab View commit details

Commits on Oct 28, 2019

  1. Use pytest 5.2.2

    rbierbasz-gog committed Oct 28, 2019
    Copy the full SHA
    0a20629 View commit details
  2. Copy the full SHA
    e57ecc4 View commit details

Commits on Oct 30, 2019

  1. Copy the full SHA
    9041dbd View commit details

Commits on Oct 31, 2019

  1. Copy the full SHA
    78f1d5a View commit details

Commits on Nov 4, 2019

  1. Copy the full SHA
    d79f183 View commit details

Commits on Nov 7, 2019

  1. Increment version

    goggalaxy committed Nov 7, 2019
    Copy the full SHA
    e32abe1 View commit details

Commits on Nov 8, 2019

  1. Copy the full SHA
    810a877 View commit details

Commits on Nov 13, 2019

  1. Copy the full SHA
    c03465e View commit details
  2. Copy the full SHA
    4aa76b6 View commit details

Commits on Nov 15, 2019

  1. fix parse sphinx parse error

    + other small imporvements in docs
    goggalaxy committed Nov 15, 2019
    Copy the full SHA
    2cf8339 View commit details

Commits on Nov 18, 2019

  1. Increment vesion

    goggalaxy committed Nov 18, 2019
    Copy the full SHA
    8bf367d View commit details

Commits on Nov 20, 2019

  1. Copy the full SHA
    66ab180 View commit details
  2. Increment version

    goggalaxy committed Nov 20, 2019
    Copy the full SHA
    b695cdf View commit details
  3. Add async_raise

    rbierbasz-gog committed Nov 20, 2019
    Copy the full SHA
    3d3922c View commit details

Commits on Nov 22, 2019

  1. Do not use root logger

    rbierbasz-gog committed Nov 22, 2019
    Copy the full SHA
    02f4faa View commit details
  2. Add timeout to shutdown

    rbierbasz-gog committed Nov 22, 2019
    Copy the full SHA
    f5d47b0 View commit details

Commits on Nov 27, 2019

  1. Copy the full SHA
    69532a5 View commit details
Showing with 3,123 additions and 538 deletions.
  1. +11 −0 .github/ISSUE_TEMPLATE/config.yml
  2. +14 −0 .github/ISSUE_TEMPLATE/problem_report.md
  3. +20 −0 .github/workflows/ci.yml
  4. +2 −0 .gitignore
  5. +10 −4 .gitlab-ci.yml
  6. +0 −8 .travis.yml
  7. +17 −8 PLATFORM_IDs.md
  8. +32 −8 README.md
  9. +6 −4 docs/requirements.txt
  10. +5 −4 docs/source/conf.py
  11. +1 −1 docs/source/galaxy.api.rst
  12. +8 −0 docs/source/galaxy.http.rst
  13. +2 −1 docs/source/index.rst
  14. +2 −0 mypy.ini
  15. +1 −1 pytest.ini
  16. +7 −0 requirements-dev.txt
  17. +4 −6 requirements.txt
  18. +4 −3 setup.py
  19. +6 −1 src/galaxy/__init__.py
  20. +45 −0 src/galaxy/api/consts.py
  21. +52 −39 src/galaxy/api/errors.py
  22. +102 −0 src/galaxy/api/importer.py
  23. +190 −104 src/galaxy/api/jsonrpc.py
  24. +545 −181 src/galaxy/api/plugin.py
  25. +121 −17 src/galaxy/api/types.py
  26. +85 −19 src/galaxy/http.py
  27. +8 −12 src/galaxy/proc_tools.py
  28. +1 −1 src/galaxy/reader.py
  29. +99 −0 src/galaxy/registry_monitor.py
  30. +53 −0 src/galaxy/task_manager.py
  31. +13 −5 src/galaxy/unittest/mock.py
  32. +0 −3 tests/__init__.py
  33. +33 −8 tests/conftest.py
  34. +28 −23 tests/test_achievements.py
  35. +30 −20 tests/test_authenticate.py
  36. +147 −0 tests/test_errors.py
  37. +8 −1 tests/test_features.py
  38. +45 −10 tests/test_friends.py
  39. +199 −0 tests/test_game_library_settings.py
  40. +26 −23 tests/test_game_times.py
  41. +12 −10 tests/test_http.py
  42. +1 −0 tests/test_internal.py
  43. +17 −0 tests/test_launch_platform_client.py
  44. +10 −8 tests/test_local_games.py
  45. +197 −0 tests/test_local_size.py
  46. +190 −0 tests/test_os_compatibility.py
  47. +8 −4 tests/test_owned_games.py
  48. +3 −1 tests/test_persistent_cache.py
  49. +75 −0 tests/test_refresh_credentials.py
  50. +345 −0 tests/test_subscriptions.py
  51. +283 −0 tests/test_user_presence.py
11 changes: 11 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
blank_issues_enabled: true
contact_links:
- name: GOG GALAXY 2.0 issue
url: https://mantis2.gog.com/
about: Report issues related to GOG GALAXY 2.0, official integrations or the whole ecosystem
- name: Platform ID request
url: https://github.com/gogcom/galaxy-integrations-python-api/issues/160
about: Report missing platform id
- name: Community integrations
url: https://github.com/Mixaill/awesome-gog-galaxy
about: Find integrations and their maintainers, request new integrations or report issues related to unofficial integrations.
14 changes: 14 additions & 0 deletions .github/ISSUE_TEMPLATE/problem_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
name: API issue
about: Report a bug or problem with current API architecture

---

**Problem**
<!-- Describe the problem you faced. -->

**Solution**
<!-- Describe the solution you'd like. -->

**Alternatives**
<!-- Optionally describe possible alternatives or current workarounds if any. -->
20 changes: 20 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: CI

on: [push, pull_request]

jobs:
test:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
- name: Run tests
run: |
pytest
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -7,3 +7,5 @@ docs/build/
Pipfile
.idea
docs/source/_build
.mypy_cache
.pytest_cache
14 changes: 10 additions & 4 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
image: registry-gitlab.gog.com/galaxy-client/gitlab-ci-tools:latest
image: registry-gitlab.gog.com/docker/python:3.7.3

stages:
- test
@@ -7,20 +7,26 @@ stages:
test_package:
stage: test
script:
- pip install -r requirements.txt
- pip install -r requirements-dev.txt
- pytest
except:
- tags

deploy_package:
stage: deploy
variables:
TWINE_USERNAME: $PYPI_USERNAME
TWINE_PASSWORD: $PYPI_PASSWORD
script:
- pip install twine wheel
- rm -rf dist
- export VERSION=$(python setup.py --version)
- python setup.py sdist --formats=gztar upload -r gog-pypi
- python setup.py sdist --formats=gztar bdist_wheel
- twine upload dist/*
- curl -X POST --silent --show-error --fail
"https://gitlab.gog.com/api/v4/projects/${CI_PROJECT_ID}/repository/tags?tag_name=${VERSION}&ref=${CI_COMMIT_REF_NAME}&private_token=${PACKAGE_DEPLOYER_API_TOKEN}"
when: manual
only:
- master
except:
- tags
- tags
8 changes: 0 additions & 8 deletions .travis.yml

This file was deleted.

25 changes: 17 additions & 8 deletions PLATFORM_IDs.md
Original file line number Diff line number Diff line change
@@ -4,10 +4,10 @@ Platform ID list for GOG Galaxy 2.0 Integrations

| ID | Name |
| --- | --- |
| test | Testing purposes |
| steam | Steam |
| psn | PlayStation Network |
| xboxone | Xbox Live |
| generic | Manually added games |
| origin | Origin |
| uplay | Uplay |
| battlenet | Battle.net |
@@ -20,7 +20,7 @@ Platform ID list for GOG Galaxy 2.0 Integrations
| nswitch | Nintendo Switch |
| nwiiu | Nintendo Wii U |
| nwii | Nintendo Wii |
| ncube | Nintendo Game Cube |
| ncube | Nintendo GameCube |
| riot | Riot |
| wargaming | Wargaming |
| ngameboy | Nintendo Game Boy |
@@ -58,25 +58,34 @@ Platform ID list for GOG Galaxy 2.0 Integrations
| bb | BestBuy |
| gameuk | Game UK |
| fanatical | Fanatical store |
| playasia | PlayAsia |
| playasia | Play-Asia |
| stadia | Google Stadia |
| arc | ARC |
| eso | ESO |
| glyph | Trion World |
| aionl | Aion: Legions of War |
| aion | Aion |
| blade | Blade and Soul |
| blade | Blade & Soul |
| gw | Guild Wars |
| gw2 | Guild Wars 2 |
| lin2 | Lineage 2 |
| ffxi | Final Fantasy XI |
| ffxiv | Final Fantasy XIV |
| totalwar | TotalWar |
| ffxiv | Final Fantasy XIV |
| totalwar | Total War |
| winstore | Windows Store |
| elites | Elite Dangerous |
| star | Star Citizen |
| psp | Playstation Portable |
| psvita | Playstation Vita |
| psp | PlayStation Portable |
| psvita | PlayStation Vita |
| nds | Nintendo DS |
| 3ds | Nintendo 3DS |
| pathofexile | Path of Exile |
| twitch | Twitch |
| minecraft | Minecraft |
| gamesessions | GameSessions |
| nuuvem | Nuuvem |
| fxstore | FX Store |
| indiegala | IndieGala |
| playfire | Playfire |
| oculus | Oculus |
| rockstar | Rockstar |
40 changes: 32 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -36,20 +36,31 @@ Communication between an integration and the client is also possible with the us
import sys
from galaxy.api.plugin import Plugin, create_and_run_plugin
from galaxy.api.consts import Platform
from galaxy.api.types import Authentication, Game, LicenseInfo, LicenseType


class PluginExample(Plugin):
def __init__(self, reader, writer, token):
super().__init__(
Platform.Generic, # Choose platform from available list
"0.1", # Version
Platform.Test, # choose platform from available list
"0.1", # version
reader,
writer,
token
)

# implement methods

# required
async def authenticate(self, stored_credentials=None):
pass
return Authentication('test_user_id', 'Test User Name')

# required
async def get_owned_games(self):
return [
Game('test', 'The Test', None, LicenseInfo(LicenseType.SinglePurchase))
]


def main():
create_and_run_plugin(PluginExample, sys.argv)
@@ -76,6 +87,20 @@ In order to be found by GOG Galaxy 2.0 an integration folder should be placed in

`~/Library/Application Support/GOG.com/Galaxy/plugins/installed`

### Logging
<a href='https://docs.python.org/3.7/howto/logging.html'>Root logger</a> is already setup by GOG Galaxy to store rotated log files in:

- Windows:

`%programdata%\GOG.com\Galaxy\logs`

- macOS:

`/Users/Shared/GOG.com/Galaxy/Logs`

Plugin logs are kept in `plugin-<platform>-<guid>.log`.
When debugging, inspecting the other side of communication in the `GalaxyClient.log` can be helpful as well.

### Manifest

<a name="deploy-manifest"></a>
@@ -84,8 +109,8 @@ Obligatory JSON file to be placed in an integration folder.
```json
{
"name": "Example plugin",
"platform": "generic",
"guid": "UNIQUE-GUID",
"platform": "test",
"guid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"version": "0.1",
"description": "Example plugin",
"author": "Name",
@@ -97,9 +122,8 @@ Obligatory JSON file to be placed in an integration folder.

| property | description |
|---------------|---|
| `guid` | |
| `description` | |
| `url` | |
| `guid` | custom Globally Unique Identifier |
| `version` | the same string as `version` in `Plugin` constructor |
| `script` | path of the entry point module, relative to the integration folder |

### Dependencies
10 changes: 6 additions & 4 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
Sphinx==2.0.1
sphinx-rtd-theme==0.4.3
sphinx-autodoc-typehints==1.6.0
m2r==0.2.1
Sphinx==4.2.0
sphinx-rtd-theme==1.0.0
sphinx-autodoc-typehints==1.12.0
sphinxcontrib-asyncio==0.3.0
m2r2==0.3.1
typing-extensions==3.10.0.2
9 changes: 5 additions & 4 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -32,12 +32,13 @@
# ones.
extensions = [
'sphinx.ext.autodoc',
'sphinxcontrib.asyncio',
'sphinx_autodoc_typehints',
'm2r' # mdinclude directive for makrdown files
'm2r2' # mdinclude directive for makrdown files
]
autodoc_member_order = 'bysource'
autodoc_inherit_docstrings = False
autodoc_mock_imports = ["galaxy.http"]
autodoc_mock_imports = ["aiohttp"]

set_type_checking_flag = True

@@ -47,7 +48,7 @@
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = []
exclude_patterns = [] # type: ignore


# -- Options for HTML output -------------------------------------------------
@@ -69,6 +70,6 @@
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
# html_static_path = ["_static"]

master_doc = 'index'
2 changes: 1 addition & 1 deletion docs/source/galaxy.api.rst
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ plugin
.. automodule:: galaxy.api.plugin
:members:
:undoc-members:
:exclude-members: JSONEncoder, features, achievements_import_finished, game_times_import_finished, start_achievements_import, start_game_times_import, get_game_times, get_unlocked_achievements
:exclude-members: JSONEncoder, features

types
-----------------------
8 changes: 8 additions & 0 deletions docs/source/galaxy.http.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
galaxy.http
=================

.. automodule:: galaxy.http
:members:
:special-members: __init__
:undoc-members:
:show-inheritance:
3 changes: 2 additions & 1 deletion docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -6,7 +6,8 @@ GOG Galaxy Integrations Python API
:includehidden:

Overview <overview>
API <galaxy.api>
galaxy.api
galaxy.http
Platform ID's <platforms>

Index
2 changes: 2 additions & 0 deletions mypy.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[mypy]
ignore_missing_imports = True
2 changes: 1 addition & 1 deletion pytest.ini
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[pytest]
addopts = --flakes
addopts = --flakes --mypy
7 changes: 7 additions & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
-r requirements.txt
pytest==5.2.2
pytest-asyncio==0.10.0
pytest-mock==1.10.3
pytest-mypy==0.4.1
pytest-flakes==4.0.0
types-certifi==2020.4.0
10 changes: 4 additions & 6 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
-e .
pytest==4.2.0
pytest-asyncio==0.10.0
pytest-mock==1.10.3
pytest-flakes==4.0.0
# because of pip bug https://github.com/pypa/pip/issues/4780
# Copied from setup.py because of a pip bug
# see https://github.com/pypa/pip/issues/4780
aiohttp==3.5.4
certifi==2019.3.9
psutil==5.6.3; sys_platform == 'darwin'
psutil==5.6.6; sys_platform == 'darwin'
# End of copy from setup.py
7 changes: 4 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
@@ -2,14 +2,15 @@

setup(
name="galaxy.plugin.api",
version="0.46",
version="0.69",
description="GOG Galaxy Integrations Python API",
author='Galaxy team',
author_email='galaxy@gog.com',
packages=find_packages("src"),
package_dir={'': 'src'},
install_requires=[
"aiohttp==3.5.4",
"certifi==2019.3.9"
"aiohttp>=3.5.4",
"certifi>=2019.3.9",
"psutil>=5.6.6; sys_platform == 'darwin'"
]
)
7 changes: 6 additions & 1 deletion src/galaxy/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
import logging


logging.getLogger(__name__).setLevel(logging.INFO)

__path__: str = __import__('pkgutil').extend_path(__path__, __name__) # type: ignore
Loading