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

Work on newer version. #22

Open
8 tasks
aroberge opened this issue Apr 13, 2022 · 4 comments
Open
8 tasks

Work on newer version. #22

aroberge opened this issue Apr 13, 2022 · 4 comments
Assignees

Comments

@aroberge
Copy link
Owner

Goals for new version:

  • Support for IPython/Jupyter
  • Remove argument passing to transformers for showing original or transformed code, and rely on a configuration settings.
  • Revise the documentation to show the command line option as the default, instead of importing, adding hook, etc.
  • Add an example showing how to load a custom transformer from the command line.
  • Add info about adding *kwargs to future-proofing transformers.
  • Separate out encodings example, reducing the emphasis.
  • See if it is possible to adapt/update the failing examples for Python 3.8+
  • See if it is possible to show the transformed code for Python with AST for Python 3.9 as it includes unparse by default.
@aroberge aroberge self-assigned this Apr 13, 2022
aroberge added a commit that referenced this issue Apr 15, 2022
aroberge added a commit that referenced this issue Apr 15, 2022
@tomkcook
Copy link
Contributor

Is this why simple examples fail on Python 3.10? This for instance:

import ideas

def my_transform(source, **_kwargs):
    return source

def add_hook(**_kwargs):
    hook = ideas.import_hook.create_hook(transform_source=my_transform)
    return hook
my_var = "test value"
$ python3 -m ideas test -a transforms
Module <module 'transforms' from '/home/tkcook/git/idea/transforms.py'> does not contain a function named add_hook

@tomkcook
Copy link
Contributor

Relevant versions:

$ venv/bin/pip freeze
ideas==0.1.3
token-utils==0.1.8
$ python3 --version
Python 3.10.6

@tomkcook
Copy link
Contributor

No, never mind, that's because an AttributeError in your add_hook function has the same effect as a missing add_hook function.

@aroberge
Copy link
Owner Author

Try to upload the newest version (0.1.4) - just uploaded to pypi.
Also, instead of importing ideas and trying to call ideas.import_hook..., do

from ideas import import_hook

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

No branches or pull requests

2 participants