Skip to content

Commit

Permalink
Merge pull request #1 from conda-forge/main
Browse files Browse the repository at this point in the history
get changes from staged recipes
  • Loading branch information
iulusoy authored Apr 17, 2023
2 parents bdfd302 + 51ff3fb commit 12c39e7
Show file tree
Hide file tree
Showing 13 changed files with 183 additions and 61 deletions.
6 changes: 2 additions & 4 deletions .ci_support/build_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,9 @@ def get_config(arch, channel_urls):
if os.path.exists(exclusive_config_file):
exclusive_config_files.append(exclusive_config_file)

error_overlinking = (get_host_platform() != "win")

config = conda_build.api.Config(
arch=arch, exclusive_config_files=exclusive_config_files,
channel_urls=channel_urls, error_overlinking=error_overlinking,
channel_urls=channel_urls, error_overlinking=True,
)
return config

Expand Down Expand Up @@ -183,7 +181,7 @@ def check_recipes_in_correct_dir(root_dir, correct_dir):
if path.parts[0] == 'build_artifacts':
# ignore pkg_cache in build_artifacts
continue
if path.parts[0] != correct_dir:
if path.parts[0] != correct_dir and path.parts[0] != "broken-recipes":
raise RuntimeError(f"recipe {path.parts} in wrong directory")
if len(path.parts) != 3:
raise RuntimeError(f"recipe {path.parts} in wrong directory")
Expand Down
17 changes: 8 additions & 9 deletions .ci_support/compute_build_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,15 +253,14 @@ def match_peer_job(target_matchspec, other_m, this_m=None):
match_dict = {'name': other_m.name(),
'version': other_m.version(),
'build': _fix_any(other_m.build_id(), other_m.config), }
if conda_interface.conda_43:
match_dict = conda_interface.Dist(name=match_dict['name'],
dist_name='-'.join((match_dict['name'],
match_dict['version'],
match_dict['build'])),
version=match_dict['version'],
build_string=match_dict['build'],
build_number=int(other_m.build_number() or 0),
channel=None)
match_dict = conda_interface.Dist(name=match_dict['name'],
dist_name='-'.join((match_dict['name'],
match_dict['version'],
match_dict['build'])),
version=match_dict['version'],
build_string=match_dict['build'],
build_number=int(other_m.build_number() or 0),
channel=None)
matchspec_matches = target_matchspec.match(match_dict)

variant_matches = True
Expand Down
2 changes: 2 additions & 0 deletions .ci_support/linux64.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
cdt_name:
- cos7
c_compiler:
- gcc
cxx_compiler:
Expand Down
33 changes: 5 additions & 28 deletions .github/workflows/automate-review-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
pull_request_target:
types: [unlabeled]

permissions:
issues: write # for adding label to an issue
pull-requests: write # for adding label to a pr

jobs:

add-review-team-label:
Expand Down Expand Up @@ -86,36 +90,9 @@
id: check_team_review
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GH_TOKEN }}
script: |
console.log(`Label was removed by ${context.payload.sender.login}`);
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;
});
return true;
- name: add-labels
if: >
(steps.check_team_review.outputs.result == 'true')
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/correct_directory.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: directory_linter

on:
pull_request_target:
paths:
- 'recipes/*.yml'
- 'recipes/*.yaml'

jobs:
comment:
name: Notify user about wrong dir
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v2

- name: Comment on PR
uses: actions/github-script@v6
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'Hi! Thanks for your contribution to conda-forge.' +
'\nUnfortunately, the recipe was added directly in the `recipes` folder without its own subfolder.\n' +
'Please move the recipe file (`<your_package.yaml>`) into a folder with the name of the package you want to submit.\n\n' +
'For example: if your recipe is currently under `recipes/<your_package>.yaml`, ' +
'it should be moved to `recipes/<your_package>/<your_package>.yaml`.\n' +
'Thanks!'
})
11 changes: 6 additions & 5 deletions .github/workflows/create_feedstocks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,13 @@ on:
- cron: '*/10 * * * *'
workflow_dispatch: null

permissions: {}
jobs:
create-feedstocks:
permissions:
contents: write # for git push
actions: read # to read runs

if: github.repository == 'conda-forge/staged-recipes'
name: Create feedstocks
runs-on: ubuntu-latest
Expand Down Expand Up @@ -55,10 +60,6 @@ jobs:
source ./.github/workflows/scripts/create_feedstocks
env:
STAGING_BINSTAR_TOKEN: ${{ secrets.STAGING_BINSTAR_TOKEN }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
CIRCLE_TOKEN: ${{ secrets.CIRCLE_TOKEN }}
GH_TOKEN: ${{ secrets.CF_ADMIN_GITHUB_TOKEN }}
TRAVIS_TOKEN: ${{ secrets.ORGWIDE_TRAVIS_TOKEN }}
GH_TRAVIS_TOKEN: ${{ secrets.ORGWIDE_GH_TRAVIS_TOKEN }}
AZURE_TOKEN: ${{ secrets.AZURE_TOKEN }}
DRONE_TOKEN: ${{ secrets.DRONE_TOKEN }}
GH_DRONE_TOKEN: ${{ secrets.GH_DRONE_TOKEN }}
27 changes: 27 additions & 0 deletions .github/workflows/do_not_edit_example.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: do_not_edit_example

on:
pull_request_target:
paths:
- 'recipes/example/meta.yaml'

jobs:
comment:
name: Notify user about not editing example recipe
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v2

- name: Comment on PR
uses: actions/github-script@v6
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'Hi! Thanks for your contribution to conda-forge.' +
'\nWhen submitting a pull request, please do not change anything in the example recipe.\n' +
'Please make sure that any changes are reverted before you submit it for review.\n' +
'Thanks!'
})
15 changes: 11 additions & 4 deletions .github/workflows/scripts/create_feedstocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,12 @@ def _set_default_branch(feedstock_dir, default_branch):
):
cfg["upload_on_branch"] = default_branch

if "conda_build" not in cfg:
cfg["conda_build"] = {}

if "error_overlinking" not in cfg["conda_build"]:
cfg["conda_build"]["error_overlinking"] = True

with open(os.path.join(feedstock_dir, "conda-forge.yml"), "w") as fp:
yaml.dump(cfg, fp)

Expand Down Expand Up @@ -198,8 +204,9 @@ def write_token(name, token):
# gh_drone = Github(os.environ['GH_DRONE_TOKEN'])
# gh_drone_remaining = print_rate_limiting_info(gh_drone, 'GH_DRONE_TOKEN')

gh_travis = Github(os.environ['GH_TRAVIS_TOKEN'])

# gh_travis = Github(os.environ['GH_TRAVIS_TOKEN'])
gh_travis = None

gh = None
if 'GH_TOKEN' in os.environ:
write_token('github', os.environ['GH_TOKEN'])
Expand Down Expand Up @@ -518,7 +525,7 @@ def write_token(name, token):
print_rate_limiting_info(gh, 'GH_TOKEN')
# if gh_drone:
# print_rate_limiting_info(gh_drone, 'GH_DRONE_TOKEN')
if gh_travis:
print_rate_limiting_info(gh_travis, 'GH_TRAVIS_TOKEN')
# if gh_travis:
# print_rate_limiting_info(gh_travis, 'GH_TRAVIS_TOKEN')

sys.exit(exit_code)
16 changes: 16 additions & 0 deletions .github/workflows/scripts/print_tokens.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import os
import github

for token in [
"GH_TOKEN",
"GH_TRAVIS_TOKEN",
"GH_DRONE_TOKEN",
"ORGWIDE_GH_TRAVIS_TOKEN"
]:
try:
gh = github.Github(os.environ[token])
login = gh.get_user().login
except Exception:
loging = "NOT FOUND"

print("%s: %s" % (token, login))
41 changes: 41 additions & 0 deletions .github/workflows/tokens.yml.notused
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: tokens

on:
push:
branches:
- main

jobs:
tokens:
name: tokens
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v2

- uses: conda-incubator/setup-miniconda@v2
with:
python-version: 3.8
channels: conda-forge,defaults
channel-priority: strict
show-channel-urls: true
miniforge-version: latest
miniforge-variant: Mambaforge

- name: configure conda and install code
shell: bash -l {0}
run: |
conda config --set always_yes yes
conda config --add channels conda-forge
mamba install --quiet pip

mamba install -y -q pygithub

- name: tokens
shell: bash -l {0}
run: |
python .github/workflows/scripts/print_tokens.py
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
GH_TRAVIS_TOKEN: ${{ secrets.GH_TRAVIS_TOKEN }}
GH_DRONE_TOKEN: ${{ secrets.GH_DRONE_TOKEN }}
ORGWIDE_GH_TRAVIS_TOKEN: ${{ secrets.ORGWIDE_GH_TRAVIS_TOKEN }}
1 change: 1 addition & 0 deletions .scripts/run_docker_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ docker run ${DOCKER_RUN_ARGS} \
-e AZURE=${AZURE} \
-e CONFIG \
-e CI \
-e CPU_COUNT \
-e DEFAULT_LINUX_VERSION \
"${DOCKER_IMAGE}" \
bash \
Expand Down
44 changes: 33 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This repo is a holding area for recipes destined for a conda-forge feedstock rep

## Feedstock conversion status

[![Build Status](https://github.com/conda-forge/staged-recipes/workflows/Create%20feedstocks/badge.svg)](https://github.com/conda-forge/staged-recipes/actions?query=workflow%3A%22Create+feedstocks%22)
[![create_feedstocks](https://github.com/conda-forge/admin-requests/actions/workflows/create_feedstocks.yml/badge.svg)](https://github.com/conda-forge/admin-requests/actions/workflows/create_feedstocks.yml)

Failures with the above job are often caused by API rate limits from the various services used by conda-forge.
This can result in empty feedstock repositories and will resolve itself automatically.
Expand Down Expand Up @@ -133,19 +133,41 @@ git push -f

### 12. My pull request passes all checks, but hasn't received any attention. How do I call attention to my PR? What is the customary amount of time to wait?

If your PR is passing all checks, but has not been acted on by the staged recipes
maintainers, you can ping @conda-forge/staged-recipes to request action. You do
not need to wait any specific amount of time once the recipe is ready to go.
<!--
Keep this message in sync with the PR template.

Due to GitHub limitations first time contributors to conda-forge are unable
to ping these teams. You can [ping the team](https://conda-forge.org/docs/maintainer/infrastructure.html#conda-forge-admin-please-ping-team)
using a special command in a comment on the PR to get the attention of the `staged-recipes` team.
https://raw.githubusercontent.com/conda-forge/staged-recipes/main/.github/pull_request_template.md
-->

If your recipe still does not receive any attention after a few days, you may
attempt to re-ping @conda-forge/staged-recipes. You may also attempt to bring
the PR up in our Gitter chat room at https://gitter.im/conda-forge/conda-forge.github.io.
There are language-specific teams for reviewing recipes.

| Language | Name of review team |
| --------------- | ----------------------------- |
| python | `@conda-forge/help-python` |
| python/c hybrid | `@conda-forge/help-python-c` |
| r | `@conda-forge/help-r` |
| java | `@conda-forge/help-java` |
| nodejs | `@conda-forge/help-nodejs` |
| c/c++ | `@conda-forge/help-c-cpp` |
| perl | `@conda-forge/help-perl` |
| Julia | `@conda-forge/help-julia` |
| ruby | `@conda-forge/help-ruby` |
| other | `@conda-forge/staged-recipes` |

Once the PR is ready for review, please mention one of the teams above in a
new comment. i.e. `@conda-forge/help-some-language, ready for review!`
Then, a bot will label the PR as 'review-requested'.

Due to GitHub limitations, first time contributors to conda-forge are unable
to ping conda-forge teams directly, but you can [ask a bot to ping the team][1]
using a special command in a comment on the PR to get the attention of the
`staged-recipes` team. You can also consider asking on our [Gitter channel][2]
if your recipe isn't reviewed promptly.

[1]: https://conda-forge.org/docs/maintainer/infrastructure.html#conda-forge-admin-please-ping-team
[2]: https://gitter.im/conda-forge/conda-forge.github.io

All apologies in advance if your recipe PR does not recieve prompt attention.
This is a high volume repository and issues can easily be missed. We are always
This is a high volume repository and the reviewers are volunteers. Review times vary depending on the number of reviewers on a given language team and may be days or weeks. We are always
looking for more staged-recipe reviewers. If you are interested in volunteering,
please contact a member of @conda-forge/core. We'd love to have the help!
1 change: 1 addition & 0 deletions broken-recipes/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

0 comments on commit 12c39e7

Please sign in to comment.