LilSpazJoekp / docstrfmt

A formatter for reStructuredText
MIT License
23 stars 13 forks source link

Bug: ModuleNotFoundError: No module named 'attr' #69

Closed nemesifier closed 1 month ago

nemesifier commented 1 month ago

Steps to replicate:

mkvirtualenv --python /usr/bin/python3 testdocstrfmt
pip install docstrfmt

Add pyproject.toml:

[tool.docstrfmt]
extend_exclude = ["*.py", "**/**/*.py"]
line_length = 74

Run:

docstrfmt -c -v --pyproject-config ./pyproject.toml .

Expected result: Checks run.

Actual result:

Traceback (most recent call last):
  File "/home/nemesis/.virtualenvs/testdocstrfmt/bin/docstrfmt", line 5, in <module>
    from docstrfmt.main import main
  File "/home/nemesis/.virtualenvs/testdocstrfmt/lib/python3.8/site-packages/docstrfmt/__init__.py", line 1, in <module>
    from . import debug, docstrfmt, rst_extras, util  # noqa: F401
  File "/home/nemesis/.virtualenvs/testdocstrfmt/lib/python3.8/site-packages/docstrfmt/docstrfmt.py", line 21, in <module>
    from attr import dataclass
ModuleNotFoundError: No module named 'attr'

Proposed solution: add attrs module to deps.

Additional question: BTW is there an easier way to exclude python files?