DiamondLightSource / python3-pip-skeleton

Archived in favour of https://github.com/DiamondLightSource/python-copier-template
Apache License 2.0
4 stars 4 forks source link

Replace the metadata check in test_boilerplate_removed.py #144

Open coretl opened 1 year ago

coretl commented 1 year ago

This line is problematic: https://github.com/DiamondLightSource/python3-pip-skeleton/blob/3415f1c8b7c9305600d06a6be460cab081556950/tests/test_boilerplate_removed.py#L34

First of all it needs the name of the module, which created https://github.com/DiamondLightSource/python3-pip-skeleton-cli/issues/85, also it needs you to reinstall after fixing the issue in editable mode, which will trip people up. I suggest we go back to the less robust but simpler approach of:

def test_module_summary():
    assert_not_contains_text(
        "pyproject.toml",
        "One line description of your module",
        "so [project] description is a one line description of your module",
    )

@garryod thoughts?

garryod commented 1 year ago

I strongly favour the use of setuptools.metadata here as it decouples us from the package metadata source and is the recommended way of accessing such data.

  1. I'm not convinced needing the name of the module is a big deal, this must be substituted in several other places already, though perhaps I am missing some reason which makes it more problematic than the others. If we want to resolve this we should look into more robust templating methods - I willl note that there is now support for template repositories in the developer portal.
  2. This is not ideal, and from the looks of it is an almost unsolvable problem due to implementation of editable installs. A reasonable workaround may be to add "you must re-install the package for this change to be detected" - or likewise - to the error message