Skip to content

Port CI to gh actions#426

Merged
aaronayres35 merged 16 commits into
masterfrom
gh-actions
Jun 23, 2021
Merged

Port CI to gh actions#426
aaronayres35 merged 16 commits into
masterfrom
gh-actions

Conversation

@aaronayres35
Copy link
Copy Markdown
Contributor

part of #376 (can be closed when travis and appveyor are removed)

This PR adds two nearly identical work flows. One of which will run the test suite on every PR using packages from edm, the other which will run the test suite as a cron job using ets packages from source.

(see related PRs enthought/pyface#950 and enthought/apptools#288)

@aaronayres35
Copy link
Copy Markdown
Contributor Author

CI is failing with errors of the form:

RuntimeError: No pyface.toolkits plugin could be loaded for wx

@rahulporuri rahulporuri self-requested a review June 21, 2021 13:14
@aaronayres35
Copy link
Copy Markdown
Contributor Author

@rahulporuri Any chance you could look into the CI failure here? I am pretty stumped... 😕

@mdickinson
Copy link
Copy Markdown
Member

@aaronayres35 I don't see wxPython being installed into the test environment. Possibly a bug in etstool?

@mdickinson
Copy link
Copy Markdown
Member

Ah, etstool installs wxPython via pip, and I think it's installing for the wrong version of Ubuntu.

@mdickinson
Copy link
Copy Markdown
Member

For wx on Linux, the key line is this one:

"{edm} run -e {environment} -- pip install -f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-16.04/ wxPython<4.1" # noqa: E501

This installs a version of wxPython suitable for ubuntu-16.04, but the ubuntu-latest runner is (currently) using Ubuntu 20.04.

We'll likely need to fix the version of Ubuntu used in GitHub Actions (e.g., use ubuntu-18.04 instead of ubuntu-latest) and then update that line in etstool.py to match. We could also use ubuntu-20.04, but then there are only Python 3.8 downloads of wxPython available from https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-20.04/.

@mdickinson
Copy link
Copy Markdown
Member

One more thought: there's not a lot of value in testing on wxPython anyway: Envisage has no toolkit-specific code beyond the Qt console stuff for the IPython plugins. I'd be happy to drop wxPython testing altogether, or just leave a cron job that runs with one version of Python on one platform (e.g., Python 3.8 / Linux).

@aaronayres35
Copy link
Copy Markdown
Contributor Author

@mdickinson Thank you!

@mdickinson
Copy link
Copy Markdown
Member

mdickinson commented Jun 22, 2021

Be aware that the ubuntu-16.04 GitHub Actions runner is deprecated and will disappear within the next few months. (source: https://github.com/actions/virtual-environments)

Comment thread .github/workflows/ets-from-source.yml Outdated
@aaronayres35
Copy link
Copy Markdown
Contributor Author

I went back to using ubuntu-18.04 per the suggestion above. CI failed, but then on GH Actions, adding an install of libsdl-image1.2 solved the problem. Unfortunately, that same fix did not solve the problem for travis CI...

Given that as soon as this PR is merged I was planning to open a follow up PR to remove travis anyway, I think I am just going to kill travis now to avoid sinking more time into this

@mdickinson
Copy link
Copy Markdown
Member

I think I am just going to kill travis now to avoid sinking more time into this

That definitely sounds good to me!

@aaronayres35
Copy link
Copy Markdown
Contributor Author

Hopefully this CI run will be all 🟢 . If that is the case I will stop running the cron jobs on PRs and this can get merged

Comment thread etstool.py
"""
parameters = get_parameters(edm, runtime, toolkit, environment)
commands = ["{edm} run -e {environment} -- python -m flake8"]
targets = [
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Instead of this, I'd suggest changing the flake8 settings in a config file. That way the settings apply regardless of how flake8 is run, and not just in CI.

(I presume that this change is because there's some file that needs to be excluded from the flake8 run?)

Copy link
Copy Markdown
Contributor Author

@aaronayres35 aaronayres35 Jun 22, 2021

Choose a reason for hiding this comment

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

It actually wasn't a single file with errors, gh actions was trying to run flake8 on everything in the edm environment and was running for 20+ min:

...
./.edm/pkgs/9c/5dfc3b11de9f6cf06b47cbe5f431d4f56bebe5fe9c1c14492052301c13cd51/pip/_vendor/chardet/langcyrillicmodel.py:264:12: E231 missing whitespace after ','
./.edm/pkgs/9c/5dfc3b11de9f6cf06b47cbe5f431d4f56bebe5fe9c1c14492052301c13cd51/pip/_vendor/chardet/langcyrillicmodel.py:264:14: E231 missing whitespace after ','
./.edm/pkgs/9c/5dfc3b11de9f6cf06b47cbe5f431d4f56bebe5fe9c1c14492052301c13cd51/pip/_vendor/chardet/langcyrillicmodel.py:264:16: E231 missing whitespace after ','
./.edm/pkgs/9c/5dfc3b11de9f6cf06b47cbe5f431d4f56bebe5fe9c1c14492052301c13cd51/pip/_vendor/chardet/langcyrillicmodel.py:264:18: E231 missing whitesp
This step has been truncated due to its large size. Download the full logs from the  menu once the workflow run has completed.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Actually, I don't think I understand why this change was made - flake8 seems to run fine for me on the entire codebase; could you comment further?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hmm. That's weird. How did .edm end up in the current directory?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ah, I see; this is related to setting the EDM root directory. But putting the EDM root inside the repository clone doesn't seem right here. Is there something else we could do?

How are other ETS packages managing to avoid this issue?

Copy link
Copy Markdown
Contributor Author

@aaronayres35 aaronayres35 Jun 22, 2021

Choose a reason for hiding this comment

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

It was included in the first commit for the relevant file in traitsUI:
enthought/traitsui@4823b3f
and I'm not seeing any references to the error. I opened a quick PR without it on traitsUI to see if I see an error:
enthought/traitsui#1697 EDIT: CI finished on the traitsUI PR and there was no failure on windows... Perhaps it is not needed there? and maybe not here either

EDIT: this PR is more relevant enthought/enable#539, and here is the relevant comment thread enthought/enable#539 (comment)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks. I don't want to derail this PR - we can merge this one as-is, but it would still be good to figure out a better solution sometime.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

SGTM

Thank you for pointing this out! Far better than it just going unacknowledged

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Perhaps it is not needed there? and maybe not here either

Ah, interesting. Could we try removing it here to see what happens? (Can do that in a separate PR if you prefer.)

Also, I note from the enable traceback that the pip install seems to be using pip's "legacy" install mode; that might be because wheel isn't installed, and could explain why this issue doesn't seem to show up in the pip bug tracker.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I went ahead and removed it here. I had already turned off ets-from-source and test-wx workflows on PR runs, but I figure test-with-edm is enough to verify if it is needed or not.

Comment thread .github/workflows/ets-from-source.yml
Comment thread .github/workflows/ets-from-source.yml
Comment thread .github/workflows/ets-from-source.yml Outdated
Comment thread .github/workflows/ets-from-source.yml Outdated
Copy link
Copy Markdown
Member

@mdickinson mdickinson left a comment

Choose a reason for hiding this comment

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

LGTM; a few nitpicks.

It would be good to revert the flake8 changes in etstool.py, but that can be done in a separate PR.

@rahulporuri rahulporuri removed their request for review June 23, 2021 09:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants