Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOC: initial sphinx and readthedocs stub #261

Merged
merged 17 commits into from
Sep 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,8 @@ updates:
directory: "/pyinstaller"
schedule:
interval: "daily"

- package-ecosystem: "pip"
directory: "/docs"
schedule:
interval: "daily"
2 changes: 1 addition & 1 deletion .github/workflows/build-on-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
jobs:
build:

runs-on: macos-10.15
runs-on: macos-11

steps:

Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ __pycache__
*egg-info
/build
/dist
/docs/build
/docs/source/generated
/docs/source/data
/dtool_lookup_gui/version.py
/tests/*.png
/helpers/*.png
Expand Down
18 changes: 18 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
version: "2"

build:
os: "ubuntu-22.04"
tools:
python: "3.10"
apt_packages:
- "gir1.2-gtksource-4"
- "libgirepository1.0-dev"

python:
install:
- requirements: docs/requirements.txt
- method: pip
path: .

sphinx:
configuration: docs/source/conf.py
1 change: 0 additions & 1 deletion LICENSE-MIT.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
35 changes: 35 additions & 0 deletions docs/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=build

if "%1" == "" goto help

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.http://sphinx-doc.org/
exit /b 1
)

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
3 changes: 3 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
sphinx==7.1.2
sphinx-rtd-theme==1.3.0rc1
myst-parser==2.0.0
7 changes: 7 additions & 0 deletions docs/source/api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
API
===

.. autosummary::
:toctree: generated

dtool_lookup_gui
2 changes: 2 additions & 0 deletions docs/source/changelog.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.. include:: ../../CHANGELOG.md
:parser: myst_parser.sphinx_
61 changes: 61 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Configuration file for the Sphinx documentation builder.

# -- Prepare

import shutil
import os

root = os.path.dirname(__file__)

# Define the source and destination paths for images
data_source_dir = os.path.join(root, '..', '..', 'data')
data_destination_dir = os.path.join(root, 'data')

# Copy images from source to destination
shutil.rmtree(data_destination_dir, ignore_errors=True) # Remove existing destination directory
shutil.copytree(data_source_dir, data_destination_dir) # Copy images

# -- Project information

project = 'dtool-lookup-gui'
copyright = '2023, livMatS'
author = 'Antoine Sanner, Ashwin Vazhappilly, Johannes Laurin Hörmann, Lars Pastewka, Michal Rössler, Wolfram Nöhring'


import dtool_lookup_gui
version = dtool_lookup_gui.__version__
release = dtool_lookup_gui.__version__

# release = '0.1'
# version = '0.1.0'

# -- General configuration

extensions = [
'sphinx.ext.duration',
'sphinx.ext.doctest',
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
'sphinx.ext.intersphinx',
'myst_parser'
]

intersphinx_mapping = {
'python': ('https://docs.python.org/3/', None),
'sphinx': ('https://www.sphinx-doc.org/en/master/', None),
}
intersphinx_disabled_domains = ['std']

templates_path = ['_templates']

# -- Options for HTML output

html_theme = 'sphinx_rtd_theme'

# -- Options for EPUB output
epub_show_urls = 'footnote'

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This patterns also effect to html_static_path and html_extra_path
exclude_patterns = ['data']
2 changes: 2 additions & 0 deletions docs/source/contributing.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.. include:: ../../CONTRIBUTING.md
:parser: myst_parser.sphinx_
16 changes: 16 additions & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Welcome to the dtool-lookup-gui's documentation!
================================================

.. note::

This project is under active development.

Contents
--------

.. toctree::

readme
contributing
changelog
api
1 change: 1 addition & 0 deletions docs/source/readme.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.. include:: ../../README.rst
3 changes: 2 additions & 1 deletion dtool_lookup_gui/main.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#
# Copyright 2021-2022 Johannes Laurin Hörmann
# Copyright 2021-2023 Johannes Laurin Hörmann
# 2023 Ashwin Vazhappilly
# 2021 Lars Pastewka
#
# ### MIT license
Expand Down
3 changes: 2 additions & 1 deletion dtool_lookup_gui/models/datasets.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#
# Copyright 2021-2022 Johannes Laurin Hörmann
# Copyright 2023 Ashwin Vazhappilly
# 2021-2023 Johannes Laurin Hörmann
# 2020-2021 Lars Pastewka
#
# ### MIT license
Expand Down
24 changes: 24 additions & 0 deletions dtool_lookup_gui/views/login_window.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
#
# Copyright 2023 Johannes Laurin Hörmann
# 2023 Ashwin Vazhappilly
#
# ### MIT license
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
#
import logging
import os
import dtoolcore
Expand Down
4 changes: 3 additions & 1 deletion dtool_lookup_gui/views/login_window.ui
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
<template class="LoginWindow" parent="GtkWindow">
<property name="can-focus">False</property>
<property name="default-width">400</property>
<property name="default-height">300</property>
<property name="default-height">200</property>
<property name="resizable">False</property>
<property name="modal">True</property>
<signal name="delete-event" handler="on_delete" swapped="no"/>
<child>
<!-- n-columns=3 n-rows=3 -->
Expand Down
3 changes: 2 additions & 1 deletion dtool_lookup_gui/views/main_window.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#
# Copyright 2021-2022 Johannes Laurin Hörmann
# Copyright 2021-2023 Johannes Laurin Hörmann
# 2023 Ashwin Vazhappilly
# 2021 Lars Pastewka
#
# ### MIT license
Expand Down
3 changes: 2 additions & 1 deletion dtool_lookup_gui/views/s3_configuration_dialog.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#
# Copyright 2021 Lars Pastewka
# Copyright 2022 Johannes Laurin Hörmann
# 2021 Lars Pastewka
#
# ### MIT license
#
Expand Down
24 changes: 24 additions & 0 deletions dtool_lookup_gui/views/server_versions_dialog.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
#
# Copyright 2023 Ashwin Vazhappilly
# 2023 Johannes Laurin Hörmann
#
# ### MIT license
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
#
import asyncio
import logging
import os
Expand Down
3 changes: 2 additions & 1 deletion dtool_lookup_gui/views/settings_dialog.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#
# Copyright 2021-2022 Johannes Laurin Hörmann
# Copyright 2021-2023 Johannes Laurin Hörmann
# 2023 Ashwin Vazhappilly
# 2021 Lars Pastewka
#
# ### MIT license
Expand Down
40 changes: 40 additions & 0 deletions maintenance/authors_alphabetical.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#
# Copyright 2023 Johannes Laurin Hörmann
#
# ### MIT license
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
#


import os
import sys
root = os.path.dirname(sys.argv[0])


def read_authors(fn):
return {email.strip('<>'): name for name, email in
[line.rsplit(maxsplit=1) for line in open(fn, 'r')]}


authors = read_authors('{}/../AUTHORS'.format(root))

authors_alphabetical = sorted(list(set(authors.values())))

print(', '.join(authors_alphabetical))
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright 2020-2022 Johannes Laurin Hörmann
# Copyright 2020-2023 Johannes Laurin Hörmann
# 2020-2021 Lars Pastewka
# 2020 Antoine Sanner
#
Expand Down
4 changes: 3 additions & 1 deletion test/test_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from dtool_lookup_gui.views.log_window import LogWindow
from dtool_lookup_gui.views.login_window import LoginWindow
from dtool_lookup_gui.views.main_window import MainWindow
from dtool_lookup_gui.views.server_versions_dialog import ServerVersionsDialog

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -35,14 +36,15 @@ async def test_app_id(app):
@pytest.mark.asyncio
async def test_app_window_types(app):
window_types = [type(win) for win in app.get_windows()]
assert set(window_types) == set([AboutDialog, SettingsDialog, LogWindow, LoginWindow, MainWindow])
assert set(window_types) == set([AboutDialog, SettingsDialog, ServerVersionsDialog, LogWindow, MainWindow])


@pytest.mark.asyncio
async def test_app_list_actions(app):
assert set(app.list_actions()) == set([
'toggle-logging',
'reset-config',
'renew-token',
'set-loglevel',
'set-logfile',
'export-config',
Expand Down
Loading