maphew

Leo setup.py

Leo setup.py

Thursday, October 26, 2017

1:00 PM

2017

Pre-reqs, pip installable:

 

Wheel: for building cross platform binaries (might be installed already)

Twine: for secure upload to pypi.org

PyPandoc: to convert markdown to rst for Readme.

There's an extra step to download pandoc binaries in PATH:

from pypandoc.pandoc_download import download_pandoc

download_pandoc()

 

 

 

 

Python 2.7

Pyqt4:

https://stackoverflow.com/questions/22640640/how-to-install-pyqt4-on-windows-using-pip

 

Python 3.6 and newer:

Pip install pyqt5

 

Packaging a new release for Test PyPi

 (Windows syntax)

 

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 --pre --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

 

From <https://mail.google.com/mail/u/0/#label/Leo-ed/15ec330c7994fb09>

 

 

Testing

Setup.py: change version to Release Candidate #1

 

    version = leo.core.leoVersion.version + '.rc-1',

 

python setup.py bdist_wheel

pip install dist\leo-5.6rc1-py2.py3-none-any.whl

 

where leoc

C:\OSGeo4W64\apps\Python27\Scripts\leoc.exe

where leo

C:\OSGeo4W64\apps\Python27\Scripts\leo.exe

 

leoc

reading settings in C:\OSGEO4~1\apps\Python27\lib\site-packages\leo\config\leoSettings.leo

reading settings in D:\b\.leo\myLeoSettings.leo

 

Note: sys.stdout.encoding is not UTF-8

See: https://stackoverflow.com/questions/14109024

 

Leo 5.6, build 20171024104909, Tue Oct 24 10:49:09 CDT 2017

Not running from a git repo

Python 2.7.5, PyQt version 4.8.5

Windows 7 AMD64 (build 6.1.7601) SP1

** isPython3: False

** caching enabled

 

Using default leo file name:

D:\b\.leo\workbook.leo

loadOnePlugin: can not load enabled plugin: leo.plugins.viewrendered

reading settings in C:\OSGEO4~1\apps\Python27\lib\site-packages\leo\doc\CheatSheet.leo

loadOnePlugin: can not load enabled plugin: leo.plugins.viewrendered

wrote recent file: D:\b\.leo\.leoRecentFiles.txt

 

 

 

2014

Here's my workflow (written here as a script, but really done in fits and starts):

 

:: checkout tagged release & build package

pushd b:\apps\leo-editor

git checkout tags/Leo-5.0-b2

python setup.py sdist

popd

 

:: install from built package

pip uninstall leo

pip install  b:\apps\dist\leo-5.0b2.zip

 

 

:: verify Leo works as expected

D:\>which leoc

B:\o4w\apps\Python27\Scripts\leoc.EXE

 

D:\>leoc --version

Leo 5.0b2, build 20141117141110, Mon Nov 17 14:11:10 CST 2014

 

D:\>leoc

 

** isPython3: False

Leo 5.0b2, build 20141117141110, Mon Nov 17 14:11:10 CST 2014

Not running from a git repo

Python 2.7.4, PyQt version 4.7.1

Windows 7 AMD64 (build 6.1.7601) SP1

leoID=maphew (in C:\Users\mhwilkie\dropbox\.leo)

reading settings in B:\o4w\apps\Python27\lib\site-packages\leo\config\leoSettings.leo

reading settings in C:\Users\mhwilkie\dropbox\.leo\myLeoSettings.leo

reading settings in C:\Users\mhwilkie\dropbox\.leo\workbook.leo

...snip...

wrote recent file: C:\Users\mhwilkie\dropbox\.leo\.leoRecentFiles.txt

 

:: rebuild package and upload

pushd b:\apps\leo-editor

python setup.py sdist upload

popd

 

:: inspect public page for problems

start https://pypi.python.org/pypi/leo

 

:: verbosely install from pypi.org

pip uninstall leo

pip -v install -pre leo

 

:: repeat verify run leo works.

 

 

From <https://groups.google.com/forum/#!msg/leo-editor/Mm0hFBIR81Q/0v217II0kPIJ>

 

 

 

Created with OneNote.