I have the following setup for my python package:
๐ฆmy_package
โฃ ๐src
โ โ ๐__init__.py
โฃ ๐setup.cfg
โ ๐pyproject.toml
โ
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
python -m build
โ
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:
๐ฆTest-0.0.0.tar.gz
โ ๐C:
โ ๐path
โ ๐to
โ ๐my
โ ๐dev-directory
โ ๐my_package
โ ๐dist
โ ๐tmp<some other characters>
โ ๐Test-0.0.0.tar
โ
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
[build-system]
requires = [
"setuptools>=42",
"wheel"
]
build-backend = "setuptools.build_meta"
โ
setup.cfg
[metadata]
name=Test
โ
[options]
package_dir =
= src
โ
__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.