From a99d36491e7aceb921d009d3a7660ca673e25b01 Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Thu, 2 Jan 2020 07:53:47 +0800 Subject: [PATCH 1/2] Update packaging metadata to use Briefcase. --- .gitignore | 3 ++ pyproject.toml | 29 +++++++++++++++++ setup.py | 80 ----------------------------------------------- src/podium/app.py | 7 ----- 4 files changed, 32 insertions(+), 87 deletions(-) create mode 100644 pyproject.toml delete mode 100755 setup.py diff --git a/.gitignore b/.gitignore index 07f58ad..d8e6fcb 100644 --- a/.gitignore +++ b/.gitignore @@ -2,9 +2,12 @@ *~ .*.sw[op] *.egg-info +*.dist-info dist build _build distribute-* local macOS +linux +windows diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..293c083 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,29 @@ +[build-system] +requires = ["briefcase"] + +[tool.briefcase] +project_name = "Podium" +version = "0.2" +bundle = "org.beeware" +author='Russell Keith-Magee' +author_email='russell@keith-magee.com' +homepage='https://beeware.org/project/projects/applications/podium' + +[tool.briefcase.app.podium] +formal_name = "Podium" +description = "A presentation tool for developers." +sources = ["src/podium"] +icon = "src/podium/resources/podium" + +[tool.briefcase.app.podium.document_type.deck] +description = "Podium Slide Deck" +extension = "podium" +icon = "src/podium/resources/podium-deck" +url = 'https://beeware.org/project/projects/applications/podium/' + +[tool.briefcase.app.podium.macOS] +template = '/Users/rkm/projects/beeware/templates/briefcase-macOS-app-template' +requires = ["toga-cocoa>=0.3.0.dev16"] + +[tool.briefcase.app.podium.linux] +requires = ["toga-gtk>=0.3.0.dev16"] diff --git a/setup.py b/setup.py deleted file mode 100755 index fc68d36..0000000 --- a/setup.py +++ /dev/null @@ -1,80 +0,0 @@ -#!/usr/bin/env python -import io -import re -from setuptools import setup, find_packages - - -with io.open('./src/podium/__init__.py', encoding='utf8') as version_file: - version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]", version_file.read(), re.M) - if version_match: - version = version_match.group(1) - else: - raise RuntimeError("Unable to find version string.") - - -with io.open('README.rst', encoding='utf8') as readme: - long_description = readme.read() - -setup( - name='podium', - version=version, - description='A presentation tool for developers.', - long_description=long_description, - author='Russell Keith-Magee', - author_email='russell@keith-magee.com', - url='https://beeware.org/project/projects/applications/podium', - packages=find_packages(where="src"), - package_dir={"": "src"}, - package_data={ - 'podium': [ - 'resources/*.html', - 'resources/*.js', - 'resources/*.css', - 'resources/*.png', - 'resources/*.icns', - 'resources/themes/default/*.css', - 'resources/themes/default/*.woff', - ] - }, - include_package_data=True, - install_requires=[ - ], - license='New BSD', - classifiers=[ - 'Development Status :: 4 - Beta', - 'Intended Audience :: Developers', - 'License :: OSI Approved :: BSD License', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3 :: Only', - 'Topic :: Software Development', - 'Topic :: Utilities', - ], - test_suite='tests', - zip_safe=False, - options={ - 'app': { - 'formal_name': 'Podium', - 'bundle': 'org.beeware', - 'document_types': { - 'deck': { - 'description': 'Podium Slide Deck', - 'extension': 'podium', - 'icon': 'src/podium/resources/podium-deck', - 'url': 'https://beeware.org/project/projects/applications/podium/', - } - } - }, - 'macos': { - 'app_requires': [ - 'toga-cocoa>=0.3.0.dev14' - ], - 'icon': 'src/podium/resources/podium', - }, - 'linux': { - 'app_requires': [ - 'toga-gtk>=0.3.0.dev14' - ], - } - } -) diff --git a/src/podium/app.py b/src/podium/app.py index 96df4e6..909a9df 100644 --- a/src/podium/app.py +++ b/src/podium/app.py @@ -7,14 +7,7 @@ class Podium(toga.DocumentApp): def __init__(self): - resource_dir = os.path.join( - os.path.dirname(__file__), - 'resources' - ) super().__init__( - 'Podium', - app_id='org.beeware.podium', - icon=toga.Icon(os.path.join(resource_dir, 'podium')), document_types={'podium': SlideDeck} ) From 0d0ec84bef454bc9e95306b7fc57cd1f511db34a Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Thu, 2 Jan 2020 07:54:11 +0800 Subject: [PATCH 2/2] Update README to provide briefcase-based dev instructions. --- README.rst | 116 ++++++++++++++++++++++++++--------------------------- 1 file changed, 58 insertions(+), 58 deletions(-) diff --git a/README.rst b/README.rst index d7ef3d6..234c87c 100644 --- a/README.rst +++ b/README.rst @@ -5,23 +5,8 @@ Podium ====== -.. image:: https://img.shields.io/pypi/pyversions/podium.svg - :target: https://pypi.python.org/pypi/podium - -.. image:: https://img.shields.io/pypi/v/podium.svg - :target: https://pypi.python.org/pypi/podium - -.. image:: https://img.shields.io/pypi/status/podium.svg - :target: https://pypi.python.org/pypi/podium - -.. image:: https://img.shields.io/pypi/l/podium.svg - :target: https://github.com/beeware/podium/blob/master/LICENSE - -.. image:: https://travis-ci.org/beeware/podium.svg?branch=master - :target: https://travis-ci.org/beeware/podium - .. image:: https://badges.gitter.im/beeware/general.svg - :target: https://gitter.im/beeware/general + :target: https://gitter.im/beeware/general A markup-based slide presentation tool. @@ -85,40 +70,25 @@ Podium attempts to bridge the gap between these two poles. It is comprised of: Quickstart ---------- -Podium currently requires a source checkout of Toga and Podium, as it uses -unreleased features of both projects. - -If you're using Linux, you'll need to install some system packages first:: - - # Ubuntu/Debian - $ sudo apt-get update - $ sudo apt-get install python3-dev libgirepository1.0-dev libcairo2-dev libpango1.0-dev libwebkitgtk-3.0-0 gir1.2-webkit-3.0 - - # Fedora - $ sudo dnf install pkg-config python3-devel gobject-introspection-devel cairo-devel cairo-gobject-devel pango-devel webkitgtk3 +Official releases of Podium can be downloaded from the `GitHub releases page +`__. -Then, you can create a virtual environment and run the following to install -Toga and Podium:: +Download the binary for your platform of choice, and run it. This should open a +file dialog, prompting you to open a ``.podium`` slide deck. An example Podium +slide deck is also available in the releases folder. Unzip the deck, and open +it in Podium. - $ mkdir beeware - $ cd beeware - $ python3 -m venv venv - $ source venv/bin/activate - (venv) $ git clone https://github.com/beeware/toga.git - (venv) $ pip install toga/src/core - # In the next line, replace with: - # * cocoa if you're on macOS - # * gtk if you're on Linux - (venv) $ pip install toga/src/ - (venv) $ git clone https://github.com/beeware/podium.git +.. note:: -Now that you have the code, you can run Podium. + The Linux AppImage format is a cross-platform binary that should run on + any Linux distribution using GLibC 2.23 or later - this includes Ubuntu + 16.04 and later, Fedora 24 and later, and others. - (venv) $ cd podium/src - (venv) $ python -m podium ../example/example.podium + After downloading the AppImage, you may need to mark the AppImage file as + executable (``chmod +x Podium-*.AppImage``) first. In Linux, ``.podium`` + files appear as directories; select the directory and click ``Open``. -This will open a sample slide deck. You should 2 GUI windows, displaying a test -pattern as the first slide. Controls from here are keyboard based: +Controls from here are keyboard based: * CMD-P - Enter presentation mode; or, if in presentation mode, Pause timer * Esc - Exit presentation mode @@ -133,27 +103,57 @@ pattern as the first slide. Controls from here are keyboard based: If you're on Linux, "CMD" is the Control key. -Packaging with Briefcase ------------------------- +Developing Podium +----------------- -**NOTE: These instruction won't work until Podium can use a released -version of Toga** +Podium uses the `BeeWare `__ suite of tools and libraries - +most notably, the `Toga `__ widget toolkit, and +the `Briefcase `__ packaging tool. -Use `Briefcase`_ to package this repository as a standalone application. -Install briefcase using `pip install briefcase`, then: +To develop Podium, create a virtual environment, and install the BeeWare tools. -* **macOS** Run:: +If you're using Linux, you'll need to install some system packages first:: + + # Ubuntu/Debian + $ sudo apt-get update + $ sudo apt-get install python3-dev libgirepository1.0-dev libcairo2-dev libpango1.0-dev libwebkitgtk-3.0-0 gir1.2-webkit-3.0 + + # Fedora + $ sudo dnf install pkg-config python3-devel gobject-introspection-devel cairo-devel cairo-gobject-devel pango-devel webkitgtk3 + +Then, you can create a virtual environment and install the BeeWare tools:: + + $ mkdir beeware + $ cd beeware + $ python3 -m venv venv + $ source venv/bin/activate + (venv) $ pip install --pre beeware + +Now that you have the code, you can clone the Podium repository and run it in +developer mode. + + (venv) $ git clone https://github.com/beeware/podium.git + (venv) $ cd podium + (venv) $ briefcase dev + +This should open the same file dialog as before. + +Packaging with Briefcase +~~~~~~~~~~~~~~~~~~~~~~~~ - $ python setup.py macos - $ open macOS/Podium.app +Use `Briefcase`_ to package this repository as a standalone application:: - This app file can also be copied into your Applications folder. + $ briefcase package -* **Linux** Run:: +Depending on your platform, this will produce a ``macOS`` folder containing +a Podium DMG file, or a ``linux`` folder containing a ``.AppImage`` file. - $ python setup.py linux - $ ./linux/Podium +.. note:: + Packaging cross-distribution Linux binaries is a complex process; See `the + notes on AppImage packaging + `__ + in the Briefcase documentation for more details. Overriding Default themes -------------------------