From: Günter M. <mi...@us...> - 2022-05-24 15:11:47
|
On 2022-05-20, Adam Turner wrote: > I don't see the need for a distinct `cli.py`, so I inlined it into > `__main__.py`. I see the point. Howver, IMV, importing something from `__main__` is no clean coding style, although it is used by some packages. Also, `if __name__ == '__main__'` is problematic in a file called `__main__.py`. In a script, `import docutils.__main__` will work differently from `from docutils import __main__`. This is why I'd rather follow the example given by "flake8", not "virtualenv". We may move the `rst2…()` functions to core.py. This would also have the advantage that calling `rst2html()` etc. will not import argparse in addition to optparse. I'd wait with `rst2…` entry points until we decided which ones to keep. Introducing, e.g., `rst2pseudoxml` parallel to `rst2pseudoxml.py` only to eventually remove both of them later would be confusing. --- ** [patches:#186] Modernise packaging** **Status:** open **Group:** None **Created:** Fri Dec 31, 2021 03:16 AM UTC by Adam Turner **Last Updated:** Fri May 20, 2022 05:45 PM UTC **Owner:** nobody **Attachments:** - [0001-Use-flit-and-pyproject.toml.patch](https://sourceforge.net/p/docutils/patches/186/attachment/0001-Use-flit-and-pyproject.toml.patch) (12.2 kB; application/octet-stream) - [0002-Use-entry-points.patch](https://sourceforge.net/p/docutils/patches/186/attachment/0002-Use-entry-points.patch) (20.7 kB; application/octet-stream) - [0003-update-docs-etc-after-packaging-changes.patch](https://sourceforge.net/p/docutils/patches/186/attachment/0003-update-docs-etc-after-packaging-changes.patch) (49.3 kB; application/octet-stream) Hi, I had a go at modernising the packaging stack. `setup.py` based invocations have been deprecated (https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html), and setuptools may remove them in the future. This takes the opportunity to move to a PEP 621 based declarative config, and also fixes a longstanding TODO item about providing script wappers for the frontend tools on windows, by migrating them to entry points. I've updated install and development docs with the new guidance, and updated references to the frontend tools to remove `.py`, given they are now installed as proper scripts. Hope this is appreciated -- happy to make revisions etc to help getting this merged. A --- Sent from sourceforge.net because doc...@li... is subscribed to https://sourceforge.net/p/docutils/patches/ To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/docutils/admin/patches/options. Or, if this is a mailing list, you can unsubscribe from the mailing list. |