[CONDA] Create conda package across many versions

0 views
Skip to first unread message

Hai Nguyen

unread,
Dec 3, 2016, 12:09:55 AM12/3/16
to Anaconda - Public
hi all,

it's like a puzzle to me that I do not know how to build my package with a given python
version and then just convert it to another python package version? (e.g python 2.7 to 3.4).

One solution is to write my own script to unpack the conda-built bz2 file, update some
meta data, ... then make a new bz2 file.

My package can be used with whatever version. 

Is there any document/link/solution I should read? thanks

PS: I know I can use
conda build recipe --py 2.7 
to specify version but I don't want to repeat that steps for other python versions (given that it would take like 30 minutes to build my package).

Any insight would be really helpful. thanks

Hai

Michael Sarahan

unread,
Dec 3, 2016, 11:50:38 AM12/3/16
to Anaconda - Public
I think that is what conda convert is for: http://conda.pydata.org/docs/commands/build/conda-convert.html

However, I'm not sure it's going to help you.  If you package takes 30 minutes to build, I'm pretty sure you're compiling something.  Python's API changes over time, so your binaries compiled for python 2.7 are probably not compatible with python 3.x.  You can certainly try, though.

--
Anaconda Community Support Group Brought to you by Continuum Analytics
---
You received this message because you are subscribed to the Google Groups "Anaconda - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to anaconda+unsubscribe@continuum.io.
To post to this group, send email to anac...@continuum.io.
Visit this group at https://groups.google.com/a/continuum.io/group/anaconda/.

Ilan Schnell

unread,
Dec 3, 2016, 5:14:45 PM12/3/16
to Anaconda
Even if no C extensions are compiled, the package might use the 2to3 tool to generate Python code at build time.  In general, it is safest to build against the different Python versions.

Hai Nguyen

unread,
Dec 3, 2016, 11:11:58 PM12/3/16
to Anaconda - Public
thanks Michael and IIan for your feedback

@Micheal: I am not worry about Python's API since our packages are Fortran/C/C++. Just use conda for convenient binary distribution.
The only thing Python have to do is to set some environments at run time

os.environ['....'] = ...

oh, I think I just need to remove python from build requirement and only add python for testing.
Not sure if that can trick conda to not to add python metadata.

BTW, thanks again. Hai

Ilan Schnell

unread,
Dec 4, 2016, 1:24:49 AM12/4/16
to Anaconda
conda-build will only add Python to the metadata if it is listed as a runtime dependency.  So listing Python as a test requirement only should do the trick.

Hai Nguyen

unread,
Dec 4, 2016, 1:53:49 PM12/4/16
to Anaconda - Public
On Sun, Dec 4, 2016 at 1:24 AM, Ilan Schnell <il...@continuum.io> wrote:
conda-build will only add Python to the metadata if it is listed as a runtime dependency.  So listing Python as a test requirement only should do the trick.


thanks Ilan
Reply all
Reply to author
Forward
0 new messages