Skip to content

Commit

Permalink
Fix documentation building
Browse files Browse the repository at this point in the history
  • Loading branch information
tomvlk committed Mar 12, 2022
1 parent ce2f9c6 commit 6836333
Show file tree
Hide file tree
Showing 6 changed files with 154 additions and 3 deletions.
12 changes: 12 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: 2
build:
os: ubuntu-20.04
tools:
python: "3.8"

sphinx:
configuration: docs/source/conf.py

python:
install:
- requirements: requirements.txt
12 changes: 12 additions & 0 deletions docs/settings/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
"""
This folder contains the configuration in different files. This init file imports all files in the current directory
to make sure we combine configurations to one settings module.
"""

from .base import *
from .apps import *

try:
from .local import *
except:
pass
38 changes: 38 additions & 0 deletions docs/settings/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
"""
This file contains the apps & apps settings and overrides the default ones that are defined in the core.
Please copy the default file to: apps.py
"""

# In the apps dictionary and array you configure the apps (or plugins) are loaded for specific pools (controllers).
# Be aware that the list will *ALWAYS* be prepended after the mandatory defaults are loaded in place.
# The mandatory defaults are specific per version, refer to the documentation:
APPS = {
'default': [
'pyplanet.apps.contrib.admin',
'pyplanet.apps.contrib.jukebox',
'pyplanet.apps.contrib.karma',
'pyplanet.apps.contrib.local_records',
'pyplanet.apps.contrib.dedimania',
'pyplanet.apps.contrib.players',
'pyplanet.apps.contrib.info',
'pyplanet.apps.contrib.mx',
'pyplanet.apps.contrib.transactions',

# New since 0.4.0:
'pyplanet.apps.contrib.sector_times',
'pyplanet.apps.contrib.dynamic_points',

# New since 0.5.0:
'pyplanet.apps.contrib.clock',
'pyplanet.apps.contrib.best_cps',
'pyplanet.apps.contrib.voting',

# New since 0.6.0:
'pyplanet.apps.contrib.queue',
'pyplanet.apps.contrib.ads',
'pyplanet.apps.contrib.music_server',

# New since 0.8.0:
'pyplanet.apps.contrib.funcmd',
],
}
85 changes: 85 additions & 0 deletions docs/settings/base.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
"""
This file contains the local settings and overrides the default ones.
"""
import os

# Set the root_path to the root of our project.
ROOT_PATH = os.path.dirname(os.path.dirname(__file__))

# Set the temporary location for the project.
TMP_PATH = os.path.join(ROOT_PATH, 'tmp')

# Create temporary folder if not exists.
if not os.path.exists(TMP_PATH):
os.mkdir(TMP_PATH)

# Enable debug mode to get verbose output, not report any errors and dynamically use the DEBUG in your code
# for extra verbosity of logging/output.
DEBUG = True # bool(os.environ.get('PYPLANET_DEBUG', False))

# Add your pools (the controller instances per dedicated here) or leave as it is to use a single instance only.
POOLS = [
'default',
]

# Owners are logins of the server owners, the owners always get *ALL* the permissions in the system.
OWNERS = {
'default': [
'your-maniaplanet-login'
]
}

# Databases configuration holds an dictionary with information of the database backend.
# Please refer to the documentation for all examples.
MYSQL = {
'ENGINE': 'peewee_async.MySQLDatabase',
'NAME': 'pyplanet',
'OPTIONS': {
'host': 'localhost',
'user': 'root',
'password': '',
'charset': 'utf8mb4',
}
}
POSTGRESQL = {
'ENGINE': 'peewee_async.PostgresqlDatabase',
'NAME': 'pyplanet',
'OPTIONS': {
'host': 'localhost',
'user': 'pyplanet',
'password': 'pyplanet',
'autocommit': True,
}
}
DATABASE_ENGINE = None
TOX_ENV = os.getenv('TOXENV', 'py36-unit-mysql')
if 'mysql' in TOX_ENV:
DATABASE_ENGINE = MYSQL
elif 'postgresql' in TOX_ENV:
DATABASE_ENGINE = POSTGRESQL
DATABASES = {
'default': DATABASE_ENGINE
}

# Dedicated configuration holds the different dedicated servers that the instances will run on including the names of
# the instances.
DEDICATED = {
'default': {
'HOST': '127.0.0.1',
'PORT': '5000',
'USER': 'SuperAdmin',
'PASSWORD': 'SuperAdmin',
}
}

# The storage configuration contains the same instance mapping of the dedicated servers and is used
# to access the filesystem on the dedicated server location.
# Please refer to the documentation for more information.
STORAGE = {
'default': {
'DRIVER': 'pyplanet.core.storage.drivers.local.LocalDriver',
'OPTIONS': {},
}
}

MAP_MATCHSETTINGS = 'test.txt'
4 changes: 4 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@
import pyplanet.core.instance
import pyplanet.apps

# Also load the template settings.
template_settings_folder = os.path.join(src_folder, 'docs', 'settings')
sys.path.insert(0, os.path.dirname(template_settings_folder))

# -- General configuration ------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
Expand Down
6 changes: 3 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ urllib3==1.26.5
# Utils
cached-property==1.5.2
watchdog==0.10.2
pandas>=1.0.0,<=1.2.4
numpy>=1.19.5,<=1.20.3
pandas==1.4.1
numpy==1.22.3
async_generator==1.10
asyncio_extras==1.3.2
bcrypt==3.2.0
raven==6.10.0
xmltodict==0.12.0
PyYAML==5.4.1

cryptography<3.4
cryptography==36.0.1

0 comments on commit 6836333

Please sign in to comment.