jmaupetit / md2pdf

Markdown to PDF conversion tool
MIT License
268 stars 41 forks source link

`tests` module is included in pypi package #76

Open claudious96 opened 1 month ago

claudious96 commented 1 month ago

Hi! First of all, thanks for the package, it's really useful for building documentation as readable documents.

I've encountered an issue when installing the package from pypi using pip, ot installs also a tests module, the one used to test this package.

This can be a problem since tests is usually the name of the local module/directory for testing (as it is for this package). In my case I wasn't able to do any import from my local tests directory as it was overridden by the tests package installed in the virtual environment.

Result of pip uninstall:

$ pip uninstall md2pdf                    
Found existing installation: md2pdf 1.0.1
Uninstalling md2pdf-1.0.1:
  Would remove:
    /home/claudious/.cache/pypoetry/virtualenvs/foo-4Z2l3Kb0-py3.11/bin/md2pdf
    /home/claudious/.cache/pypoetry/virtualenvs/foo-4Z2l3Kb0-py3.11/lib/python3.11/site-packages/md2pdf-1.0.1.dist-info/*
    /home/claudious/.cache/pypoetry/virtualenvs/foo-4Z2l3Kb0-py3.11/lib/python3.11/site-packages/md2pdf/*
    /home/claudious/.cache/pypoetry/virtualenvs/foo-4Z2l3Kb0-py3.11/lib/python3.11/site-packages/tests/*
Proceed (Y/n)? y
  Successfully uninstalled md2pdf-1.0.1

I've noticed it is already in the exclude section of pyproject.toml, I tried to build the package myself using poetry build but the result does not contain any tests directory. Therefore I don't have a suggestion on how to fix this.

Is it possible that you use a different tool or procedure when publishing to pypi?