regebro/pyroma

[Question] zip_safe setting if Wheels

Closed this issue · 4 comments

1. Briefly

I'm not sure, is the parameter zip_safe needs, if developer build package use Wheels.

2. Steps to reproduce

I create my Python package → I build my package, use Wheels:

python setup.py bdist_wheel

I publish my package to PyPI use Twine:

twine upload dist/*

I install my package use pip:

pip install <my_package>

3. Essence of the question

If I build my package, use python setup.py sdist, zip_safe parameter have a meaning:

If zip_safe = True:

    package add to my site-packages directory, packed to .egg format;

else:

    package add to site-packages directory unpacked.

But if I build my package, use python setup.py sdist, I get same behavior for zip_safe true and false or if I don't have zip_safe parameter. Package add to site-packages directory unpacked.

4. pyroma

If I have line zip_safe = True or zip_safe = False:

D:\SashaCanelo>pyroma .
------------------------------
Checking .
Registered VCS backend: git
Registered VCS backend: hg
Config variable 'Py_DEBUG' is unset, Python ABI tag may be incorrect
Config variable 'WITH_PYMALLOC' is unset, Python ABI tag may be incorrect

Config variable 'Py_DEBUG' is unset, Python ABI tag may be incorrect
Config variable 'WITH_PYMALLOC' is unset, Python ABI tag may be incorrect

Registered VCS backend: svn
Registered VCS backend: bzr
Found sashacanelo
------------------------------
Final rating: 10/10
Your cheese is so fresh most people think it's a cream: Mascarpone
------------------------------

else:

D:\SashaCanelo>pyroma .
------------------------------
Checking .
Registered VCS backend: git
Registered VCS backend: hg
Config variable 'Py_DEBUG' is unset, Python ABI tag may be incorrect
Config variable 'WITH_PYMALLOC' is unset, Python ABI tag may be incorrect

Config variable 'Py_DEBUG' is unset, Python ABI tag may be incorrect
Config variable 'WITH_PYMALLOC' is unset, Python ABI tag may be incorrect

Registered VCS backend: svn
Registered VCS backend: bzr
Found sashacanelo
------------------------------
You are using Setuptools or Distribute but do not specify if this package is zip_safe or not. You should specify it, as it defaults to True, which you probably do not want.
------------------------------
Final rating: 9/10
Cottage Cheese
------------------------------

But I think, that zip_safe parameter is excessive in this case.

Thanks.

jwilk commented

I'm not sure, is the parameter zip_safe needs, if developer build package use Wheels.

zip_safe doesn't affect wheels, but not everybody uses wheels.
It does make a difference when the user installs the software using python setup.py install.

Admittedly, pyroma does poor job at explaining why you should set zip_safe. :-/
It says that the default is probably not what you want, but doesn't say why it's not.

Well, the reason is that it default to being zip safe, but if it isn't that means the installation doesn't work.

Actually, I had a vague feeling that maybe the zip_safe default had changed, and it did, so this test isn't relevant any more. I'll remove it.

@regebro , please, publish version with 017d0a5 to PyPI. I steel get error as in my first post.

Thanks.