Skip to content

Commit

Permalink
Make backends use src subdirectories
Browse files Browse the repository at this point in the history
  • Loading branch information
mhsmith committed Oct 18, 2022
1 parent 0a4dff2 commit 0d3c0f2
Show file tree
Hide file tree
Showing 273 changed files with 76 additions and 112 deletions.
93 changes: 46 additions & 47 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,50 +77,49 @@ jobs:
flags: unittests
fail_ci_if_error: true

# FIXME
# backend:
# needs: beefore
# strategy:
# matrix:
# backend: [android, cocoa, gtk, iOS, web, winforms]
# include:
# - runs-on: ubuntu-latest
# - python-version: "3.7" # Should be env.min_python_version (https://github.com/actions/runner/issues/480)
# - pre-command:
# - test-command: pytest
# - backend: cocoa
# runs-on: macos-latest
# - backend: gtk
# pre-command: "sudo apt-get update -y && sudo apt-get install -y python3-gi python3-gi-cairo gir1.2-gtk-3.0 python3-dev libgirepository1.0-dev libcairo2-dev pkg-config"
# test-command: "xvfb-run -a -s '-screen 0 2048x1536x24' pytest"
# - backend: iOS
# runs-on: macos-latest
# - backend: winforms
# runs-on: windows-latest
# # Py3.9 is the first Python version for which
# # a wheel of pythonnet isn't available on PyPI.
# python-version: "3.9"
# runs-on: ${{ matrix.runs-on }}
# steps:
# - uses: actions/checkout@v1
# - name: Set up Python ${{ matrix.python-version }}
# uses: actions/[email protected]
# with:
# # Py3.9 is the first Python version for which
# # a wheel of pythonnet isn't available on PyPI.
# python-version: ${{ matrix.python-version }}
# - name: Get packages
# uses: actions/download-artifact@v3
# with:
# name: packages
# - name: Install dependencies
# run: |
# ${{ matrix.pre-command }}
# python -m pip install --upgrade pip
# python -m pip install --upgrade setuptools
# python -m pip install pytest-tldr
# python -m pip install src/{core,dummy,${{ matrix.backend }}}/dist/*.whl
# - name: Test
# run: |
# cd src/${{ matrix.backend }}
# ${{ matrix.test-command }}
backend:
needs: beefore
strategy:
matrix:
backend: [android, cocoa, gtk, iOS, web, winforms]
include:
- runs-on: ubuntu-latest
- python-version: "3.7" # Should be env.min_python_version (https://github.com/actions/runner/issues/480)
- pre-command:
- test-command: pytest
- backend: cocoa
runs-on: macos-latest
- backend: gtk
pre-command: "sudo apt-get update -y && sudo apt-get install -y python3-gi python3-gi-cairo gir1.2-gtk-3.0 python3-dev libgirepository1.0-dev libcairo2-dev pkg-config"
test-command: "xvfb-run -a -s '-screen 0 2048x1536x24' pytest"
- backend: iOS
runs-on: macos-latest
- backend: winforms
runs-on: windows-latest
# Py3.9 is the first Python version for which
# a wheel of pythonnet isn't available on PyPI.
python-version: "3.9"
runs-on: ${{ matrix.runs-on }}
steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/[email protected]
with:
# Py3.9 is the first Python version for which
# a wheel of pythonnet isn't available on PyPI.
python-version: ${{ matrix.python-version }}
- name: Get packages
uses: actions/download-artifact@v3
with:
name: packages
- name: Install dependencies
run: |
${{ matrix.pre-command }}
python -m pip install --upgrade pip
python -m pip install --upgrade setuptools
python -m pip install pytest-tldr
python -m pip install src/{core,dummy,${{ matrix.backend }}}/dist/*.whl
- name: Test
run: |
cd src/${{ matrix.backend }}
${{ matrix.test-command }}
12 changes: 9 additions & 3 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,15 @@ recursive-include examples *.css
recursive-include examples *.html
recursive-include examples README
prune examples/*/.vscode
prune examples/*/android
prune examples/*/cocoa
prune examples/*/gtk
prune examples/*/iOS
prune examples/*/web
prune examples/*/winforms

include src/winforms/toga_winforms/libs/WebView2/LICENSE.md
include src/winforms/toga_winforms/libs/WebView2/README.md
include src/winforms/src/toga_winforms/libs/WebView2/LICENSE.md
include src/winforms/src/toga_winforms/libs/WebView2/README.md
recursive-include src *.css
recursive-include src *.html
recursive-include src *.icns
Expand All @@ -52,7 +58,7 @@ recursive-include src *.rst
recursive-include src CONTRIBUTING.md
recursive-include src LICENSE
recursive-include src MANIFEST.in
recursive-include src/winforms/toga_winforms/libs/WebView2 *.dll
recursive-include src/winforms/src/toga_winforms/libs/WebView2 *.dll
prune src/*/build
prune src/*/.eggs

Expand Down
2 changes: 1 addition & 1 deletion release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ function install {
}


MODULES="core dummy" # FIXME android cocoa core dummy gtk iOS web winforms toga demo
MODULES="android cocoa core dummy gtk iOS web winforms toga demo"

action=$1
shift
Expand Down
1 change: 0 additions & 1 deletion src/android/MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@ include CONTRIBUTING.md
include LICENSE
include README.rst
recursive-include tests *.py
recursive-include toga_android *.py
8 changes: 2 additions & 6 deletions src/android/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,11 @@ keywords =
android

[options]
packages = find:
package_dir =
= src
python_requires = >= 3.6
zip_safe = False

[options.packages.find]
include =
toga_android
toga_android.*

[flake8]
exclude=\
.eggs/*,\
Expand Down
2 changes: 1 addition & 1 deletion src/android/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# Version handline needs to be programatic because
# we can't import toga_android to compute the version;
# and to support versioned subpackage dependencies
with open('toga_android/__init__.py', encoding='utf8') as version_file:
with open('src/toga_android/__init__.py', encoding='utf8') as version_file:
version_match = re.search(
r"^__version__ = ['\"]([^'\"]*)['\"]",
version_file.read(),
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion src/cocoa/MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@ include CONTRIBUTING.md
include LICENSE
include README.rst
recursive-include tests *.py
recursive-include toga_cocoa *.py
8 changes: 2 additions & 6 deletions src/cocoa/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,11 @@ keywords =
cocoa

[options]
packages = find:
package_dir =
= src
python_requires = >= 3.6
zip_safe = False

[options.packages.find]
include =
toga_cocoa
toga_cocoa.*

[flake8]
exclude=\
.eggs/*,\
Expand Down
2 changes: 1 addition & 1 deletion src/cocoa/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# Version handline needs to be programatic because
# we can't import toga_cocoa to compute the version;
# and to support versioned subpackage dependencies
with open('toga_cocoa/__init__.py', encoding='utf8') as version_file:
with open('src/toga_cocoa/__init__.py', encoding='utf8') as version_file:
version_match = re.search(
r"^__version__ = ['\"]([^'\"]*)['\"]",
version_file.read(),
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion src/gtk/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
include CONTRIBUTING.md
include LICENSE
include README.rst
recursive-include toga_gtk *.py
recursive-include tests *.py
8 changes: 2 additions & 6 deletions src/gtk/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,11 @@ keywords =
gtk

[options]
packages = find:
package_dir =
= src
python_requires = >= 3.6
zip_safe = False

[options.packages.find]
include =
toga_gtk
toga_gtk.*

[flake8]
exclude=\
.eggs/*,\
Expand Down
2 changes: 1 addition & 1 deletion src/gtk/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# Version handline needs to be programatic because
# we can't import toga_gtk to compute the version;
# and to support versioned subpackage dependencies
with open('toga_gtk/__init__.py', encoding='utf8') as version_file:
with open('src/toga_gtk/__init__.py', encoding='utf8') as version_file:
version_match = re.search(
r"^__version__ = ['\"]([^'\"]*)['\"]",
version_file.read(),
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion src/iOS/MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@ include CONTRIBUTING.md
include LICENSE
include README.rst
recursive-include tests *.py
recursive-include toga_iOS *.py
8 changes: 2 additions & 6 deletions src/iOS/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,11 @@ keywords =
iOS

[options]
packages = find:
package_dir =
= src
python_requires = >= 3.6
zip_safe = False

[options.packages.find]
include =
toga_iOS
toga_iOS.*

[flake8]
exclude=\
.eggs/*,\
Expand Down
2 changes: 1 addition & 1 deletion src/iOS/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# Version handline needs to be programatic because
# we can't import toga_iOS to compute the version;
# and to support versioned subpackage dependencies
with open('toga_iOS/__init__.py', encoding='utf8') as version_file:
with open('src/toga_iOS/__init__.py', encoding='utf8') as version_file:
version_match = re.search(
r"^__version__ = ['\"]([^'\"]*)['\"]",
version_file.read(),
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 0 additions & 2 deletions src/web/MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,3 @@ include CONTRIBUTING.md
include LICENSE
include README.rst
recursive-include tests *.py
recursive-include toga_web *.py
recursive-include toga_web/static *.css
11 changes: 3 additions & 8 deletions src/web/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,14 @@ keywords =
web

[options]
packages = find:
package_dir =
= src
python_requires = >= 3.6
zip_safe = False
include_package_data = True

[options.package_data]
toga_web =
toga_web/static/toga.css

[options.packages.find]
include =
toga_web
toga_web.*
static/**

[flake8]
exclude=\
Expand Down
2 changes: 1 addition & 1 deletion src/web/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# Version handline needs to be programatic because
# we can't import toga_web to compute the version;
# and to support versioned subpackage dependencies
with open('toga_web/__init__.py', encoding='utf8') as version_file:
with open('src/toga_web/__init__.py', encoding='utf8') as version_file:
version_match = re.search(
r"^__version__ = ['\"]([^'\"]*)['\"]",
version_file.read(),
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 0 additions & 4 deletions src/winforms/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
include CONTRIBUTING.md
include LICENSE
include README.rst
include toga_winforms/libs/WebView2/LICENSE.md
include toga_winforms/libs/WebView2/README.md
recursive-include toga_winforms *.py
recursive-include tests *.py
recursive-include toga_winforms/libs/WebView2 *.dll
16 changes: 3 additions & 13 deletions src/winforms/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -39,24 +39,14 @@ keywords =
winforms

[options]
packages = find:
package_dir =
= src
python_requires = >= 3.6
zip_safe = False
include_package_data = True

[options.package_data]
toga_winforms =
toga_winforms/libs/WebView2/LICENSE.md
toga_winforms/libs/WebView2/Microsoft.Web.WebView2.Core.dll
toga_winforms/libs/WebView2/Microsoft.Web.WebView2.WinForms.dll
toga_winforms/libs/WebView2/arm64/WebView2Loader.dll
toga_winforms/libs/WebView2/x64/WebView2Loader.dll
toga_winforms/libs/WebView2/x86/WebView2Loader.dll

[options.packages.find]
include =
toga_winforms
toga_winforms.*
libs/WebView2/**

[flake8]
exclude=\
Expand Down
2 changes: 1 addition & 1 deletion src/winforms/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# Version handline needs to be programatic because
# we can't import toga_winforms to compute the version;
# and to support versioned subpackage dependencies
with open('toga_winforms/__init__.py', encoding='utf8') as version_file:
with open('src/toga_winforms/__init__.py', encoding='utf8') as version_file:
version_match = re.search(
r"^__version__ = ['\"]([^'\"]*)['\"]",
version_file.read(),
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 0d3c0f2

Please sign in to comment.