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

Update build machinery to support Python 3.8 and PySide 6 #477

Merged
merged 37 commits into from
Aug 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
29ee39e
Add a minimal pyproject.toml
mdickinson Aug 11, 2022
1aa0c5a
Update etstool.py to support builds on Python 3.8
mdickinson Aug 11, 2022
ef859a7
Consistency fixes
mdickinson Aug 11, 2022
cbaf353
Fix syntax in test-with-edm.yml; add caching
mdickinson Aug 11, 2022
88dbe21
Fix setup-python version
mdickinson Aug 11, 2022
660969c
Fix path to requirements file
mdickinson Aug 11, 2022
3bba383
Remove 'edm run' wrappers
mdickinson Aug 11, 2022
9188c84
Exclude Python 3.8 / PyQt5 combination
mdickinson Aug 11, 2022
c1c4a70
Add the enthought/lgpl repository
mdickinson Aug 11, 2022
a639015
Syntax fix
mdickinson Aug 11, 2022
4e19fc3
Use a config file to specify egg repositories
mdickinson Aug 11, 2022
0be578f
Run flake8 in the correct environment
mdickinson Aug 11, 2022
241e0e0
Don't install pyside2 via pip
mdickinson Aug 11, 2022
464c0f6
Temporary change: enable logging to get more information from Pyface …
mdickinson Aug 11, 2022
dc5490e
Use qt rather than qt4 for ETS_TOOLKIT
mdickinson Aug 11, 2022
af9c35f
Another attempt to find out why Pyface is having toolkit issues
mdickinson Aug 11, 2022
096dcf1
While debugging, restrict to running just one workflow
mdickinson Aug 11, 2022
242f976
Trying another approach
mdickinson Aug 11, 2022
9cd811f
Add missing library
mdickinson Aug 11, 2022
3cf825c
Restore all runs
mdickinson Aug 11, 2022
021a13e
More workflow updates
mdickinson Aug 11, 2022
ef9ea45
Remove debugging code
mdickinson Aug 11, 2022
db50c7e
More workflow cleanup; update test-with-pypi
mdickinson Aug 11, 2022
620a5a5
Skip a problematic IPython test on Windows / Python 3.8
mdickinson Aug 11, 2022
a97efbe
Fix matrix in test-with-pypi
mdickinson Aug 11, 2022
4ec3c9e
Remove space that might be confusing pip
mdickinson Aug 11, 2022
4c0b644
Skip segfaulting test case on Linux / Python 3.8
mdickinson Aug 11, 2022
c4a0a5b
Fix syntax
mdickinson Aug 11, 2022
cd155e6
Cosmetic and consistency fixes
mdickinson Aug 11, 2022
69ee584
Fix missing install step
mdickinson Aug 11, 2022
6e9b25f
Switch to Ubuntu 20.04 and drop the <4.1 requirement, to see if we ha…
mdickinson Aug 11, 2022
85499a4
Be consistent about always using python to invoke pip
mdickinson Aug 11, 2022
e35674f
Drive-by .gitignore cleanup
mdickinson Aug 11, 2022
31551c8
Fix long lines
mdickinson Aug 11, 2022
6e0fb63
Merge remote-tracking branch 'origin/main' into add-pyproject-toml
mdickinson Aug 11, 2022
1d54b09
Remove Python 3.6 from wx workflow - the wxPython install fails on Py…
mdickinson Aug 11, 2022
2ee7307
Add missing 3.11 classifier
mdickinson Aug 12, 2022
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
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/release_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ Release candidate
- [ ] Create a PR against ``main`` to bump version number, merge that PR
- [ ] From the commit just before bumping the version, create a new branch `maint/<release version number>`
- [ ] Update changelog and open PR targeting a new `maint/<release version number>` branch
- [ ] Update `ci-src-requirements.txt` if needed
- [ ] Check MANIFEST and requirements are still up to date.
- [ ] Update version in setup.py for the prerelease, open 2 PRs against `maint/<release version number>`
- [ ] Create a new branch from `maint/<release version number>`: `git checkout maint/<release version number>`; `git pull`; `git checkout -b call-it-anything-you-like`
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/bootstrap-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
click
36 changes: 26 additions & 10 deletions .github/workflows/ets-from-source.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
- cron: '0 0 * * 5'

env:
INSTALL_EDM_VERSION: 3.2.3
INSTALL_EDM_VERSION: 3.3.1
QT_MAC_WANTS_LAYER: 1

jobs:
Expand All @@ -17,11 +17,21 @@ jobs:
test-with-edm:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
toolkit: ['null', 'pyqt5', 'pyside2']
os: ['ubuntu-latest', 'macos-latest', 'windows-latest']
runtime: ['3.6', '3.8']
toolkit: ['null', 'pyqt5', 'pyside2', 'pyside6']
exclude:
- runtime: '3.6'
toolkit: 'pyside6'
- runtime: '3.8'
toolkit: 'pyside2'
- runtime: '3.8'
toolkit: 'pyqt5'

runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Clone the Envisage source
uses: actions/checkout@v3
- name: Install Qt dependencies for Linux
run: |
sudo apt-get update
Expand All @@ -35,25 +45,31 @@ jobs:
sudo apt-get install libxcb-xinerama0
sudo apt-get install pulseaudio
sudo apt-get install libpulse-mainloop-glib0
shell: bash
sudo apt-get install libopengl0
if: runner.os == 'Linux'
- name: Cache EDM packages
uses: actions/cache@v2
with:
path: ~/.cache
key: ${{ runner.os }}-${{ matrix.toolkit }}-${{ hashFiles('etstool.py') }}
key: ${{ runner.os }}-${{ matrix.runtime }}-${{ matrix.toolkit }}-${{ hashFiles('etstool.py') }}
- name: Set up EDM
uses: enthought/setup-edm-action@v1
with:
edm-version: ${{ env.INSTALL_EDM_VERSION }}
- name: Install click to the default EDM environment
run: edm install -y wheel click coverage
- name: Set up bootstrap Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
cache: 'pip'
cache-dependency-path: '.github/workflows/bootstrap-requirements.txt'
- name: Install click to the bootstrap environment
run: python -m pip install -r .github/workflows/bootstrap-requirements.txt
- name: Install test environment
run: edm run -- python etstool.py install --toolkit=${{ matrix.toolkit }} --source
run: python etstool.py install --runtime=${{ matrix.runtime }} --toolkit=${{ matrix.toolkit }} --source
- name: Run tests
uses: GabrielBB/xvfb-action@v1
with:
run: edm run -- python etstool.py test --toolkit=${{ matrix.toolkit }}
run: python etstool.py test --runtime=${{ matrix.runtime }} --toolkit=${{ matrix.toolkit }}

notify-on-failure:
needs: test-with-edm
Expand Down
40 changes: 28 additions & 12 deletions .github/workflows/test-with-edm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

name: Test with EDM

on: pull_request
on: [pull_request, workflow_dispatch]

env:
INSTALL_EDM_VERSION: 3.2.3
INSTALL_EDM_VERSION: 3.3.1
QT_MAC_WANTS_LAYER: 1

jobs:
Expand All @@ -16,11 +16,21 @@ jobs:
test-with-edm:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
toolkit: ['null', 'pyqt5', 'pyside2']
os: ['ubuntu-latest', 'macos-latest', 'windows-latest']
runtime: ['3.6', '3.8']
toolkit: ['null', 'pyqt5', 'pyside2', 'pyside6']
exclude:
- runtime: '3.6'
toolkit: 'pyside6'
- runtime: '3.8'
toolkit: 'pyside2'
- runtime: '3.8'
toolkit: 'pyqt5'

runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Clone the Envisage source
uses: actions/checkout@v3
- name: Install Qt dependencies for Linux
run: |
sudo apt-get update
Expand All @@ -34,25 +44,31 @@ jobs:
sudo apt-get install libxcb-xinerama0
sudo apt-get install pulseaudio
sudo apt-get install libpulse-mainloop-glib0
shell: bash
sudo apt-get install libopengl0
if: runner.os == 'Linux'
- name: Cache EDM packages
uses: actions/cache@v2
with:
path: ~/.cache
key: ${{ runner.os }}-${{ matrix.toolkit }}-${{ hashFiles('etstool.py') }}
key: ${{ runner.os }}-${{ matrix.runtime }}-${{ matrix.toolkit }}-${{ hashFiles('etstool.py') }}
- name: Set up EDM
uses: enthought/setup-edm-action@v1
with:
edm-version: ${{ env.INSTALL_EDM_VERSION }}
- name: Install click to the default EDM environment
run: edm install -y wheel click coverage
- name: Set up bootstrap Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
cache: 'pip'
cache-dependency-path: '.github/workflows/bootstrap-requirements.txt'
- name: Install click to the bootstrap environment
run: python -m pip install -r .github/workflows/bootstrap-requirements.txt
- name: Install test environment
run: edm run -- python etstool.py install --toolkit=${{ matrix.toolkit }}
run: python etstool.py install --runtime=${{ matrix.runtime }} --toolkit=${{ matrix.toolkit }}
- name: Flake8
run: edm run -- python etstool.py flake8
run: python etstool.py flake8 --runtime=${{ matrix.runtime }} --toolkit=${{ matrix.toolkit }}
if: runner.os == 'Linux' && matrix.toolkit == 'null'
- name: Run tests
uses: GabrielBB/xvfb-action@v1
with:
run: edm run -- python etstool.py test --toolkit=${{ matrix.toolkit }}
run: python etstool.py test --runtime=${{ matrix.runtime }} --toolkit=${{ matrix.toolkit }}
29 changes: 15 additions & 14 deletions .github/workflows/test-with-pypi.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Test with PyPI

on: pull_request
on: [pull_request, workflow_dispatch]

env:
PYTHONUNBUFFERED: 1
Expand All @@ -10,15 +10,23 @@ jobs:

# Test against PyPI packages
test-with-pypi:

strategy:
matrix:
os: [ubuntu-latest]
python-version: [3.6, 3.8, 3.9]
os: ['ubuntu-latest']
python-version: ['3.6', '3.8', '3.10']
toolkit: ['pyside2', 'pyside6']
exclude:
- python-version: '3.6'
toolkit: 'pyside6'
- python-version: '3.8'
toolkit: 'pyside2'
- python-version: '3.10'
toolkit: 'pyside2'

runs-on: ${{ matrix.os }}

steps:
- name: Clone the Envisage source
uses: actions/checkout@v3
- name: Install Qt dependencies for Linux
run: |
sudo apt-get update
Expand All @@ -31,19 +39,12 @@ jobs:
sudo apt-get install libxcb-render-util0
sudo apt-get install libxcb-xinerama0
if: runner.os == 'Linux'
- name: Check out the target commit
uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Update necessary Python packages
run: |
pip install --upgrade pip setuptools wheel
- name: Install package and dependencies
run: |
pip install pyside2
pip install .[ipython]
run: python -m pip install .[${{ matrix.toolkit }},ipython]
- name: Run tests
uses: GabrielBB/xvfb-action@v1
with:
Expand Down
27 changes: 18 additions & 9 deletions .github/workflows/test-wx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,42 +8,51 @@ on:
- cron: '0 0 * * 5'

env:
INSTALL_EDM_VERSION: 3.2.3
INSTALL_EDM_VERSION: 3.3.1

jobs:

# Test against EDM packages
test-with-edm:
strategy:
matrix:
os: [ubuntu-18.04]
os: ['ubuntu-20.04']
runtime: ['3.8']
toolkit: ['wx']

runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Clone the Envisage source
uses: actions/checkout@v3
- name: Install Wx dependencies for Linux
run: |
sudo apt-get update
sudo apt-get install libsdl-image1.2
sudo apt-get install libsdl2-2.0-0
shell: bash
if: runner.os == 'Linux'
- name: Cache EDM packages
uses: actions/cache@v2
with:
path: ~/.cache
key: ${{ runner.os }}-${{ matrix.toolkit }}-${{ hashFiles('etstool.py') }}
key: ${{ runner.os }}-${{ matrix.runtime }}-${{ matrix.toolkit }}-${{ hashFiles('etstool.py') }}
- name: Set up EDM
uses: enthought/setup-edm-action@v1
with:
edm-version: ${{ env.INSTALL_EDM_VERSION }}
- name: Install click to the default EDM environment
run: edm install -y wheel click coverage
- name: Set up bootstrap Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
cache: 'pip'
cache-dependency-path: '.github/workflows/bootstrap-requirements.txt'
- name: Install click to the bootstrap environment
run: python -m pip install -r .github/workflows/bootstrap-requirements.txt
- name: Install test environment
run: edm run -- python etstool.py install --toolkit=${{ matrix.toolkit }}
run: python etstool.py install --runtime=${{ matrix.runtime }} --toolkit=${{ matrix.toolkit }}
- name: Run tests
uses: GabrielBB/xvfb-action@v1
with:
run: edm run -- python etstool.py test --toolkit=${{ matrix.toolkit }}
run: python etstool.py test --runtime=${{ matrix.runtime }} --toolkit=${{ matrix.toolkit }}

notify-on-failure:
needs: test-with-edm
Expand Down
6 changes: 1 addition & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
# file types to ignore
*.pyc
*.pyd
*.so
*~
.DS_Store

# ignore the build directories
*.egg-info/
build/
dist/
/dist/
/docs/build/
/docs/source/api/*.rst
!/docs/source/api/envisage.api.rst
Expand Down
Empty file removed ci-src-requirements.txt
Empty file.
6 changes: 6 additions & 0 deletions edm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Change this if you are using on-premise brood
store_url: "https://packages.enthought.com"

repositories:
- enthought/free
- enthought/lgpl
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,10 @@ def test_zmq_sockets_closed(self):
sockets = self.objects_of_type(zmq.Socket)
self.assertTrue(all(socket.closed for socket in sockets))

@unittest.skipIf(
sys.platform == "win32" and sys.version_info[:2] == (3, 8),
"xref: enthought/envisage#463"
)
def test_ipykernel_live_objects(self):
# Check that all IPython-related objects have been cleaned up
# as expected.
Expand Down
16 changes: 7 additions & 9 deletions envisage/ui/tasks/tests/test_tasks_application.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@
# Thanks for using Enthought open source!

import os
import pickle
import shutil
import sys
import tempfile
import unittest

import pkg_resources
from pyface.i_gui import IGUI
from traits.api import HasTraits, provides

from envisage.ui.tasks.api import TasksApplication
from envisage.ui.tasks.tasks_application import DEFAULT_STATE_FILENAME
from pyface.i_gui import IGUI
from traits.api import HasTraits, provides

requires_gui = unittest.skipIf(
os.environ.get("ETS_TOOLKIT", "none") in {"null", "none"},
Expand All @@ -32,15 +32,16 @@ class DummyGUI(HasTraits):
pass


@unittest.skipIf(
sys.platform == "linux" and sys.version_info >= (3, 8),
"xref: enthought/envisage#476",
)
@requires_gui
class TestTasksApplication(unittest.TestCase):
def setUp(self):
self.tmpdir = tempfile.mkdtemp()
self.addCleanup(shutil.rmtree, self.tmpdir)

@unittest.skipUnless(
Copy link
Member Author

Choose a reason for hiding this comment

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

Drive-by cleanup; this skip condition could only be triggered under Python 2.

3 <= pickle.HIGHEST_PROTOCOL, "Test uses pickle protocol 3"
)
def test_layout_save_with_protocol_3(self):
# Test that the protocol can be overridden on a per-application basis.
state_location = self.tmpdir
Expand Down Expand Up @@ -82,9 +83,6 @@ def test_layout_load(self):
state = app._state
self.assertEqual(state.previous_window_layouts[0].size, (492, 743))

@unittest.skipUnless(
3 <= pickle.HIGHEST_PROTOCOL, "Test uses pickle protocol 3"
)
def test_layout_load_pickle_protocol_3(self):
# Same as the above test, but using a state stored with pickle
# protocol 3.
Expand Down
Loading