Skip to content

fix: console command points to a module that does not exist (IN-1.1) #4

Done

Description

@Akadib

Problem

  1. The command points to a module that does not exist. After installing from local source, diffpy-diffchooser --version fails with ModuleNotFoundError: No module named 'diffpy.diffchooser.app'.

    Where Name
    pyproject.toml tells the command to load diffpy.diffchooser.app
    The file in src/diffpy/diffchooser/ is diffchooser_app.py
  2. main() accepts no arguments. A test that calls main(["--version"]) raises TypeError.

Proposed solution

  1. In pyproject.toml, point [project.scripts] to diffpy.diffchooser.diffchooser_app:main. This follows scikit-package naming convention. For the reference, take a look at the same bug appeared in fix:Fixed CLI entry point generated with correct module path in project.script scikit-package/scikit-package#717.
  2. Change main() to main(argv=None) and call parser.parse_args(argv). With argv=None, the command still reads the terminal arguments.
  3. Add a test that calls main(["--version"]) and checks the output.

Done when

  • diffpy-diffchooser --version prints the version after pip install -e .
  • The new test passes
  • News file added

Activity

  1. added theissue type on Dec 1, 2026
  2. added
    bug
    on Dec 1, 2026
  3. Akadib commented on Dec 1, 2026

    @Akadib
    CollaboratorAuthor

    Screenshot 2026-12-01 at 3 09 10 AM This is the error!

  4. Akadib commented on Dec 1, 2026

    @Akadib
    CollaboratorAuthor

    Screenshot 2026-12-01 at 4 27 42 AM Now it passes!

  5. Akadib commented on Dec 1, 2026

    @Akadib
    CollaboratorAuthor

    I am closing this issue since it has been already addressed by the merged PR #21

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions