maphew

Leo Dev Notes

Friday, September 29, 2017

mhw_setup-py.leo

The most complete project file for working on Leo Editor's setup.py

leo-setup.leo

just setup.py and setup.cfg

B:\code\leo-*

a bunch of different folders, whose purpose needs to be rediscovered and documented

 

Packaging a new release for PyPi

rd /s/q dist
rd /s/q build
python setup.py bdist_wheel
twine upload --repository-url https://test.pypi.org/legacy/ dist/*
pip install --index-url https://test.pypi.org/simple/ leo

Remove broken releases (still can't re-use identical version numbers and file names though):

https://testpypi.python.org/pypi?%3Aaction=pkg_edit&name=leo

# only install from source (sdist, no wheels)
pip install --no-binary :all: --index-url https://test.pypi.org/simple/ leo
python setup.py sdist bdist_wheel

warning: sdist: standard file not found: should have one of README, README.rst, README.txt

-----

While you can pip install pyqt5 thanks to the now available wheels (as suggested by @mfitzp), it cannot be required from setup.py via install_requires. The reason is that setuptools doesn't know how to install wheels which pip knows how to, and PyQT5 is only available as wheels on PyPI (there is no source distribution, i.e. no tar.gz file). See this email and that bug report for details.

From <https://stackoverflow.com/questions/4628519/is-it-possible-to-require-pyqt-from-setuptools-setup-py?noredirect=1&lq=1>

-- @mdeff

Neither package_data or data_files should be part of any "regular" project. They are ridiculously hard to get right. data_files behaves inconsistently across tools. I consider those anti-patterns in packaging [1]. Having a correct MANIFEST.in and include_package_data=True is most always the right choice.

[1] If you have the patience watch this

From <https://github.com/pypa/sampleproject/issues/30>

--@ionelmc

Tool to check the completeness of MANIFEST.in for Python packages https://pypi.python.org/pypi/check-ma…

From <https://github.com/mgedmin/check-manifest>