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

hooks: add hook for opentelemetry #725

Merged
merged 1 commit into from
Apr 18, 2024
Merged

Conversation

rokm
Copy link
Member

@rokm rokm commented Apr 17, 2024

Add hook for opentelemetry that collects all entry-points with opentelemetry_ prefix.

Closes pyinstaller/pyinstaller#8413.

Add hook for `opentelemetry` that collects all entry-points with
`opentelemetry_` prefix.
@rokm rokm merged commit 6b37b09 into pyinstaller:master Apr 18, 2024
14 checks passed
@rokm rokm deleted the hook-opentelemetry branch April 18, 2024 19:52
github-actions bot pushed a commit to wxx9248/CIS-Game-Project-2023W that referenced this pull request Apr 24, 2024
…4.5 (#96)

Bumps
[pyinstaller-hooks-contrib](https://github.com/pyinstaller/pyinstaller-hooks-contrib)
from 2024.4 to 2024.5.
<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>2024.5</h2>
<p>Please see the <a
href="https://www.github.com/pyinstaller/pyinstaller-hooks-contrib/tree/master/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.5 (2024-04-23)</h2>
<p>New hooks</p>
<pre><code>
* Add hook for ``backports`` package, to accommodate the
``pkgutil``-style
``backports`` namespace package provided by
``backports.functools-lru-cache``
and the latest release of ``backports.tarfile``.
(`[#735](pyinstaller/pyinstaller-hooks-contrib#735)

&lt;https://github.com/pyinstaller/pyinstaller-hooks-contrib/issues/735&gt;`_)
* Add hook for ``opentelemetry`` that collects all entry-points with
``opentelemetry_`` prefix.
(`[#725](pyinstaller/pyinstaller-hooks-contrib#725)

&lt;https://github.com/pyinstaller/pyinstaller-hooks-contrib/issues/725&gt;`_)
* Add hook for ``skimage.metrics`` to account for lazy loading of the
``skimage.metrics`` that was introduced in ``scikit-image`` 0.23.0.
(`[#723](pyinstaller/pyinstaller-hooks-contrib#723)

&lt;https://github.com/pyinstaller/pyinstaller-hooks-contrib/issues/723&gt;`_)
* Add hook for ``xarray``, which ensures that metadata for ``numpy``
(required by ``xarray``) is collected.
(`[#728](pyinstaller/pyinstaller-hooks-contrib#728)

&lt;https://github.com/pyinstaller/pyinstaller-hooks-contrib/issues/728&gt;`_)
<p>Updated hooks
</code></pre></p>
<ul>
<li>(Windows) Update <code>pyproj</code> hook to explicitly collect DLLs
and
load-order file (if present) from <code>pyproj.libs</code> directory.
This
fixes <code>DLL load failed while importing _network</code> error when
using
Anaconda python 3.8 or 3.9, where <code>delvewheel</code> (used by
<code>pyproj</code>)
needs to load DLLs via load-order file due to defunct
<code>os.add_dll_directory</code> function.
(<code>[#726](pyinstaller/pyinstaller-hooks-contrib#726)
&lt;https://github.com/pyinstaller/pyinstaller-hooks-contrib/issues/726&gt;</code>_)</li>
<li>Extend <code>cryptography</code> hook to collect OpenSSL modules
(the
<code>ossl-modules</code> directory) when available. Add a run-time hook
that
overrides OpenSSL module search path by setting the
<code>OPENSSL_MODULES</code>
environment variable to the bundled <code>ossl-modules</code> directory.
This
fixes <code>RuntimeError: OpenSSL 3.0's legacy provider failed to
load.</code>
error when using <code>cryptography</code> with OpenSSL &gt;= 3.0 builds
that have
modules enabled (e.g., most Linux distributions, msys/MinGW on Windows,
and Homebrew on macOS).
(<code>[#724](pyinstaller/pyinstaller-hooks-contrib#724)
&lt;https://github.com/pyinstaller/pyinstaller-hooks-contrib/issues/724&gt;</code>_)</li>
<li>Suppress errors in <code>gcloud</code> hook that occur when the hook
is triggered
by the <code>gcloud</code> namespace package from
<code>gcloud-aio-*</code> and
<code>gcloud-rest-*</code>
dists instead of the <code>gcloud</code> package from the
<code>gcloud</code> dist.
(<code>[#731](pyinstaller/pyinstaller-hooks-contrib#731)
&lt;https://github.com/pyinstaller/pyinstaller-hooks-contrib/issues/731&gt;</code>_)</li>
<li>Update hook for <code>tables</code> (PyTables) to collect bundled
blosc2
shared library, if available. On Windows, explicitly collect DLLs and
load-order file (if present) from <code>tables.libs</code> directory.
(<code>[#732](pyinstaller/pyinstaller-hooks-contrib#732)
&lt;https://github.com/pyinstaller/pyinstaller-hooks-contrib/issues/732&gt;</code>_)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/pyinstaller/pyinstaller-hooks-contrib/commit/a62d86392e952bc37a92c28e0429956de29ed7a9"><code>a62d863</code></a>
Release v2024.5</li>
<li><a
href="https://github.com/pyinstaller/pyinstaller-hooks-contrib/commit/6d9f5c5c7117d76eb3e347503efbb3b04e896821"><code>6d9f5c5</code></a>
hooks: add hook for backports namespace package</li>
<li><a
href="https://github.com/pyinstaller/pyinstaller-hooks-contrib/commit/485ce07f3dd7dc3e6e6c11717079c356172a7b7a"><code>485ce07</code></a>
hooks: cryptography: account for ossl-modules location on Alpine
linux</li>
<li><a
href="https://github.com/pyinstaller/pyinstaller-hooks-contrib/commit/a0cbbc29b99a08ee018d89513f2c570f2c842197"><code>a0cbbc2</code></a>
hooks: cryptography: work-around for systems with musl libc</li>
<li><a
href="https://github.com/pyinstaller/pyinstaller-hooks-contrib/commit/8d14a00e7429abca5e3e6d1f282cc799f61b96b0"><code>8d14a00</code></a>
Scheduled weekly dependency update for week 16 (<a
href="https://redirect.github.com/pyinstaller/pyinstaller-hooks-contrib/issues/734">#734</a>)</li>
<li><a
href="https://github.com/pyinstaller/pyinstaller-hooks-contrib/commit/88708840343c799af578f02a3875a5f40b150ba0"><code>8870884</code></a>
hooks: update tables hook to collect blosc2 shared library</li>
<li><a
href="https://github.com/pyinstaller/pyinstaller-hooks-contrib/commit/ccc5f7dbcaf2c1f0778d1459b246ee56cf6baf57"><code>ccc5f7d</code></a>
hooks: gcloud: suppress errors</li>
<li><a
href="https://github.com/pyinstaller/pyinstaller-hooks-contrib/commit/d2a4a24399a7e9897360d66f48474a7ea182c1bd"><code>d2a4a24</code></a>
hooks: add hook for xarray</li>
<li><a
href="https://github.com/pyinstaller/pyinstaller-hooks-contrib/commit/aa7d19fa1f4217bd7ef541b38495d0a5157fa099"><code>aa7d19f</code></a>
ci/cd: bump actions versions</li>
<li><a
href="https://github.com/pyinstaller/pyinstaller-hooks-contrib/commit/82292498516674a3681617128e17bca508d7259c"><code>8229249</code></a>
tests: add basic test for cryptography</li>
<li>Additional commits viewable in <a
href="https://github.com/pyinstaller/pyinstaller-hooks-contrib/compare/2024.4...2024.5">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.4&new-version=2024.5)](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] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
@Aybfr
Copy link

Aybfr commented May 2, 2024

Hi guys,
I have a persisting issue with the latest version of pyinstaller and opentelemetry, I developed a local AI app that runs perfectly on python but once I created its exe it keeps sending the same errors while executing:

Traceback (most recent call last):
File "langchain_community\vectorstores\chroma.py", line 81, in init
File "PyInstaller\loader\pyimod02_importers.py", line 419, in exec_module
File "chromadb_init_.py", line 5, in
File "PyInstaller\loader\pyimod02_importers.py", line 419, in exec_module
File "chromadb\auth\token_init_.py", line 26, in
File "PyInstaller\loader\pyimod02_importers.py", line 419, in exec_module
File "chromadb\telemetry\opentelemetry_init_.py", line 6, in
File "PyInstaller\loader\pyimod02_importers.py", line 419, in exec_module
File "opentelemetry\sdk\resources_init_.py", line 144, in
File "importlib_metadata_init_.py", line 900, in version
File "importlib_metadata_init_.py", line 873, in distribution
File "importlib_metadata_init_.py", line 391, in from_name
importlib_metadata.PackageNotFoundError: No package metadata was found for opentelemetry-sdk

Could anyone help me if possible? Thank you!

@rokm
Copy link
Member Author

rokm commented May 2, 2024

What version of pyinstaller-hooks-contrib do you have installed?

@Aybfr
Copy link

Aybfr commented May 3, 2024

What version of pyinstaller-hooks-contrib do you have installed?

I have the 6.6.0 of pyinstaller and just re-installed pyinstaller-hooks-contrib yesterday again.

@rokm
Copy link
Member Author

rokm commented May 3, 2024

What version of pyinstaller-hooks-contrib do you have installed?

I have the 6.6.0 of pyinstaller and just re-installed pyinstaller-hooks-contrib yesterday again.

If you have pyinstaller-hooks-contrib 2024.5, then the hook that was added in this PR should do the trick (the opentelemetry-sdk metadata should be collected as part of the entry points that the hook collect).

But even so, you can force collection of that metadata by adding --copy-metadata opentelemetry-sdk to your PyInstaller command, and see if it gets you any further.

@Aybfr
Copy link

Aybfr commented May 3, 2024

What version of pyinstaller-hooks-contrib do you have installed?

I have the 6.6.0 of pyinstaller and just re-installed pyinstaller-hooks-contrib yesterday again.

If you have pyinstaller-hooks-contrib 2024.5, then the hook that was added in this PR should do the trick (the opentelemetry-sdk metadata should be collected as part of the entry points that the hook collect).

But even so, you can force collection of that metadata by adding --copy-metadata opentelemetry-sdk to your PyInstaller command, and see if it gets you any further.

I forced the add but the issue persists, I already have the 2024.5 version. I will try to redo the whole thing from scratch and see if the issue is still there. Thank you

@rokm
Copy link
Member Author

rokm commented May 3, 2024

What version of pyinstaller-hooks-contrib do you have installed?

I have the 6.6.0 of pyinstaller and just re-installed pyinstaller-hooks-contrib yesterday again.

If you have pyinstaller-hooks-contrib 2024.5, then the hook that was added in this PR should do the trick (the opentelemetry-sdk metadata should be collected as part of the entry points that the hook collect).
But even so, you can force collection of that metadata by adding --copy-metadata opentelemetry-sdk to your PyInstaller command, and see if it gets you any further.

I forced the add but the issue persists, I already have the 2024.5 version. I will try to redo the whole thing from scratch and see if the issue is still there. Thank you

Try rebuilding with --clean option added, then.

@Aybfr
Copy link

Aybfr commented May 3, 2024

What version of pyinstaller-hooks-contrib do you have installed?

I have the 6.6.0 of pyinstaller and just re-installed pyinstaller-hooks-contrib yesterday again.

If you have pyinstaller-hooks-contrib 2024.5, then the hook that was added in this PR should do the trick (the opentelemetry-sdk metadata should be collected as part of the entry points that the hook collect).
But even so, you can force collection of that metadata by adding --copy-metadata opentelemetry-sdk to your PyInstaller command, and see if it gets you any further.

I forced the add but the issue persists, I already have the 2024.5 version. I will try to redo the whole thing from scratch and see if the issue is still there. Thank you

Try rebuilding with --clean option added, then.

I did use clean but separately, would you be kind to give me a sequence to follow in order to build my exe correctly. Thank you in advance!!

@rokm
Copy link
Member Author

rokm commented May 3, 2024

What version of pyinstaller-hooks-contrib do you have installed?

I have the 6.6.0 of pyinstaller and just re-installed pyinstaller-hooks-contrib yesterday again.

If you have pyinstaller-hooks-contrib 2024.5, then the hook that was added in this PR should do the trick (the opentelemetry-sdk metadata should be collected as part of the entry points that the hook collect).
But even so, you can force collection of that metadata by adding --copy-metadata opentelemetry-sdk to your PyInstaller command, and see if it gets you any further.

I forced the add but the issue persists, I already have the 2024.5 version. I will try to redo the whole thing from scratch and see if the issue is still there. Thank you

Try rebuilding with --clean option added, then.

I did use clean but separately, would you be kind to give me a sequence to follow in order to build my exe correctly. Thank you in advance!!

Run pyinstaller --clean --copy-metadata opentelemetry-sdk [the rest of your options]; then copy full build log and the error message here (or in a new issue).

@Aybfr
Copy link

Aybfr commented May 3, 2024

What version of pyinstaller-hooks-contrib do you have installed?

I have the 6.6.0 of pyinstaller and just re-installed pyinstaller-hooks-contrib yesterday again.

If you have pyinstaller-hooks-contrib 2024.5, then the hook that was added in this PR should do the trick (the opentelemetry-sdk metadata should be collected as part of the entry points that the hook collect).
But even so, you can force collection of that metadata by adding --copy-metadata opentelemetry-sdk to your PyInstaller command, and see if it gets you any further.

I forced the add but the issue persists, I already have the 2024.5 version. I will try to redo the whole thing from scratch and see if the issue is still there. Thank you

Try rebuilding with --clean option added, then.

I did use clean but separately, would you be kind to give me a sequence to follow in order to build my exe correctly. Thank you in advance!!

Run pyinstaller --clean --copy-metadata opentelemetry-sdk [the rest of your options]; then copy full build log and the error message here (or in a new issue).

So that issue is resolved but I keep getting issues with not found modules like: ModuleNotFoundError: No module named 'pypika'
ModuleNotFoundError: No module named 'chromadb.telemetry.product.posthog' etc so I think that the issue is that it seems like the packages are not accessible.

@rokm
Copy link
Member Author

rokm commented May 3, 2024

There's a lot of indirect imports going on in chromadb, so you will need to specify those missing modules as hidden imports.

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.

PyInstaller doesn't work with opentelemetry
2 participants