Skip to content

Unintended distribution of packages #61

@albertvillanova

Description

@albertvillanova

It looks like your package distribution currently includes modules that should not be part of the public release, such as tests, assets, frontend,...

For example, in a Colab notebook you can directly import and run tests:

  • Open a Colab notebook
  • Execute:
In [1]: from tests import conversion_test

In [2]: conversion_test.__doc__
Out[2]: 'This module tests the conversion file in `spanner_graph/conversion.py`\n'

In [3]: !ls /usr/local/lib/python3.12/dist-packages/tests
Out[3]:
cloud_database_test.py	magics_test.py		 server_test.py
conversion_test.py	node_expansion_test.py	 test_notebook.json
graph_entities_test.py	__pycache__		 tox-plugin
graph_server_test.py	sample_notebook_test.py
__init__.py		schema_manager_test.py

In [4]: !ls /usr/local/lib/python3.12/dist-packages/assets
Out[4]: 
authentication.png  full_viz.png  load_ext.png
colab_usage.gif     jupyter.gif   sample_jupyter.png

In [5]: !ls /usr/local/lib/python3.12/dist-packages/frontend
Out[5]: 
babel.config.js  jest-puppeteer.config.js  README.md  static  tsconfig.json
jest.config.js	 package.json		   src	      tests

This indicates that those directories (like tests) are being packaged and distributed, which is not intended behavior.

Why this is problematic

  • Package bloat: Unnecessary files increase the size of the distribution.
  • Namespace conflicts: For example, using a top-level tests package can shadow or conflict with users’ own tests modules.
  • Exposure of internal code: Test modules are meant for development and CI, not for end users.
  • Maintenance risks: Users might rely on internal test utilities that are not part of the public API and may change or be removed without notice.

Suggested fix

Update the packaging configuration to explicitly exclude development-only files and directories (like tests/) from the distribution.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions