Skip to content

Commit

Permalink
Fix __all__ (#83)
Browse files Browse the repository at this point in the history
The definition of `__all__` has never been correct, and it has not been
possible to import `*` from `pynvjitlink`, which resulted in an error
instead, e.g.:

```
In [1]: from pynvjitlink import *
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In[1], line 1
----> 1 from pynvjitlink import *

File <frozen importlib._bootstrap>:1227, in _handle_fromlist(module, fromlist, import_, recursive)

File <frozen importlib._bootstrap>:1223, in _handle_fromlist(module, fromlist, import_, recursive)

TypeError: Item in pynvjitlink.__all__ must be str, not type
```

This fixes the issue by putting strings in `__all__`.

<!--

Thank you for contributing to pynvjitlink :)

Here are some guidelines to help the review process go smoothly.

1. Please write a description in this text box of the changes that are
being
   made.

2. Please ensure that you have written units tests for the changes
made/features
   added.

3. If you are closing an issue please use one of the automatic closing
words as
noted here:
https://help.github.com/articles/closing-issues-using-keywords/

4. If your pull request is not ready for review but you want to make use
of the
continuous integration testing facilities please label it with `[WIP]`.

5. If your pull request is ready to be reviewed without requiring
additional
work on top of it, then remove the `[WIP]` label (if present) and
replace
it with `[REVIEW]`. If assistance is required to complete the
functionality,
for example when the C/C++ code of a feature is complete but Python
bindings
are still required, then add the label `[HELP-REQ]` so that others can
triage
and assist. The additional changes then can be implemented on top of the
same PR. If the assistance is done by members of the rapidsAI team, then
no
additional actions are required by the creator of the original PR for
this,
otherwise the original author of the PR needs to give permission to the
person(s) assisting to commit to their personal fork of the project. If
that
doesn't happen then a new PR based on the code of the original PR can be
opened by the person assisting, which then will be the PR that will be
   merged.

6. Once all work has been done and review has taken place please do not
add
features or make changes out of the scope of those requested by the
reviewer
(doing this just add delays as already reviewed code ends up having to
be
re-reviewed/it is hard to tell what is new etc!). Further, please do not
rebase your branch on main/force push/rewrite history, doing any of
these
   causes the context of any comments made by reviewers to be lost. If
   conflicts occur against main they should be resolved by merging main
   into the branch used for making the pull request.

Many thanks in advance for your cooperation!

-->
  • Loading branch information
gmarkall authored Jun 3, 2024
1 parent 571a69e commit e8c7375
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pynvjitlink/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
from pynvjitlink.api import NvJitLinker, NvJitLinkError
from pynvjitlink._version import __version__

__all__ = [NvJitLinker, NvJitLinkError, __version__]
__all__ = ["NvJitLinker", "NvJitLinkError", "__version__"]

0 comments on commit e8c7375

Please sign in to comment.