Skip to content

[Code scan] Fix package contents to exclude tests and include examples consistently #35

Description

@njzjz

This issue is a result of a Codex global code scan of deepmodeling/fpop at commit b05b337590c31a5237b2dcbd9c0833b841c08cd4.

Relevant code:

fpop/setup.py

Lines 15 to 23 in b05b337

packages=setuptools.find_packages(),
install_requires=[
"pydflow",
"lbg",
"dpdata",
"numpy",
"ase",
"dargs",
],

include LICENSE

Problem:
The wheel and source distribution currently package different unintended content:

  • packages=setuptools.find_packages() includes the repository's top-level tests package because it is a Python package under the repo root.
  • MANIFEST.in includes only LICENSE, so the source distribution omits the runnable examples/** files that are present in the repository.

Validation from the current tree:

wheel has tests package True
sample tests entries ['tests/__init__.py', 'tests/constants.py', 'tests/context.py', 'tests/mocked_ops.py', 'tests/test_abacus_inputs.py']
sdist has examples False
sdist has tests True

Expected behavior:
Runtime distributions should not install a top-level tests package into user environments. If examples are intended to be shipped, MANIFEST.in should include them; otherwise documentation should not imply they are available from the source distribution.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status
    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions