Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create conda package across many versions

I have a very simple Pure Python package on PyPI that I'd like to make available on binstar. My package targets Python 2.6+ and 3.2+ with a single codebase. I also expect that it works equally well on Windows as well as Unix.

Is there a simple way to comprehensively build my package and upload it to binstar for many Python versions?

I've tried a naive use of conda skeleton pypi as suggested in this article. I'd like to replicate this process across many different versions.

like image 755
MRocklin Avatar asked May 20 '14 03:05

MRocklin


People also ask

What is conda skeleton?

The conda skeleton command picks up the PyPI package metadata and prepares the conda-build recipe. The final step is to build the package itself and install it into your conda environment.

What is the difference between conda and pip?

The fundamental difference between pip and Conda packaging is what they put in packages. Pip packages are Python libraries like NumPy or matplotlib . Conda packages include Python libraries (NumPy or matplotlib ), C libraries ( libjpeg ), and executables (like C compilers, and even the Python interpreter itself).

What is conda meta Yaml?

A conda-build recipe is a flat directory that contains the following files: meta. yaml ---A file that contains all the metadata in the recipe. Only package/name and package/version are required. build.sh ---The script that installs the files for the package on macOS and Linux.

Can I use pip in conda?

Built into Anaconda, conda is a powerful package manager and environment manager that you use with command-line in the Anaconda Prompt for Windows, or in a terminal window for macOS or Linux. pip is the standard package manager for python, meaning you can use it both inside and outside of Anaconda.


1 Answers

If you want to build recipes for many different versions of the package, use the --version flag to conda skeleton pypi. I recommend using package-version as a naming convention for the recipes.

If you want to build the same package for many different Python versions, use the --py flag to conda build, like conda build --py 3.4 recipe. The flag can be specified multiple times, like conda build --py 3.3 --py 3.4 recipe, or you can use --py all to build against Python 2.6, 2.7, 3.3, and 3.4.

To convert the package to other platforms, use conda convert (see conda convert -h for usage; be sure to run conda update conda-build, as the API changed a little bit recently).

The easiest way to get the binstar uploading is to run conda config --set binstar_upload yes. This will cause conda build and conda convert to upload the packages to binstar automatically when they are done.

like image 98
asmeurer Avatar answered Oct 05 '22 07:10

asmeurer