pyscaffold / pyscaffoldext-markdown

⬇️ PyScaffold extension which replaces reStructuredText by Markdown
https://pyscaffold.org
MIT License
12 stars 4 forks source link

Bug after upgrade to PyScaffoldext-markdown version 0.5 #55

Closed mattkeanny closed 1 year ago

mattkeanny commented 1 year ago

Description of your problem

Please provide a minimal, self-contained, and reproducible example.

$ pip list | grep -i pyscaffold
PyScaffold                      4.2.3
pyscaffoldext-markdown          0.5
$ putup myproj --markdown

Please provide the full traceback.

Traceback (most recent call last):
  File "/opt/conda/bin/putup", line 8, in <module>
    sys.exit(run())
  File "/home/mk/.local/lib/python3.10/site-packages/pyscaffold/shell.py", line 133, in func_wrapper
    func(*args, **kwargs)
  File "/home/mk/.local/lib/python3.10/site-packages/pyscaffold/exceptions.py", line 34, in func_wrapper
    func(*args, **kwargs)
  File "/home/mk/.local/lib/python3.10/site-packages/pyscaffold/cli.py", line 263, in run
    main(args or sys.argv[1:])
  File "/home/mk/.local/lib/python3.10/site-packages/pyscaffold/cli.py", line 256, in main
    opts["command"](opts)
  File "/home/mk/.local/lib/python3.10/site-packages/pyscaffold/cli.py", line 225, in run_scaffold
    api.create_project(opts)
  File "/home/mk/.local/lib/python3.10/site-packages/pyscaffold/api.py", line 156, in create_project
    return reduce(actions.invoke, pipeline, ({}, opts))
  File "/home/mk/.local/lib/python3.10/site-packages/pyscaffold/actions.py", line 99, in invoke
    return action(*struct_and_opts)
  File "/opt/conda/lib/python3.10/site-packages/pyscaffoldext/markdown/extension.py", line 155, in replace_files
    files["setup.cfg"] = (add_long_desc(content), file_op)
  File "/opt/conda/lib/python3.10/site-packages/pyscaffoldext/markdown/extension.py", line 44, in add_long_desc
    default = Option(DESC_KEY)
TypeError: Option.__init__() missing 2 required positional arguments: 'value' and 'container'

Please provide any additional information below. When I downgrade pyscaffoldext-markdown to 0.4.1 all works fine:

$ pip list | grep -i pyscaffold
PyScaffold                      4.2.3
pyscaffoldext-markdown          0.4.1

$ putup myproj --markdown
done! 🐍 🌟 ✨

Versions and main components

abravalheri commented 1 year ago

Hi @mattkeanny, thank you very much for reporting this.

Could you confirm which version of ConfigUpdater do you have installed in your environment? Is there any chance that updating ConfigUpdater to its latest version prevents the error from happening?

If the version of ConfigUpdater is already >=3.0 and the error is still happening, could you please share with us a minimal reproducer? Unfortunately, I cannot replicate the error in my Ubuntu 20.04.5 LTS machine with the following experiment:

cd /tmp
rm -rf /tmp/testenv
virtualenv -p python3.10 /tmp/testenv
/tmp/testenv/bin/python -m pip install -U pip
/tmp/testenv/bin/python -m pip install 'pyscaffold==4.2.3' 'pyscaffoldext-markdown==0.5'
rm -rf /tmp/myproj
/tmp/testenv/bin/putup myproj --markdown
# done! 🐍 🌟 ✨
# myproj
# ├── AUTHORS.md
# ├── CHANGELOG.md
# ├── CONTRIBUTING.md
# ├── LICENSE.txt
# ├── README.md
# ├── docs
# │   ├── Makefile
# │   ├── _static
# │   ├── authors.md
# │   ├── changelog.md
# │   ├── conf.py
# │   ├── contributing.md
# │   ├── index.md
# │   ├── license.md
# │   ├── readme.md
# │   └── requirements.txt
# ├── pyproject.toml
# ├── setup.cfg
# ├── setup.py
# ├── src
# │   └── myproj
# │       ├── __init__.py
# │       └── skeleton.py
# ├── tests
# │   ├── conftest.py
# │   └── test_skeleton.py
# └── tox.ini

Technical side note:

In theory, updating pyscaffold and pyscaffoldext-markdown would result in an update of ConfigUpdater to version 3.0 or later, which should not cause the error we are seeing in the traceback.

mattkeanny commented 1 year ago

Installed version of ConfigUpdater is 3.1.1 Can I help dig further?

mattkeanny commented 1 year ago

I must say I am not running in a virtual env. Will try that.

abravalheri commented 1 year ago

Can I help dig further?

If you could share with us a minimal example (top-to-bottom) like the one I am showing in https://github.com/pyscaffold/pyscaffoldext-markdown/issues/55#issuecomment-1262520506 that results in the error you are experiencing, that would be super helpful.

mattkeanny commented 1 year ago

when executing as you suggested in #55, the extension works flawless. Guess I have to track it down elsewhere. Will post in case I found the root cause. Thanks for your help.

mattkeanny commented 1 year ago

issue solved: I suspect I had a mess of incompatible dependencies, not clear how. Solved it by pip uninstall -y pyscaffold pyscaffoldext-markdown ConfigUpdater pip install --user --upgrade pyscaffold pyscaffoldext-markdown Thanks again for the help.

abravalheri commented 1 year ago

Thank you very much for confirming @mattkeanny.

For the time being I will close this issue, but if you find something else, please let me know and I can re-open it.