From f2c4a2232fbe186a03176f9548952d529f818a9a Mon Sep 17 00:00:00 2001 From: Ben Date: Mon, 13 Apr 2020 14:08:06 +0200 Subject: [PATCH 1/3] updated version and installation notes --- README.md | 13 +++++-------- setup.py | 2 +- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 2bbea1a..a5c49e1 100644 --- a/README.md +++ b/README.md @@ -10,18 +10,15 @@ Note: There are many normalization and phase conventions for both the real and c - Fit Harmonic Exponential Families on the sphere (probability module; not sure code is still working) # Installation -To install, clone the repository and run: +lie_learn can be installed from pypi using: ``` -python setup.py install +pip install lie_learn ``` -Or run: -``` -pip install git+https://github.com/AMLab-Amsterdam/lie_learn -``` - -This should download the J matrices and compile Cython modules. +Although cython is not a necesary dependency, if you have cython installed, cython will write new versions of the `*.c +` files before compiling them into `*.so` during installation. + # Feedback For questions and comments, feel free to contact Taco Cohen (http://ta.co.nl). diff --git a/setup.py b/setup.py index 347a925..60c2673 100644 --- a/setup.py +++ b/setup.py @@ -30,7 +30,7 @@ setup( name='lie_learn', - version="0.0.1-rc.0", + version="0.0.1", description="A python package that knows how to do various tricky computations related to Lie groups and " "manifolds (mainly the sphere S2 and rotation group SO3).", url="https://github.com/AMLab-Amsterdam/lie_learn", From 662e4bd37c6d8dff2fadab4f9dd55d82f870337b Mon Sep 17 00:00:00 2001 From: Ben Date: Mon, 13 Apr 2020 14:40:30 +0200 Subject: [PATCH 2/3] a little more install info, fixed package --- README.md | 5 +++-- setup.cfg | 5 ----- setup.py | 4 +++- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index a5c49e1..8e9d217 100644 --- a/README.md +++ b/README.md @@ -16,8 +16,9 @@ lie_learn can be installed from pypi using: pip install lie_learn ``` -Although cython is not a necesary dependency, if you have cython installed, cython will write new versions of the `*.c -` files before compiling them into `*.so` during installation. +Although cython is not a necessary dependency, if you have cython installed, cython will write new versions of the `*.c +` files before compiling them into `*.so` during installation. To use lie_learn, you will need a c compiler which is + available to python setuptools. # Feedback diff --git a/setup.cfg b/setup.cfg index b238133..8183238 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,7 +1,2 @@ [metadata] license_files = LICENSE - -[options] -setup_requires = - numpy ; python_version>="3.0" - numpy<1.17 ; python_version<"3.0" diff --git a/setup.py b/setup.py index 60c2673..72f7517 100644 --- a/setup.py +++ b/setup.py @@ -30,7 +30,7 @@ setup( name='lie_learn', - version="0.0.1", + version="0.0.1.post1", description="A python package that knows how to do various tricky computations related to Lie groups and " "manifolds (mainly the sphere S2 and rotation group SO3).", url="https://github.com/AMLab-Amsterdam/lie_learn", @@ -40,7 +40,9 @@ setup_requires=setup_requires_list, install_requires=[ 'requests', + 'numpy ; python_version>="3.0"', 'scipy ; python_version>="3.0"', + 'numpy<1.17 ; python_version<"3.0"', 'scipy<1.3 ; python_version<"3.0"', ], include_package_data=True, From 676355ab18ea50ce90e6d1838b08e021d570338c Mon Sep 17 00:00:00 2001 From: Ben Date: Mon, 27 Apr 2020 10:45:13 +0200 Subject: [PATCH 3/3] added manylinux distribution information. --- MANYLINUX.md | 84 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 MANYLINUX.md diff --git a/MANYLINUX.md b/MANYLINUX.md new file mode 100644 index 0000000..84b5ff0 --- /dev/null +++ b/MANYLINUX.md @@ -0,0 +1,84 @@ +[Install docker](https://docs.docker.com/get-docker/). + +Get the [manylinux docker environment](https://github.com/pypa/manylinux). +At the time of this writing, `manylinux1` is compatible; however, I used `manylinx2014`. +There is a tool which will label the manylinux binary with the oldest compatible standard. + +```bash +docker pull quay.io/pypa/manylinux2014_x86_64 +``` + +Run an interactive bash shell in the manylinux docker environment. + +```bash +docker run -it quay.io/pypa/manylinux2014_x86_64 /bin/bash +``` + +Inside the interactive bash shell for the docker environment, download lie_learn and change to the source directory. + +```bash +git clone https://github.com/AMLab-Amsterdam/lie_learn.git +cd lie_learn +``` + +Create wheels. You have to determine which versions of python are appropriate. + +```bash +/opt/python/cp35-cp35m/bin/python setup.py bdist_wheel +/opt/python/cp36-cp36m/bin/python setup.py bdist_wheel +/opt/python/cp37-cp37m/bin/python setup.py bdist_wheel +/opt/python/cp38-cp38/bin/python setup.py bdist_wheel +``` + +Use auditwheel to check for success and modify the binaries to be labeled with the oldest compatible standard (lowest + priority). + +```bash +auditwheel repair ./dist/lie_learn-0.0.1.post1-cp35-cp35m-linux_x86_64.whl -w ./manylinux +auditwheel repair ./dist/lie_learn-0.0.1.post1-cp36-cp36m-linux_x86_64.whl -w ./manylinux +auditwheel repair ./dist/lie_learn-0.0.1.post1-cp37-cp37m-linux_x86_64.whl -w ./manylinux +auditwheel repair ./dist/lie_learn-0.0.1.post1-cp38-cp38-linux_x86_64.whl -w ./manylinux +``` + +Open a new terminal window (host environment) and get the running docker `CONTAINER ID`. + +```bash +docker ps +``` + +yields + +``` +CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES +8e2b2c3baa8e quay.io/pypa/manylinux2014_x86_64 "/bin/bash" 30 minutes ago Up 30 minutes charming_shannon +``` + +In my case, the `CONTAINER ID` is `8e2b2c3baa8e`. +In the new terminal window, copy the manylinux wheels from the running container to a folder you'll remember. + +```bash +mkdir ~/manylinux +docker cp 8e2b2c3baa8e:/lie_learn/manylinux/lie_learn-0.0.1.post1-cp35-cp35m-manylinux1_x86_64.whl ~/manylinux/ +docker cp 8e2b2c3baa8e:/lie_learn/manylinux/lie_learn-0.0.1.post1-cp36-cp36m-manylinux1_x86_64.whl ~/manylinux/ +docker cp 8e2b2c3baa8e:/lie_learn/manylinux/lie_learn-0.0.1.post1-cp37-cp37m-manylinux1_x86_64.whl ~/manylinux/ +docker cp 8e2b2c3baa8e:/lie_learn/manylinux/lie_learn-0.0.1.post1-cp38-cp38-manylinux1_x86_64.whl ~/manylinux/ +``` + +First do a test by uploading to test pypi. + +```bash +twine upload --repository-url https://test.pypi.org/legacy/ ~/manylinux/* +``` + +Try downloading and testing `lie_learn` from there before proceeding. +This is easier said than done. You will need to download all of the dependencies manually then download from test +pypi without any dependencies using +`pip install --no-cache-dir --index-url https://test.pypi.org/simple/ --no-deps lie_learn`. + +Once you know it's working, upload the wheels to pypi with twine. + +```bash +twine upload ~/manylinux/* +``` + +For a bit more info, another useful resource is https://opensource.com/article/19/2/manylinux-python-wheels. \ No newline at end of file