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

Add hooks for trame #775

Merged
merged 44 commits into from
Aug 7, 2024
Merged

Add hooks for trame #775

merged 44 commits into from
Aug 7, 2024

Conversation

MattTheCuber
Copy link
Contributor

Closes #773

I manually tested all libraries (except vtklocal because it is unstable and currently broken) that I added, and created a couple library tests. I wanted to add tests for every package (and did). However, trame is a client-server model framework that starts a server when you run it. I am not sure how to or what to even mock to disable running a server in tests. For now, I removed those tests. If you are fine with starting and stopping servers I can add back the tests. Maybe @jourdain (creator of Trame) has a better idea for writing tests for this?

Here is an example test (which does pass on my machine):

import asyncio

from trame.app import get_server
from trame.ui.html import DivLayout
from trame_xterm.widgets import xterm


async def stop(*args, **kwargs):
    await server.stop()


server = get_server()
with DivLayout(server):
    xterm.XTerm()
server.controller.on_server_ready.add(
    lambda *args, **kwargs: asyncio.ensure_future(stop(*args, **kwargs))
)
server.start(port=5102, open_browser=False)

@MattTheCuber
Copy link
Contributor Author

All of these tests pass locally on my machine. Not sure why they are failing in the CI?

@rokm
Copy link
Member

rokm commented Aug 6, 2024

All of these tests pass locally on my machine. Not sure why they are failing in the CI?

I think the failing test needs import check for vtkmodules. Or, there is a hidden import involved.

tests/test_trame.py Outdated Show resolved Hide resolved
@MattTheCuber
Copy link
Contributor Author

Btw, this is still a draft because there are so many other libraries that need hooks that I haven't actually tested my program works 😄

@MattTheCuber
Copy link
Contributor Author

MattTheCuber commented Aug 6, 2024

Can you take a look at the test_trame_vtk_tools test? I can't seem to make it pass in the CI or locally.

It works in my primary environment, so my guess is a hidden import or importerskip.

@rokm
Copy link
Member

rokm commented Aug 6, 2024

Yeah, looks like import check for nest_asyncio is missing (and nest-asyncio needs to be added to requirements).

@MattTheCuber
Copy link
Contributor Author

How did you find that?

@rokm
Copy link
Member

rokm commented Aug 6, 2024

How did you find that?

Check the traceback from the failed test's executable run:
https://github.com/pyinstaller/pyinstaller-hooks-contrib/actions/runs/10271758222/job/28422471043#step:10:973

@MattTheCuber MattTheCuber marked this pull request as ready for review August 6, 2024 18:58
Copy link
Member

@bwoodsend bwoodsend left a comment

Choose a reason for hiding this comment

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

Looks good...

tests/test_trame.py Outdated Show resolved Hide resolved
tests/test_trame.py Outdated Show resolved Hide resolved
@rokm rokm merged commit 46b3182 into pyinstaller:master Aug 7, 2024
14 checks passed
@MattTheCuber MattTheCuber deleted the hooks-for-trame branch August 7, 2024 19:24
@bwoodsend
Copy link
Member

Let me know if/when you've finished your pull request binge and I'll hit the release button.

@MattTheCuber
Copy link
Contributor Author

I believe I'm all set for now, our application seems to be running smoothly now. Thanks!

github-actions bot pushed a commit to wxx9248/Pickle-Rush that referenced this pull request Aug 12, 2024
…4.8 (#108)

Bumps
[pyinstaller-hooks-contrib](https://github.com/pyinstaller/pyinstaller-hooks-contrib)
from 2024.7 to 2024.8.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/pyinstaller/pyinstaller-hooks-contrib/releases">pyinstaller-hooks-contrib's
releases</a>.</em></p>
<blockquote>
<h2>v2024.8</h2>
<p>Please see the <a
href="https://www.github.com/pyinstaller/pyinstaller-hooks-contrib/tree/v2024.8/CHANGELOG.rst">changelog</a>
for more details</p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/pyinstaller/pyinstaller-hooks-contrib/blob/master/CHANGELOG.rst">pyinstaller-hooks-contrib's
changelog</a>.</em></p>
<blockquote>
<h2>2024.8 (2024-08-09)</h2>
<p>New hooks</p>
<pre><code>
* Add a hook for ``cmocean``, which has text data files.
(`[#769](pyinstaller/pyinstaller-hooks-contrib#769)

&lt;https://github.com/pyinstaller/pyinstaller-hooks-contrib/issues/769&gt;`_)
* Add a hook for ``pydicom``, which has hidden imports.
(`[#776](pyinstaller/pyinstaller-hooks-contrib#776)

&lt;https://github.com/pyinstaller/pyinstaller-hooks-contrib/issues/776&gt;`_)
* Add a hook for ``tzwhere``, which has data files.
(`[#772](pyinstaller/pyinstaller-hooks-contrib#772)

&lt;https://github.com/pyinstaller/pyinstaller-hooks-contrib/issues/772&gt;`_)
* Add hook for ``monai`` to collect its source .py files for
TorchScript/JIT.

(`[#778](pyinstaller/pyinstaller-hooks-contrib#778)

&lt;https://github.com/pyinstaller/pyinstaller-hooks-contrib/issues/778&gt;`_)
* Add hooks for ``itk`` to work around the package's requirements about
the ``itk/Configuration`` directory.
(`[#778](pyinstaller/pyinstaller-hooks-contrib#778)

&lt;https://github.com/pyinstaller/pyinstaller-hooks-contrib/issues/778&gt;`_)
* Added hooks for the ``trame`` suite of libraries, which has data files
and
hidden imports.
(`[#775](pyinstaller/pyinstaller-hooks-contrib#775)

&lt;https://github.com/pyinstaller/pyinstaller-hooks-contrib/issues/775&gt;`_)
<p>Updated hooks
</code></pre></p>
<ul>
<li>Rework the OpenSSL version check in <code>cryptography</code> hook
to fix
compatibility with <code>cryptography</code> 43.0.0.
(<code>[#768](pyinstaller/pyinstaller-hooks-contrib#768)
&lt;https://github.com/pyinstaller/pyinstaller-hooks-contrib/issues/768&gt;</code>_)</li>
<li>Update <code>hydra</code> hook to include work-around for
<code>hydra</code>'s plugin
manager, which under python &lt; 3.10 (still) uses deprecated PEP-302
that was removed from PyInstaller's <code>PyiFrozenImporter</code> in
PyInstaller 5.8. When building using python <!-- raw HTML omitted -->=
5.8,
the modules collected from <code>hydra._internal.core_plugins</code> and
<code>hydra_plugins</code> packages are now collected as source .py
files only;
this way, they are handled by built-in python's finder/importer instead
of PyInstaller's <code>PyiFrozenImporter</code>.
(<code>[#760](pyinstaller/pyinstaller-hooks-contrib#760)
&lt;https://github.com/pyinstaller/pyinstaller-hooks-contrib/issues/760&gt;</code>_)</li>
<li>Update <code>imageio_ffmpeg</code> hook for compatibility with
<code>imageio-ffmpeg</code>
0.5.0 and later.
(<code>[#766](pyinstaller/pyinstaller-hooks-contrib#766)
&lt;https://github.com/pyinstaller/pyinstaller-hooks-contrib/issues/766&gt;</code>_)</li>
<li>Update <code>pyexcel_ods</code> hook to add missing hidden import
and add tests.

(<code>[#779](pyinstaller/pyinstaller-hooks-contrib#779)
&lt;https://github.com/pyinstaller/pyinstaller-hooks-contrib/issues/779&gt;</code>_)</li>
</ul>
<p>Project &amp; Process</p>
<pre><code>
* Released sdists and tagged GitHub source archives contain the
changelog
&lt;/tr&gt;&lt;/table&gt; 
</code></pre>
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/pyinstaller/pyinstaller-hooks-contrib/commit/c1affefbe2bb8a35ecd05f6779727eec5b70eec5"><code>c1affef</code></a>
Release v2024.8</li>
<li><a
href="https://github.com/pyinstaller/pyinstaller-hooks-contrib/commit/1f84e9b0b985a8b47fbb92e16c2c115191545041"><code>1f84e9b</code></a>
Fix release verion bumper</li>
<li><a
href="https://github.com/pyinstaller/pyinstaller-hooks-contrib/commit/46b318260d89f1da5f95962d262b09f25fb0d56c"><code>46b3182</code></a>
Add hooks for trame (<a
href="https://redirect.github.com/pyinstaller/pyinstaller-hooks-contrib/issues/775">#775</a>)</li>
<li><a
href="https://github.com/pyinstaller/pyinstaller-hooks-contrib/commit/4324d79432311672d7fb6970266e9b63fe3780ff"><code>4324d79</code></a>
Add hooks for ITK and MONAI (<a
href="https://redirect.github.com/pyinstaller/pyinstaller-hooks-contrib/issues/778">#778</a>)</li>
<li><a
href="https://github.com/pyinstaller/pyinstaller-hooks-contrib/commit/7e6c20f983aae10f3750766adc2efc89bc100c42"><code>7e6c20f</code></a>
Update hook for pyexcel_ods (<a
href="https://redirect.github.com/pyinstaller/pyinstaller-hooks-contrib/issues/779">#779</a>)</li>
<li><a
href="https://github.com/pyinstaller/pyinstaller-hooks-contrib/commit/28151eae3bc6f026c26469e0960e4aad5d689b17"><code>28151ea</code></a>
Add hook for pydicom (<a
href="https://redirect.github.com/pyinstaller/pyinstaller-hooks-contrib/issues/776">#776</a>)</li>
<li><a
href="https://github.com/pyinstaller/pyinstaller-hooks-contrib/commit/3bec1611b2a49976973dc5e8b526cbd88b977c2e"><code>3bec161</code></a>
Scheduled weekly dependency update for week 31 (<a
href="https://redirect.github.com/pyinstaller/pyinstaller-hooks-contrib/issues/774">#774</a>)</li>
<li><a
href="https://github.com/pyinstaller/pyinstaller-hooks-contrib/commit/39e1cdd75f71a6b89c297f1f6ace9bb942a21020"><code>39e1cdd</code></a>
Add hook for tzwhere (<a
href="https://redirect.github.com/pyinstaller/pyinstaller-hooks-contrib/issues/771">#771</a>)</li>
<li><a
href="https://github.com/pyinstaller/pyinstaller-hooks-contrib/commit/c0d694c8b9b83fffb9d5d308e9ef6b851ca7179f"><code>c0d694c</code></a>
Scheduled weekly dependency update for week 30 (<a
href="https://redirect.github.com/pyinstaller/pyinstaller-hooks-contrib/issues/770">#770</a>)</li>
<li><a
href="https://github.com/pyinstaller/pyinstaller-hooks-contrib/commit/cd3e5e25247d4ae6225b2458872087a3557f1a62"><code>cd3e5e2</code></a>
Add hook for cmocean (<a
href="https://redirect.github.com/pyinstaller/pyinstaller-hooks-contrib/issues/769">#769</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/pyinstaller/pyinstaller-hooks-contrib/compare/2024.7...v2024.8">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=pyinstaller-hooks-contrib&package-manager=pip&previous-version=2024.7&new-version=2024.8)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
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.

Trame suite hooks
4 participants