-
Notifications
You must be signed in to change notification settings - Fork 428
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build wheels with conda-build #1330
Conversation
Add a --wheel argument to the 'conda build' command that when included uses conda build to create and test a Python wheel file.
The following meta.yaml file (based on the conda-forge jinja2-feedstock) can be used to create a Python wheel for Jinja2: {% set version="2.8" %}
package:
name: jinja2
version: {{ version }}
source:
fn: Jinja2-{{ version }}.tar.gz
url: https://pypi.io/packages/source/J/Jinja2/Jinja2-{{ version }}.tar.gz
md5: edb51693fe22c53cee5403775c71a99e
build:
script: python setup.py bdist_wheel
requirements:
build:
- python
- setuptools
- wheel
- markupsafe
run:
- python
- setuptools
- wheel
- markupsafe
test:
imports:
- jinja2
about:
home: http://jinja.pocoo.org
license: 3-Clause BSD The build is run as follows:
|
A preprocessing selector for "wheel" builds would be a good addition if this is accepted as is so wheel only requirements or build scripts can be specified in the recipe metadata. |
Very interesting. I think we have quite a bit of work before this is final, but it's a great start. In particular:
Thanks for putting this forward! Do you want to iterate on it here more, or would you prefer that I merge and take over? |
I'm happy to iterate on this PR. I agree that there are many things than can (and should) be corrected before this is finalized.
I would like this too, but I think there are cases where just running
Some of utilities could be included in conda build itself but I think a more flexible (and likely maintainable) options is to allow a build script to call out to other tools that might be needed. Perhaps adding a
Agreed, I'll work on changing this. Do you have an issue or alternative to storing the path to the produced whl file in the config? |
Yes, definitely. The tricky part is when the external tool gets called. There can and probably should be several different hooks. For python, I think we can get away with jinja stuff pretty well: in meta.yaml:
and we can have conda-build set that to install, or (install + setuptools junk) or bdist wheel, as necessary. Now, the interesting question is whether the collection of files is something that should be packaged up (this is our current assumption), or something that is a package itself, and should be passed through.
Not especially, though I think answering the question of whether the list of changed files is a collection of things to be packaged or actual packages to be collected sort of obviates this. |
39539a8
to
07ceddd
Compare
I adjusted the wheel building logic to store the Added a wheel selector which can be used in the {% set version="2.8" %}
{% set setup_py_command="bdist_wheel" %} # [wheel]
{% set setup_py_command="install --single-version-externally-managed --record=record.txt" %} # [not wheel]
package:
name: jinja2
version: {{ version }}
source:
fn: Jinja2-{{ version }}.tar.gz
url: https://pypi.io/packages/source/J/Jinja2/Jinja2-{{ version }}.tar.gz
md5: edb51693fe22c53cee5403775c71a99e
build:
script: python setup.py {{ setup_py_command }}
requirements:
build:
- python
- setuptools
- wheel # [wheel]
- markupsafe
run:
- python
- setuptools
- wheel # [wheel]
- markupsafe
test:
imports:
- jinja2
about:
home: http://jinja.pocoo.org
license: 3-Clause BSD |
A number of output formats (wheels, rpms, deb) produce a single file archive which is a collection of files. I'm guessing conda build may in the future want to to produce and handle these formats so being able to pass these file through seems to make sense to me. Copying them somewhere under the conda build output directory also makes sense to me, although the same directory as as the conda packages, as this PR is currently doing, might not be the best solutions. Would a CONDA_BLD_PATH/whl directory be more reasonable? |
Docs PR at conda/conda-docs#388 |
Hi there, thank you for your contribution! This pull request has been automatically locked because it has not had recent activity after being closed. Please open a new issue or pull request if needed. Thanks! |
Add a --wheel argument to the 'conda build' command that when included uses
conda build to create and test a Python wheel file.
closes #1294