Skip to content

Commit

Permalink
Merge pull request #1 from conda-forge/main
Browse files Browse the repository at this point in the history
Merge upstream
  • Loading branch information
zschira committed Nov 22, 2022
2 parents ffde82e + 1c8525d commit 9f3054c
Show file tree
Hide file tree
Showing 30 changed files with 551 additions and 234 deletions.
2 changes: 1 addition & 1 deletion .azure-pipelines/azure-pipelines-osx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
- job: osx
condition: not(eq(variables['Build.SourceBranch'], 'refs/heads/main'))
pool:
vmImage: macOS-10.15
vmImage: macOS-11
strategy:
matrix:
osx_64:
Expand Down
24 changes: 18 additions & 6 deletions .azure-pipelines/azure-pipelines-win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,27 @@ jobs:
matrix:
win:
CONFIG: win64
CF_MAX_PY_VER: 37
timeoutInMinutes: 360
steps:
- task: CondaEnvironment@1
- task: PythonScript@0
displayName: 'Download Miniforge'
inputs:
packageSpecs: 'python=3.9 conda-build>=3.18 conda>4.7.12 conda-forge::conda-forge-ci-setup=3 networkx=2.4 conda-forge-pinning boa' # Optional
installOptions: "-c conda-forge"
updateConda: true
displayName: Install conda-build and activate environment
scriptSource: inline
script: |
import urllib.request
url = 'https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-Windows-x86_64.exe'
path = r"$(Build.ArtifactStagingDirectory)/Miniforge.exe"
urllib.request.urlretrieve(url, path)
- script: |
start /wait "" %BUILD_ARTIFACTSTAGINGDIRECTORY%\Miniforge.exe /InstallationType=JustMe /RegisterPython=0 /S /D=C:\Miniforge
displayName: Install Miniforge
- powershell: Write-Host "##vso[task.prependpath]C:\Miniforge\Scripts"
displayName: Add conda to PATH

- script: |
call activate base
mamba.exe install 'python=3.9' 'conda-build>=3.18' 'conda>4.7.12' 'conda-forge-ci-setup=3' 'networkx=2.4' conda-forge-pinning boa -c conda-forge --strict-channel-priority --yes
displayName: Install conda-build
- script: set PYTHONUNBUFFERED=1
displayName: Set PYTHONUNBUFFERED
Expand Down
31 changes: 23 additions & 8 deletions .ci_support/build_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@ def get_config_name(arch):


def build_all(recipes_dir, arch):
folders = os.listdir(recipes_dir)
old_comp_folders = []
new_comp_folders = []
folders = list(filter(lambda d: os.path.isdir(os.path.join(recipes_dir, d)), os.listdir(recipes_dir)))
if not folders:
print("Found no recipes to build")
return
Expand All @@ -60,6 +58,7 @@ def build_all(recipes_dir, arch):

deployment_version = (0, 0)
sdk_version = (0, 0)
channel_urls = None
for folder in folders:
cbc = os.path.join(recipes_dir, folder, "conda_build_config.yaml")
if os.path.exists(cbc):
Expand All @@ -79,36 +78,49 @@ def build_all(recipes_dir, arch):
version = tuple([int(x) for x in version.split('.')])
sdk_version = max(sdk_version, deployment_version, version)

if 'channel_sources' not in text:
new_channel_urls = ['local', 'conda-forge']
else:
config = load(text, Loader=BaseLoader)
new_channel_urls = ['local'] + config['channel_sources'][0].split(',')
if channel_urls is None:
channel_urls = new_channel_urls
elif channel_urls != new_channel_urls:
raise ValueError(f'Detected different channel_sources in the recipes: {channel_urls} vs. {new_channel_urls}. Consider submitting them in separate PRs')

if channel_urls is None:
channel_urls = ['local', 'conda-forge']

with open(variant_config_file, 'r') as f:
variant_text = ''.join(f.readlines())

if deployment_version != (0, 0):
deployment_version = '.'.join([str(x) for x in deployment_version])
print("Overriding MACOSX_DEPLOYMENT_TARGET to be ", deployment_version)
variant_text += '\nMACOSX_DEPLOYMENT_TARGET:\n'
variant_text += f'- {deployment_version}\n'
variant_text += f'- "{deployment_version}"\n'

if sdk_version != (0, 0):
sdk_version = '.'.join([str(x) for x in sdk_version])
print("Overriding MACOSX_SDK_VERSION to be ", sdk_version)
variant_text += '\nMACOSX_SDK_VERSION:\n'
variant_text += f'- {sdk_version}\n'
variant_text += f'- "{sdk_version}"\n'

with open(variant_config_file, 'w') as f:
f.write(variant_text)

if platform == "osx" and (sdk_version != (0, 0) or deployment_version != (0, 0)):
subprocess.run("run_conda_forge_build_setup", shell=True, check=True)

print("Building {} with conda-forge/label/main".format(','.join(folders)))
channel_urls = ['local', 'conda-forge']
if 'conda-forge' not in channel_urls:
raise ValueError('conda-forge needs to be part of channel_sources')
print("Building {} with {}".format(','.join(folders), ','.join(channel_urls)))
build_folders(recipes_dir, folders, arch, channel_urls)


def get_config(arch, channel_urls):
exclusive_config_files = [os.path.join(conda_build.conda_interface.root_dir,
'conda_build_config.yaml')]
platform = get_host_platform()
script_dir = os.path.dirname(os.path.realpath(__file__))
# since variant builds override recipe/conda_build_config.yaml, see
# https://github.com/conda/conda-build/blob/3.21.8/conda_build/variants.py#L175-L181
Expand Down Expand Up @@ -168,6 +180,9 @@ def check_recipes_in_correct_dir(root_dir, correct_dir):
from pathlib import Path
for path in Path(root_dir).rglob('meta.yaml'):
path = path.absolute().relative_to(root_dir)
if path.parts[0] == 'build_artifacts':
# ignore pkg_cache in build_artifacts
continue
if path.parts[0] != correct_dir:
raise RuntimeError(f"recipe {path.parts} in wrong directory")
if len(path.parts) != 3:
Expand Down
2 changes: 1 addition & 1 deletion .ci_support/linux64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ target_platform:
channel_sources:
- conda-forge
docker_image:
- quay.io/condaforge/linux-anvil-comp7
- quay.io/condaforge/linux-anvil-cos7-x86_64
cuda_compiler_version:
- None
1 change: 1 addition & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ Checklist
- [ ] Source is from official source.
- [ ] Package does not vendor other packages. (If a package uses the source of another package, they should be separate packages or the licenses of all packages need to be packaged).
- [ ] If static libraries are linked in, the license of the static library is packaged.
- [ ] Package does not ship static libraries. If static libraries are needed, [follow CFEP-18](https://github.com/conda-forge/cfep/blob/main/cfep-18.md).
- [ ] Build number is 0.
- [ ] A tarball (`url`) rather than a repo (e.g. `git_url`) is used in your recipe (see [here](https://conda-forge.org/docs/maintainer/adding_pkgs.html#build-from-tarballs-not-repos) for more details).
- [ ] GitHub users listed in the maintainer section have posted a comment confirming they are willing to be listed there.
Expand Down
36 changes: 25 additions & 11 deletions .github/workflows/automate-review-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,18 +89,32 @@
github-token: ${{ secrets.GH_TOKEN }}
script: |
console.log(`Label was removed by ${context.payload.sender.login}`);
const membership = github.rest.teams.getMembershipForUserInOrg({
org: 'conda-forge',
team_slug: 'staged-recipes',
username: context.payload.sender.login,
});
return membership.then((result) => {
if (result.status == 200 && result.data.state == 'active'){
return true;
} else {
console.log(result);
return false;
let memberships = [];
for (const team of ['staged-recipes', 'core']) {
const membership = github.rest.teams.getMembershipForUserInOrg({
org: 'conda-forge',
team_slug: team,
username: context.payload.sender.login,
});
memberships.push(membership.then((result) => {
if (result.status == 200 && result.data.state == 'active') {
console.log('User is authorized');
return true;
} else {
console.log('User is nonactive');
return false;
}
}).catch((error) => {
// Non-membership raises an HttpError
return false;
}));
}
return Promise.all(memberships).then((values) => {
let is_authorized = false;
for (const m of values) {
is_authorized = is_authorized || m;
}
return is_authorized;
});
- name: add-labels
if: >
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/create_feedstocks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
echo "Creating feedstocks from the recipe(s)."
source ./.travis_scripts/create_feedstocks
source ./.github/workflows/scripts/create_feedstocks
env:
STAGING_BINSTAR_TOKEN: ${{ secrets.STAGING_BINSTAR_TOKEN }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ curl -L https://github.com/conda-forge/miniforge/releases/latest/download/Mambaf
bash ~/Mambaforge.sh -b -p ~/Mambaforge
touch ~/Mambaforge/conda-meta/pinned
(
source ~/Mambaforge/bin/activate root
source ~/Mambaforge/bin/activate base

# Configure conda.
echo ""
Expand All @@ -32,7 +32,7 @@ touch ~/Mambaforge/conda-meta/pinned
conda config --set add_pip_as_python_dependency false

unset conda
mamba update -n root --yes --quiet conda mamba
mamba update -n base --yes --quiet conda mamba
)
source ~/Mambaforge/bin/activate root

Expand All @@ -51,4 +51,4 @@ mamba info
conda config --get
git config --global init.defaultBranch main

python .travis_scripts/create_feedstocks.py
python .github/workflows/scripts/create_feedstocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
# Enable DEBUG to run the diagnostics, without actually creating new feedstocks.
DEBUG = False

REPO_SKIP_LIST = ["core", "bot", "staged-recipes", "arm-arch", "systems"]
REPO_SKIP_LIST = ["core", "bot", "staged-recipes", "arm-arch", "systems", "ctx"]

recipe_directory_name = 'recipes'

Expand Down Expand Up @@ -225,6 +225,9 @@ def write_token(name, token):
for recipe_dir, name in list_recipes():
if name.lower() in REPO_SKIP_LIST:
continue
if name.lower() == "ctx":
sys.exit(1)

feedstock_dir = os.path.join(feedstocks_dir, name + '-feedstock')
print('Making feedstock for {}'.format(name))
try:
Expand Down
6 changes: 5 additions & 1 deletion .scripts/build_steps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ channels:
- conda-forge
conda-build:
root-dir: /home/conda/staged-recipes/build_artifacts
root-dir: /home/conda/staged-recipes/build_artifacts
pkgs_dirs:
- /home/conda/staged-recipes/build_artifacts/pkg_cache
- /opt/conda/pkgs
show_channel_urls: true
Expand Down
14 changes: 10 additions & 4 deletions .scripts/run_osx_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,17 @@ mamba install -n base --yes --quiet "conda>4.7.12" conda-forge-ci-setup=3.* cond

echo -e "\n\nSetting up the condarc and mangling the compiler."
setup_conda_rc ./ ./recipes ./.ci_support/${CONFIG}.yaml
mangle_compiler ./ ./recipes .ci_support/${CONFIG}.yaml
if [[ "${CI:-}" != "" ]]; then
mangle_compiler ./ ./recipe .ci_support/${CONFIG}.yaml
fi

echo -e "\n\nMangling homebrew in the CI to avoid conflicts."
/usr/bin/sudo mangle_homebrew
/usr/bin/sudo -k
if [[ "${CI:-}" != "" ]]; then
echo -e "\n\nMangling homebrew in the CI to avoid conflicts."
/usr/bin/sudo mangle_homebrew
/usr/bin/sudo -k
else
echo -e "\n\nNot mangling homebrew as we are not running in CI"
fi

echo -e "\n\nRunning the build setup script."
source run_conda_forge_build_setup
Expand Down
41 changes: 0 additions & 41 deletions .travis_scripts/build_all

This file was deleted.

27 changes: 0 additions & 27 deletions LICENSE.txt

This file was deleted.

21 changes: 21 additions & 0 deletions recipes/gcloud-aio-auth/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2017 TalkIQ

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

0 comments on commit 9f3054c

Please sign in to comment.