-
-
Notifications
You must be signed in to change notification settings - Fork 170
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
Implement conda-build 3 support; change to pytest #625
Conversation
…ix linter on jinja2 functions
998e22f
to
39330a7
Compare
I have some extra stuff to replace travis with circle CI. I didn't include it here to limit the scope of this PR. If you guys want it, let me know. |
39330a7
to
454b1d0
Compare
@@ -47,12 +47,15 @@ install: | |||
{% if build_setup -%} | |||
{{ build_setup }}{% endif %} | |||
|
|||
# testing purposes: get conda-build from defaults | |||
- cmd: conda install -n root --quiet --yes -c defaults conda-build |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove before merging
@@ -72,9 +59,12 @@ conda install --yes --quiet conda-forge-build-setup | |||
{% if build_setup -%} | |||
{{ build_setup }}{% endif -%} | |||
|
|||
conda build /recipe_root --quiet || exit 1 | |||
# testing purposes: get conda-build from defaults | |||
conda install -n root --quiet --yes -c defaults conda-build |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove before merging
@@ -68,9 +63,10 @@ install: | |||
conda install --yes --quiet conda-forge-build-setup | |||
{% if build_setup -%} | |||
{{ build_setup }}{% endif %} | |||
conda install -n root --quiet --yes -c defaults conda-build |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove before merging
conda config --set show_channel_urls true | ||
conda install --yes --quiet conda-forge-build-setup | ||
source run_conda_forge_build_setup | ||
conda install -n root --quiet --yes -c defaults conda-build |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can remove before merging, but it doesn't matter much
- cmd: run_conda_forge_build_setup | ||
|
||
# testing purposes: get conda-build from defaults | ||
- cmd: conda install -n root --quiet --yes -c defaults conda-build |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can remove before merging, but it doesn't matter much
source run_conda_forge_build_setup | ||
|
||
# testing purposes: get conda-build from defaults | ||
conda install -n root --quiet --yes -c defaults conda-build |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can remove before merging, but it doesn't matter much
9a643ce
to
fcdc5c3
Compare
fcdc5c3
to
f58fd4c
Compare
Thanks @msarahan, I tried this out in some feedstocks. (Using conda-build 3.1.1 and conda 4.3.29) Some observations
|
How were you introducing a build matrix? Both win-32 and different python versions are things that you need to set in some conda_build_config.yaml file, and then point conda-smithy at that file with the If you don't use a conda_build_config.yaml file, yeah, you won't get a matrix. |
Ah. That's it. How about if no yaml file is given, checking whether |
Yes, that's one way to do it. I'm honestly totally agnostic on that. I put up the conda-forge-pinning package PR on staged recipes as a straw man to talk about. It could also be downloaded directly, as is done at https://github.com/conda-forge/conda-smithy/blob/master/conda_smithy/configure_feedstock.py#L117 I'd really rather not try to perfect the workflow with this PR. It is already very large. Let's use this PR to talk about the direction to head, and we can build on it in future work. |
|
|
command history shows but given the addition of conda-forge-pinning, you'd change that last part to point to wherever you have the one from conda-forge-pinning installed. It looks like I had hacked together a one-off loop over python versions that I never committed and later removed. |
Would you mind committing a working file with it? We can certainly have an option to disable using |
@jakirkham For the click feedstock, it's really nothing more than
That file is written with a test fixture, py_recipe: https://github.com/conda-forge/conda-smithy/pull/625/files#diff-484462fced51d1a06b1d93b4a44dd535R113 which in turn uses another fixture: https://github.com/conda-forge/conda-smithy/pull/625/files#diff-484462fced51d1a06b1d93b4a44dd535R45 I have added a new option that I think captures your request of an option to help people avoid accidentally using the wrong config files. See conda/conda-build#2661 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@msarahan, this looks good to me. One more thing, would it be possible to remove unneeded packages from pin_run_as_build
when saving the matrix files? (We can merge this PR and do it another PR if you like)
For how to use conda-forge-pinning, I was thinking of using conda-forge-pinning as a dependency of conda-smithy and then checking that conda-forge-pinning and conda-smithy itself is up-to-date. I'll do that next weekend if nobody beats me to it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should you call this again here:
conda_smithy/configure_feedstock.py
Outdated
def _render_ci_provider(provider_name, jinja_env, forge_config, forge_dir, platform, arch, | ||
fast_finish_text, platform_target_path, platform_template_file, | ||
platform_specific_setup, keep_noarch=False, extra_platform_files=None): | ||
metas = conda_build.api.render(os.path.join(forge_dir, 'recipe'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@msarahan, shouldn't the channel urls be sent to the render method?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
they're in forge_config? Yes, they should be passed in here. Please confirm where they are, and I'll add them in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's in forge_config['channels']['sources']
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a list with highest order at the beginning
I've got a working implementation for this. I'll send it separate after this is merged. This PR is huge enough as it is. |
# the matrix should be consolidated among all outputs, as well as the top-level | ||
# reqs. Only the top-level reqs should have indedependent config files, | ||
# though - loops within outputs are contained in those top-level configs. | ||
assert len(os.listdir(matrix_dir)) == 13 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be 25? Tests failing because of this. (25 = 2 (libpq) * 2 (libpng) * 2 (jpeg) * 3 (os) + 1)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems to be a problem in conda-build. The matrix has two levels. Things at the "top" level are things that affect the top-level recipe. Essentially all of conda-forge recipes are just simply top-level recipes. There's also output-level stuff. In the recipe, take a look at where libpng, libpq, and jpeq occur. libpng and libpq are top-level, but jpeg is output-level. As an output-level thing, it should not enter into the outer loop, but instead should be a loop inside the build (a list in the generated conda_build_config.yaml), and ultimately would be a loop within a single build job on the given CI worker.
I hope that helps clarify things. The test is correct, but the conda-build behavior is wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the explanation. Makes sense to me.
Thanks for working on the Have you looked at PR ( conda/conda-build#2661 )? If you haven't, would suggest taking a look. I think that PR provides the right option for using |
Thanks for reminding me. I'll fix that as well, but not in this PR |
Thanks for taking a look @isuruf. Good comments, and good catch on the conda-build matrix issue. I'll fix that as soon as I can manage. I don't have a strong opinion on whether it should block merging this PR or not. It won't affect anyone right now - just an annoying detail for me, and would make CIs less efficient for recipes with multiple outputs. |
matrix_folder = os.path.join(feedstock_dir, 'ci_support', 'matrix') | ||
|
||
initial_commit = subprocess.check_output(['git', 'rev-parse', 'HEAD'], | ||
cwd=feedstock_dir).strip() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This git command is working on the conda-smithy
git repo right? It just reset my changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hope not - it should be in the repo that lives within the conda-smithy repo, but it may have gotten mixed up. Sorry.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not this line. There's a git reset --hard line below
woohoo! thanks @isuruf! Let's try to have a meeting sometime soon to talk about what the next steps are, and who can help in what way. |
Thank you very much for the PR @msarahan. And @jakirkham and @mingwandroid for the review I've opened #650, #651 for some comments I left here and added them to 3.0.0 milestone due a week from now. |
Replacing #618 because I force-pushed and github won't let me reopen that PR.
There are 2 major changes here:
platform
andarch
arguments that achieve the same purpose.circle_python2.7.yaml
ortravis_r_base3.4.2.yaml
.This implies that pinning updates should be done by maintaining a central conda_build_config.yaml file, and using that when performing init or rerender operations. Each feedstock will then carry its own subset of this configuration until it gets re-rendered.
The configure_feedstock tests ended up being so completely different that I needed to rewrite them. Since I am much more familiar with pytest fixtures, and because pytest seems prominent, I switched over to that. I hope that's OK. Pytest still runs the old test suite as well.