nicfit / eyeD3

eyeD3 is a Python module and command line program for processing ID3 tags. Information about mp3 files (i.e bit rate, sample frequency, play time, etc.) is also provided. The formats supported are ID3v1 (1.0/1.1) and ID3v2 (2.3/2.4).
http://eyed3.nicfit.net/
GNU General Public License v3.0
532 stars 58 forks source link

File pollution due to improper setup (i.e. the wheel installs files outside the module directory) #619

Open denilsonsa opened 5 months ago

denilsonsa commented 5 months ago

The current eyeD3 package installs a lot of (useless) files outside the module directory.

How to reproduce (1)

$ python -m venv .venv
$ source .venv/bin/activate
$ pip install requests
...
"requests" is just a random example module I wanted to install.
...
$ ls .venv/lib/python3.11/site-packages/

A bunch of directories, basically two directories per module, and not much else.
It looks quite clean.

$ pip install eyed3
...
$ ls .venv/lib/python3.11/site-packages/

OMG! What happened‽ These files showed up:

AUTHORS.rst
CONTRIBUTING.rst
HISTORY.rst
LICENSE
MANIFEST.in
Makefile
README.rst
poetry.lock
tox.ini

And these directories:

examples/
requirements/
tests/

$ pip uninstall eyed3

It lists all the files that are going to be removed.

How to reproduce (2)

  1. Go to https://pypi.org/project/eyed3/#files
  2. Download the eyed3-0.9.7-py3-none-any.whl wheel file.
  3. Inspect that file (it's just a zip file with a different extension).

Problem: there are many files outside the module directory.

Comparison

Take a look at the included files from the debian packages:

Those are very clean, no extraneous files being installed out-of-place.

Solution

You have to fix pyproject.toml.

You can also reorganize the project, moving all the source files under src/. That's a convention followed by setuptools, and I'm not sure about poetry.

denilsonsa commented 5 months ago

After I wrote all of that and did all the investigation, I found a duplicate issue: #588.