Skip to content
Advertisement

Remove parent directories in python build source archive

I have the following setup for my python package:

JavaScript

The __init__.py is empty, the pyproject.toml and the setup.cfg contain example output from the PyPi documentation page (content shown below).

Now, for uploading to PyPi and for packing the python project, I run the command

JavaScript

This gives me a new directory dist (in my_package) containing a Test-0.0.0.tar.gz. All this is expected. But when I open the Test-0.0.0.tar.gz, I get the following content:

JavaScript

As you can see, the .tar.gz file contains the path on my local machine which is, obviously, not very privacy friendly. I absolutely do not want to upload files containing information about my private file tree structure. And I guess, this is also not intended. Plus, as far as I know, gzip does not allow to compress directories directly.

So my question is: What am I doing wrong in my build process?

PS: As you may have guessed by the document tree, I am developing on Windows โ€“ which might be important. My Python version is 3.7.1, installed via Miniconda3.


File contents:

pyproject.toml

JavaScript

setup.cfg

JavaScript

__init__.py is empty.

Advertisement

Answer

I updated my python to version 3.9, now everything works. I tried to find an issue on the official GitHub repository, but I didnโ€™t find it. Still, this is a very weird behaviour.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement