Giter VIP home page Giter VIP logo

astboom's Introduction

Hi there, I'm Kirill

❓ Random facts:

🤓 Projects of note:

astboom's People

Contributors

lensvol avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

astboom's Issues

Does not work with `3.10`

This line causes an error: https://github.com/lensvol/astboom/blob/master/astboom/visualizers/st.py#L1

» astboom ast < out/ex.py
Traceback (most recent call last):
  File "/Users/sobolev/Desktop/mypy/.venv/bin/astboom", line 5, in <module>
    from astboom.cli import cli
  File "/Users/sobolev/Desktop/mypy/.venv/lib/python3.10/site-packages/astboom/cli.py", line 10, in <module>
    from astboom.visualizers.st import VisualizeST
  File "/Users/sobolev/Desktop/mypy/.venv/lib/python3.10/site-packages/astboom/visualizers/st.py", line 1, in <module>
    import parser
ModuleNotFoundError: No module named 'parser'

Even on 3.9 this import is raising a warning: DeprecationWarning: The parser module is deprecated and will be removed in future versions of Python

Does not work on 3.11

» pip install astboom
Collecting astboom
  Obtaining dependency information for astboom from https://files.pythonhosted.org/packages/fb/21/110acf07d88dee640009879ae57f11153ff2fc84c96dd5d8854458084bb9/astboom-0.4.2-py3-none-any.whl.metadata
  Downloading astboom-0.4.2-py3-none-any.whl.metadata (3.4 kB)
Collecting asciitree<0.4.0,>=0.3.3 (from astboom)
  Downloading asciitree-0.3.3.tar.gz (4.0 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting click<8.0,>=7.0 (from astboom)
  Obtaining dependency information for click<8.0,>=7.0 from https://files.pythonhosted.org/packages/d2/3d/fa76db83bf75c4f8d338c2fd15c8d33fdd7ad23a9b5e57eb6c5de26b430e/click-7.1.2-py2.py3-none-any.whl.metadata
  Downloading click-7.1.2-py2.py3-none-any.whl.metadata (2.9 kB)
Collecting libcst<0.4.0,>=0.3.1 (from astboom)
  Obtaining dependency information for libcst<0.4.0,>=0.3.1 from https://files.pythonhosted.org/packages/51/07/b24e2f08461eb9844e8d2c1c0b954050898766fd18a407af2b8376eef956/libcst-0.3.23-py3-none-any.whl.metadata
  Downloading libcst-0.3.23-py3-none-any.whl.metadata (10 kB)
Collecting pyyaml<6.0,>=5.3 (from astboom)
  Downloading PyYAML-5.4.1.tar.gz (175 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 175.1/175.1 kB 984.3 kB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error
  
  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [54 lines of output]
      running egg_info
      writing lib3/PyYAML.egg-info/PKG-INFO
      writing dependency_links to lib3/PyYAML.egg-info/dependency_links.txt
      writing top-level names to lib3/PyYAML.egg-info/top_level.txt
      Traceback (most recent call last):
        File "/Users/sobolev/Desktop/wemake-python-styleguide/.venv/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/Users/sobolev/Desktop/wemake-python-styleguide/.venv/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/Users/sobolev/Desktop/wemake-python-styleguide/.venv/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
                 ^^^^^^^^^^^^^^^^^^^^^
        File "/private/var/folders/vw/n7c5l8m94zb072h487pnlpzm0000gn/T/pip-build-env-vf4p988u/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 325, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/private/var/folders/vw/n7c5l8m94zb072h487pnlpzm0000gn/T/pip-build-env-vf4p988u/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 295, in _get_build_requires
          self.run_setup()
        File "/private/var/folders/vw/n7c5l8m94zb072h487pnlpzm0000gn/T/pip-build-env-vf4p988u/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 311, in run_setup
          exec(code, locals())
        File "<string>", line 271, in <module>
        File "/private/var/folders/vw/n7c5l8m94zb072h487pnlpzm0000gn/T/pip-build-env-vf4p988u/overlay/lib/python3.11/site-packages/setuptools/__init__.py", line 104, in setup
          return distutils.core.setup(**attrs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/private/var/folders/vw/n7c5l8m94zb072h487pnlpzm0000gn/T/pip-build-env-vf4p988u/overlay/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 185, in setup
          return run_commands(dist)
                 ^^^^^^^^^^^^^^^^^^
        File "/private/var/folders/vw/n7c5l8m94zb072h487pnlpzm0000gn/T/pip-build-env-vf4p988u/overlay/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
          dist.run_commands()
        File "/private/var/folders/vw/n7c5l8m94zb072h487pnlpzm0000gn/T/pip-build-env-vf4p988u/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
          self.run_command(cmd)
        File "/private/var/folders/vw/n7c5l8m94zb072h487pnlpzm0000gn/T/pip-build-env-vf4p988u/overlay/lib/python3.11/site-packages/setuptools/dist.py", line 967, in run_command
          super().run_command(command)
        File "/private/var/folders/vw/n7c5l8m94zb072h487pnlpzm0000gn/T/pip-build-env-vf4p988u/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/private/var/folders/vw/n7c5l8m94zb072h487pnlpzm0000gn/T/pip-build-env-vf4p988u/overlay/lib/python3.11/site-packages/setuptools/command/egg_info.py", line 321, in run
          self.find_sources()
        File "/private/var/folders/vw/n7c5l8m94zb072h487pnlpzm0000gn/T/pip-build-env-vf4p988u/overlay/lib/python3.11/site-packages/setuptools/command/egg_info.py", line 329, in find_sources
          mm.run()
        File "/private/var/folders/vw/n7c5l8m94zb072h487pnlpzm0000gn/T/pip-build-env-vf4p988u/overlay/lib/python3.11/site-packages/setuptools/command/egg_info.py", line 550, in run
          self.add_defaults()
        File "/private/var/folders/vw/n7c5l8m94zb072h487pnlpzm0000gn/T/pip-build-env-vf4p988u/overlay/lib/python3.11/site-packages/setuptools/command/egg_info.py", line 588, in add_defaults
          sdist.add_defaults(self)
        File "/private/var/folders/vw/n7c5l8m94zb072h487pnlpzm0000gn/T/pip-build-env-vf4p988u/overlay/lib/python3.11/site-packages/setuptools/command/sdist.py", line 102, in add_defaults
          super().add_defaults()
        File "/private/var/folders/vw/n7c5l8m94zb072h487pnlpzm0000gn/T/pip-build-env-vf4p988u/overlay/lib/python3.11/site-packages/setuptools/_distutils/command/sdist.py", line 251, in add_defaults
          self._add_defaults_ext()
        File "/private/var/folders/vw/n7c5l8m94zb072h487pnlpzm0000gn/T/pip-build-env-vf4p988u/overlay/lib/python3.11/site-packages/setuptools/_distutils/command/sdist.py", line 336, in _add_defaults_ext
          self.filelist.extend(build_ext.get_source_files())
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "<string>", line 201, in get_source_files
        File "/private/var/folders/vw/n7c5l8m94zb072h487pnlpzm0000gn/T/pip-build-env-vf4p988u/overlay/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 107, in __getattr__
          raise AttributeError(attr)
      AttributeError: cython_sources
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

`click<8.0` is reported as insecure

Log:

poetry run safety check --full-report
+==============================================================================+
|                                                                              |
|                               /$$$$$$            /$$                         |
|                              /$$__  $$          | $$                         |
|           /$$$$$$$  /$$$$$$ | $$  \__//$$$$$$  /$$$$$$   /$$   /$$           |
|          /$$_____/ |____  $$| $$$$   /$$__  $$|_  $$_/  | $$  | $$           |
|         |  $$$$$$   /$$$$$$$| $$_/  | $$$$$$$$  | $$    | $$  | $$           |
|          \____  $$ /$$__  $$| $$    | $$_____/  | $$ /$$| $$  | $$           |
|          /$$$$$$$/|  $$$$$$$| $$    |  $$$$$$$  |  $$$$/|  $$$$$$$           |
|         |_______/  \_______/|__/     \_______/   \___/   \____  $$           |
|                                                          /$$  | $$           |
|                                                         |  $$$$$$/           |
|  by pyup.io                                              \______/            |
|                                                                              |
+==============================================================================+
| REPORT                                                                       |
| checked 141 packages, using free DB (updated once a month)                   |
+============================+===========+==========================+==========+
| package                    | installed | affected                 | ID       |
+============================+===========+==========================+==========+
| click                      | 7.1.2     | <8.0.0                   | 47833    |
+==============================================================================+
| Click 8.0.0 uses 'mkstemp()' instead of the deprecated & insecure            |
| 'mktemp()'.                                                                  |
| https://github.com/pallets/click/issues/1752                                 |
+==============================================================================+

Link: https://github.com/wemake-services/wemake-python-styleguide/runs/5867743871?check_suite_focus=true#step:7:978

Source: https://github.com/lensvol/astboom/blob/master/pyproject.toml#L30

AttributeError: 'NoneType' object has no attribute '__dict__'

Version: 0.2.2

Reproduction:

» echo "keys={'a': 1}; {**keys}" > ex.py

» astboom < ex.py
Failed to read source from command line, trying to read it from STDIN:
========================================================================
======================================================================== 

Traceback (most recent call last):
  File "/Users/sobolev/Documents/github/wemake-python-styleguide/.venv/bin/astboom", line 10, in <module>
    sys.exit(cli())
  File "/Users/sobolev/Documents/github/wemake-python-styleguide/.venv/lib/python3.8/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/Users/sobolev/Documents/github/wemake-python-styleguide/.venv/lib/python3.8/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/Users/sobolev/Documents/github/wemake-python-styleguide/.venv/lib/python3.8/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/sobolev/Documents/github/wemake-python-styleguide/.venv/lib/python3.8/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/Users/sobolev/Documents/github/wemake-python-styleguide/.venv/lib/python3.8/site-packages/astboom/main.py", line 60, in cli
    source_tree = engine.process(source)
  File "/Users/sobolev/Documents/github/wemake-python-styleguide/.venv/lib/python3.8/site-packages/astboom/visualizers/ast.py", line 63, in process
    return {class_name(module): self._traverse(module)}
  File "/Users/sobolev/Documents/github/wemake-python-styleguide/.venv/lib/python3.8/site-packages/astboom/visualizers/ast.py", line 37, in _traverse
    traversed_items = {
  File "/Users/sobolev/Documents/github/wemake-python-styleguide/.venv/lib/python3.8/site-packages/astboom/visualizers/ast.py", line 38, in <dictcomp>
    f"[{i}] {class_name(item)}": self._traverse(item)
  File "/Users/sobolev/Documents/github/wemake-python-styleguide/.venv/lib/python3.8/site-packages/astboom/visualizers/ast.py", line 34, in _traverse
    (f"{attr}: {class_name(value)}", self._traverse(value))
  File "/Users/sobolev/Documents/github/wemake-python-styleguide/.venv/lib/python3.8/site-packages/astboom/visualizers/ast.py", line 37, in _traverse
    traversed_items = {
  File "/Users/sobolev/Documents/github/wemake-python-styleguide/.venv/lib/python3.8/site-packages/astboom/visualizers/ast.py", line 38, in <dictcomp>
    f"[{i}] {class_name(item)}": self._traverse(item)
  File "/Users/sobolev/Documents/github/wemake-python-styleguide/.venv/lib/python3.8/site-packages/astboom/visualizers/ast.py", line 25, in _traverse
    for attr, value in sorted(node.__dict__.items(), key=lambda p: p[0]):
AttributeError: 'NoneType' object has no attribute '__dict__'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.