taigw / GeodisTK

geodesic distance transform of 2d/3d images
MIT License
130 stars 35 forks source link

Adds conda and travis build configurations #7

Closed dtasev closed 3 years ago

dtasev commented 4 years ago

Hi,

This PR adds the files necessary for building the package with Anaconda, and adds a Travis CI configuration to automatically build and deploy it for Python 3.6/3.7/3.8.

This uses all the configuration already present in setup.py and does not add any new build configuration. If any build changes are made to setup.py in the future, they will be automatically picked up by the next conda build.

The build has been tested on Travis: https://travis-ci.com/github/dtasev/GeodisTK/builds

And the anaconda packages created from the build are on: https://anaconda.org/dtasev/geodistk/files. The location they are uploaded is determined by the Travis environment configuration. Instructions on what environment variables should be added for Travis to upload to your Anaconda channel are below.

To build the package locally:

  1. Install miniconda or anaconda
  2. Install conda-build inside the conda environment: conda install conda-build
    • This is for building the package, but not uploading it. For that you will also need to install anaconda
  3. From the repository root do conda build ./conda. This will create packages for Python 3.6, 3.7 and 3.8.

Todo after merging this PR to activate the Travis build and conda upload:

  1. Sign up on http://travis-ci.com/ and https://anaconda.org/
  2. Add a new API token on Anaconda by going to Settings > Access > And add a new API token here with scope Allow all operations 2.1. It may be possible to reduce the scope, but when I had just Allow all operations on Conda repositories it wasn't uploading at all! 2.2. Make sure to leave the page open or copy it somewhere temporarily
  3. Activate the Travis build for this repository, go to settings and add the following environment variables for all branches 3.1. UPLOAD_USER - this is the name of the account from anaconda.org 3.2. ANACONDA_API_TOKEN - make this for master branch only! This is the API token generated in the previous step

I would ask if you could let me know when the Travis build and conda packages have been set up for this repository, so I can delete my Anaconda package.

This work is done on initiative by, and should be attributed to, Diamond Light Source Tomography Group, Savu team (PM: Nicola Wadeson @nicwade), and further contact is best sent to either me or Daniil @dkazanc.