Skip to content
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
11 changes: 11 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ jobs:
- name: Install dependencies
run: uv sync --group deployment

### CREATE LIST OF THIRD-PARTY LICENCES
- name: Create list of third-party licences
run: uv run python packaging/licenses/third_party_licenses.py

### INSTALL DEPENDENCY WALKER FOR NUITKA ON WINDOWS
- name: Download Dependency Walker for Nuitka
if: runner.os == 'Windows'
Expand All @@ -53,6 +57,9 @@ jobs:
- name: Build app
run: uv run pyside6-deploy --mode standalone --name groupselect2 app/main.py

- name: Copy resources
run: python -c "import shutil; shutil.copytree('app/resources', 'app/groupselect2.dist/resources')"

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
Expand Down Expand Up @@ -87,6 +94,10 @@ jobs:
Copy-Item -Recurse "app\groupselect2.dist\*" "$pkg\"
Copy-Item "packaging\windows\AppxManifest.xml" "$pkg\"
Copy-Item -Recurse "packaging\windows\assets" "$pkg\assets"
Copy-Item "packaging\licenses\PYTHON_LICENSE.txt" "$pkg\"
Copy-Item "THIRD_PARTY_LICENSES.txt" "$pkg\"
Copy-Item "packaging\licenses\PYSIDE6_LICENSES.txt" "$pkg\"
Copy-Item "packaging\licenses\QT_LIBRARY_REPLACEMENT.txt" "$pkg\"

- name: Build MSIX with makeappx
if: runner.os == 'Windows'
Expand Down
10 changes: 10 additions & 0 deletions app/main.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
#!/usr/bin/env python3
from pathlib import Path
import sys

from base_app.AppContext import AppContext

from GSProject import GSProject
from GSMainWindow import GSMainWindow
from GSModelManager import GSModelManager


if getattr(sys, "frozen", False):
RESOURCES_PATH: Path = Path(sys.executable).parent / "resources"
else:
RESOURCES_PATH: Path = Path(__file__).parent / "resources"


def main():
app_ctx = AppContext(
app_name='GroupSelect',
Expand All @@ -14,6 +23,7 @@ def main():
main_window_cls=GSMainWindow,
model_manager_cls=GSModelManager,
project_cls=GSProject,
about_html_template=(RESOURCES_PATH / "about.html").read_text(encoding="utf-8")
)
app_ctx.launch()

Expand Down
30 changes: 30 additions & 0 deletions app/resources/about.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<p><strong>{app_name} App by Sortition Foundation</strong></p>
<p>Version: {app_version}</p>
<p>
{app_name} is free and open source software, licensed under the
<a href="https://www.gnu.org/licenses/gpl-3.0.html">GNU General Public License v3</a>.
Source code is available at
<a href="https://github.com/sortitionfoundation/groupselect-app">github.com/sortitionfoundation/groupselect-app</a>.
</p>
<p>This software was created by Philipp C. Verpoort while an Associate at the
<a href="https://www.sortitionfoundation.org">Sortition Foundation</a>. The initial funding for the development was provided by the <a href="https://www.involve.org.uk/">Involve Foundation</a>.
</p>
<p>
This application is built with
<a href="https://www.qt.io/qt-for-python">PySide6</a> and Qt6, used under the
<a href="https://www.gnu.org/licenses/lgpl-3.0.html">GNU Lesser General Public License v3 (LGPLv3)</a>.
Third-party components used in Qt for Python are listed at
<a href="https://doc.qt.io/qtforpython-6/licenses.html">doc.qt.io/qtforpython-6/licenses.html</a>.
Qt library files included with this application may be replaced with
compatible modified versions; see <b>QT_LIBRARY_REPLACEMENT.txt</b> for details.
</p>
<p>
This application is built with
<a href="https://www.python.org">Python 3</a>, used under the
<a href="https://docs.python.org/3/license.html">Python Software Foundation License v2</a>.
</p>
<p>
Third-party Python package licence notices are listed in
<b>THIRD_PARTY_LICENSES.txt</b> and <b>PYSIDE6_LICENSES.txt</b>,
included with this application.
</p>
178 changes: 178 additions & 0 deletions packaging/licenses/PYSIDE6_LICENSES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
PySide6 and Qt6
===============
PySide6 is the official Python binding for Qt6, used under the
GNU Lesser General Public License version 3 (LGPLv3).

Copyright (C) The Qt Company Ltd.

The Qt source code is available at https://code.qt.io
Third-party components used in Qt for Python are listed at
https://doc.qt.io/qtforpython-6/licenses.html

---------------------- LGPLv3 ----------------------

GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007

Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.


This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.

0. Additional Definitions.

As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.

"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.

An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.

A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".

The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.

The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.

1. Exception to Section 3 of the GNU GPL.

You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.

2. Conveying Modified Versions.

If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:

a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or

b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.

3. Object Code Incorporating Material from Library Header Files.

The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:

a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.

b) Accompany the object code with a copy of the GNU GPL and this license
document.

4. Combined Works.

You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:

a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.

b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.

c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.

d) Do one of the following:

0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.

1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.

e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)

5. Combined Libraries.

You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:

a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.

b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.

6. Revised Versions of the GNU Lesser General Public License.

The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.

Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.

If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.
40 changes: 40 additions & 0 deletions packaging/licenses/PYTHON_LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
1. This LICENSE AGREEMENT is between the Python Software Foundation ("PSF"), and
the Individual or Organization ("Licensee") accessing and otherwise using this
software ("Python") in source or binary form and its associated documentation.

2. Subject to the terms and conditions of this License Agreement, PSF hereby
grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce,
analyze, test, perform and/or display publicly, prepare derivative works,
distribute, and otherwise use Python alone or in any derivative
version, provided, however, that PSF's License Agreement and PSF's notice of
copyright, i.e., "Copyright © 2001 Python Software Foundation; All Rights
Reserved" are retained in Python alone or in any derivative version
prepared by Licensee.

3. In the event Licensee prepares a derivative work that is based on or
incorporates Python or any part thereof, and wants to make the
derivative work available to others as provided herein, then Licensee hereby
agrees to include in any such work a brief summary of the changes made to Python.

4. PSF is making Python available to Licensee on an "AS IS" basis.
PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. BY WAY OF
EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND DISCLAIMS ANY REPRESENTATION OR
WARRANTY OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE
USE OF PYTHON WILL NOT INFRINGE ANY THIRD PARTY RIGHTS.

5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON
FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS A RESULT OF
MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON, OR ANY DERIVATIVE
THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.

6. This License Agreement will automatically terminate upon a material breach of
its terms and conditions.

7. Nothing in this License Agreement shall be deemed to create any relationship
of agency, partnership, or joint venture between PSF and Licensee. This License
Agreement does not grant permission to use PSF trademarks or trade name in a
trademark sense to endorse or promote products or services of Licensee, or any
third party.

8. By copying, installing or otherwise using Python, Licensee agrees
to be bound by the terms and conditions of this License Agreement.
15 changes: 15 additions & 0 deletions packaging/licenses/QT_LIBRARY_REPLACEMENT.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Qt Library Replacement Notice
==============================

This application uses Qt6 and PySide6, distributed as separate DLL files
in accordance with the GNU Lesser General Public License version 3 (LGPLv3).

In compliance with the LGPLv3, you are free to replace the Qt6 and PySide6
library files (qt6*.dll, pyside6.abi3.dll, shiboken6.abi3.dll, and files
in the PySide6/ subdirectory) with compatible modified versions of your
own, provided the modified libraries remain interface-compatible with the
originals.

The Qt source code is available at: https://code.qt.io
Build instructions for PySide6 are available at:
https://doc.qt.io/qtforpython-6/gettingstarted/index.html
32 changes: 32 additions & 0 deletions packaging/licenses/third_party_licenses.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import re
import subprocess


# Get runtime packages from uv export
export = subprocess.run(
["uv", "export", "--no-dev", "--no-hashes", "--format=requirements-txt"],
capture_output=True, text=True, check=True
)

all_packages = []
for line in export.stdout.splitlines():
line = line.strip()
if not line or line.startswith("#"):
continue
name = re.split(r'[@=><\s]', line)[0]
if name:
all_packages.append(name)

pyside_packages = [p for p in all_packages if p.lower().startswith("pyside6") or p.lower() == "shiboken6"]
other_packages = [p for p in all_packages if p not in pyside_packages]

subprocess.run(
[
"uv", "run", "pip-licenses",
"--with-authors", "--with-urls", "--with-license-file", "--no-license-path",
"--format=plain-vertical",
"--packages", *other_packages,
"--output-file=THIRD_PARTY_LICENSES.txt",
],
check=True
)
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ deployment = [
"ordered-set>=4.1.0",
"patchelf>=0.17.2.4; sys_platform == 'linux'",
"pip>=26.0.1",
"pip-licenses>=5.5.1",
"setuptools>=81.0.0",
"wheel>=0.46.3",
"zstandard>=0.25.0",
Expand Down
Loading