Skip to content
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

Add package to allow noarch python packages to depend on cupy #26116

Closed
wants to merge 13 commits into from
27 changes: 27 additions & 0 deletions recipes/cupyifcudaavailable/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Copyright (c) 2024, conda-forge
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

* Neither the name of staged-recipes nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3 changes: 3 additions & 0 deletions recipes/cupyifcudaavailable/conda_build_config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
with_cuda:
- true
- false
31 changes: 31 additions & 0 deletions recipes/cupyifcudaavailable/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package:
name: cupyifcudaavailable
version: "1.0.0"

build:
# Tell the solver to strongly prefer the cuda installation
number: 0 # [not with_cuda]
number: 300 # [ with_cuda]
noarch: generic
string: cuda_{{ PKG_BUILDNUM }} # [with_cuda]
string: cpu_{{ PKG_BUILDNUM }} # [not with_cuda]

requirements: # [with_cuda]
run: # [with_cuda]
- __cuda # [with_cuda]
- cupy # [wtih_cuda]
hmaarrfk marked this conversation as resolved.
Show resolved Hide resolved

# CIs don't really have cuda, and thus would fail at resolving __cuda
hmaarrfk marked this conversation as resolved.
Show resolved Hide resolved
test: # [not with_cuda]
commands: # [not with_cuda]
- echo "no tests for this package" # [not with_cuda]

about:
home: https://github.com/conda-forge/cupyifcudaavailable-feedstock
license: BSD-3-Clause
license_file: LICENSE
summary: 'Allows noarch packages to depend on cupy without large downloads'

extra:
recipe-maintainers:
- hmaarrfk