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

Restructure repository #1669

Merged
merged 16 commits into from
Nov 9, 2022
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
24 changes: 14 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,24 @@ jobs:
- run: tox -e towncrier-check

package:
strategy:
matrix:
subdir: ["android", "cocoa", "core", "demo", "dummy", "gtk", "iOS", "toga",
"web", "winforms"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4.3.0
with:
python-version: ${{ env.min_python_version }}
- run: pip install tox
- run: tox -e package
- run: tox -e package -- ${{ matrix.subdir }}
freakboy3742 marked this conversation as resolved.
Show resolved Hide resolved
- uses: actions/upload-artifact@v3
with:
name: packages
path: dist
# There will only be one dist directory for each matrix sub-job, but using a
# leading wildcard preserves the directory structure.
path: "*/dist/*"
if-no-files-found: error

core:
Expand All @@ -76,14 +82,13 @@ jobs:
uses: actions/download-artifact@v3
with:
name: packages
path: dist
- name: Test
env:
TOGA_INSTALL_COMMAND: 'bash -c "pip install ../../dist/toga_{core,dummy}*.whl"'
TOGA_INSTALL_COMMAND: 'bash -c "pip install ../{core,dummy}/dist/*.whl"'
run: |
cd src/core
cd core
tox -e py
mv .coverage.* ../..
mv .coverage.* ..
- name: Store coverage data
uses: actions/upload-artifact@v3
with:
Expand Down Expand Up @@ -178,18 +183,17 @@ jobs:
uses: actions/download-artifact@v3
with:
name: packages
path: dist
- name: Install dependencies
run: |
${{ matrix.pre-command }}
python -m pip install tox coverage[toml]
- name: Test
env:
TOGA_INSTALL_COMMAND: 'bash -c "pip install ../../dist/toga_{core,dummy,${{ matrix.backend }}}*.whl"'
TOGA_INSTALL_COMMAND: 'bash -c "pip install ../{core,dummy,${{ matrix.backend }}}/dist/*.whl"'
run: |
cd src/${{ matrix.backend }}
cd ${{ matrix.backend }}
tox -e py
mv .coverage.* ../../
mv .coverage.* ..
- name: Store coverage data
uses: actions/upload-artifact@v3
with:
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,11 @@ jobs:
uses: actions/download-artifact@v3
with:
name: packages
path: packages
- uses: ncipollo/release-action@v1.11.1
with:
name: ${{ env.VERSION }}
draft: true
artifacts: "packages/*"
artifacts: "*/dist/*"
artifactErrorsFailBuild: true

deploy-test:
Expand All @@ -43,11 +42,10 @@ jobs:
uses: actions/download-artifact@v3
with:
name: packages
path: packages
- name: Extract ${{ matrix.package }}
run: |
mkdir dist
mv packages/$(echo ${{ matrix.package }} | sed 's/_/?/')-[0-9]* dist
mv */dist/$(echo ${{ matrix.package }} | sed 's/_/?/')-[0-9]* dist
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there might be an analogous change missing from publish.rst?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After discussion in person, turns out this isn't an issue on publish, because in the publish action, the artefact is coming from the GitHub Release, rather than the CI artefact,

- name: Publish to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
Expand Down
10 changes: 3 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ local
Pipfile*
.tox
node_modules
src/gtk/gi
src/gtk/pygtkcompat
src/gtk/cairo
gtk/gi
gtk/pygtkcompat
gtk/cairo
.DS_Store
pip-selfcheck.json
pyvenv.cfg
Expand All @@ -38,10 +38,6 @@ examples/*/django/
examples/*/windows/
examples/*/web/

src/*/.tox
src/*/.coverage
src/*/.coverage.*
Comment on lines -41 to -43
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These 3 patterns are already listed above without any directory, so they don't need to be listed per-directory as well.


# Memory Profiler
mprofile_*.dat

Expand Down
24 changes: 24 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the version of Python and other tools you might need
build:
os: ubuntu-20.04
tools:
python: "3.9"

# Build documentation in the docs/ directory with Sphinx
sphinx:
builder: html
configuration: docs/conf.py

# Optionally declare the Python requirements required to build your docs
python:
install:
- requirements: docs/requirements.txt
- method: pip
path: core
88 changes: 0 additions & 88 deletions MANIFEST.in

This file was deleted.

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: 1 addition & 0 deletions changes/1669.misc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Moved all packages to be top-level directories in the repository.
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.
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.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
9 changes: 4 additions & 5 deletions demo/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,13 @@ This will pop up a GUI window.
If you have cloned the toga repository, install the dependent packages in your virtualenv::

$ cd toga
$ pip install -e src/core
$ pip install -e src/dummy
$ pip install -e ./core

Then install the platform specific code::

$ pip install -e src/cocoa # macOS
$ pip install -e src/gtk # Linux
$ pip install -e src/winforms # Windows
$ pip install -e ./cocoa # macOS
$ pip install -e ./gtk # Linux
$ pip install -e ./winforms # Windows

Finally navigate to the demo directory and run the application::

Expand Down
4 changes: 2 additions & 2 deletions docs/background/architecture.rst
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,14 @@ An example

Here's how Toga's three-layer API works on the Button widget.

* ``toga.Button`` is defined in ``src/core/src/toga/widgets/button.py``. This
* ``toga.Button`` is defined in ``core/src/toga/widgets/button.py``. This
defines the public interface for the Button widget, describing (amongst other
things) that there is an ``on_click`` event handler on a Button. It expects
that there will be *an* implementation, but doesn't care which implementation
is provided.

* ``toga-gtk.widgets.Button`` is defined in
``src/gtk/toga-gtk/widgets/button.py``. This defines the Button at the
``gtk/src/toga-gtk/widgets/button.py``. This defines the Button at the
implementation layer. It describes how to create a button on GTK, and how to
connect the GTK ``clicked`` signal to the ``on_click`` Toga handler.

Expand Down
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path.insert(0, os.path.abspath("../src/core/src"))
# sys.path.insert(0, os.path.abspath("."))

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

Expand Down Expand Up @@ -54,7 +54,7 @@
# built documents.
#
# The full version, including alpha/beta/rc tags.
with open("../src/core/src/toga/__init__.py", encoding="utf8") as version_file:
with open("../core/src/toga/__init__.py", encoding="utf8") as version_file:
version_match = re.search(
r"^__version__ = ['\"]([^'\"]*)['\"]", version_file.read(), re.M
)
Expand Down
26 changes: 13 additions & 13 deletions docs/how-to/contribute-code.rst
Original file line number Diff line number Diff line change
Expand Up @@ -149,27 +149,27 @@ specific order:
.. code-block:: bash

(venv) $ cd toga
(venv) $ pip install -e src/core
(venv) $ pip install -e src/dummy
(venv) $ pip install -e src/cocoa
(venv) $ pip install -e ./core
(venv) $ pip install -e ./dummy
(venv) $ pip install -e ./cocoa

.. group-tab:: Linux

.. code-block:: bash

(venv) $ cd toga
(venv) $ pip install -e src/core
(venv) $ pip install -e src/dummy
(venv) $ pip install -e src/gtk
(venv) $ pip install -e ./core
(venv) $ pip install -e ./dummy
(venv) $ pip install -e ./gtk

.. group-tab:: Windows

.. code-block:: doscon

(venv) C:\...>cd toga
(venv) C:\...>pip install -e src/core
(venv) C:\...>pip install -e src/dummy
(venv) C:\...>pip install -e src/winforms
(venv) C:\...>pip install -e ./core
(venv) C:\...>pip install -e ./dummy
(venv) C:\...>pip install -e ./winforms

This project uses a tool called `Pre-Commit <https://pre-commit.com>`__ to identify
simple issues and standardize code formatting. It does this by installing a git
Expand Down Expand Up @@ -362,7 +362,7 @@ Start by running the core test suite:

.. code-block:: bash

(venv) $ cd src/core
(venv) $ cd core
(venv) $ TOGA_BACKEND=toga_dummy python setup.py test
...
----------------------------------------------------------------------
Expand All @@ -374,7 +374,7 @@ Start by running the core test suite:

.. code-block:: bash

(venv) $ cd src/core
(venv) $ cd core
(venv) $ TOGA_BACKEND=toga_dummy python setup.py test
...
----------------------------------------------------------------------
Expand All @@ -386,7 +386,7 @@ Start by running the core test suite:

.. code-block:: doscon

(venv) C:\...>cd src/core
(venv) C:\...>cd core
(venv) C:\...>set TOGA_BACKEND=toga_dummy
(venv) C:\...>python setup.py test
(venv) C:\...>set TOGA_BACKEND=
Expand Down Expand Up @@ -482,7 +482,7 @@ line of ``toga/app.py`` was executed; but only 77% of lines in
the next column: lines 58, 75, 87, and so on weren't executed.

That's what you have to fix - ideally, every single line in every single file
will have 100% coverage. If you look in `src/core/tests`, you should find a
will have 100% coverage. If you look in `core/tests`, you should find a
test file that matches the name of the file that has insufficient coverage. If
you don't, it's possible the entire test file is missing - so you'll have to
create it!
Expand Down
16 changes: 0 additions & 16 deletions docs/mock_gtk/setup.py

This file was deleted.

Loading