Skip to content

Commit

Permalink
Merge branch 'main' into 2138dependabot/github_actions/dot-github/wor…
Browse files Browse the repository at this point in the history
…kflows/github-actions-a80722a195
  • Loading branch information
xhochy authored Aug 15, 2024
2 parents 59e8a03 + 5dafc25 commit 9174bc8
Show file tree
Hide file tree
Showing 29 changed files with 1,579 additions and 594 deletions.
10 changes: 5 additions & 5 deletions .authors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
aliases:
- John Kirkham
- jakirkham
num_commits: 30
num_commits: 31
first_commit: 2016-03-17 21:05:53
github: jakirkham
- name: Daniel Bast
Expand Down Expand Up @@ -393,7 +393,7 @@
github: shadowwalkersb
- name: Matthew R. Becker
email: becker.mr@gmail.com
num_commits: 234
num_commits: 256
first_commit: 2020-01-07 17:44:33
github: beckermr
alternate_emails:
Expand Down Expand Up @@ -488,7 +488,7 @@
github: BastianZim
- name: Wolf Vollprecht
email: w.vollprecht@gmail.com
num_commits: 17
num_commits: 55
first_commit: 2021-01-19 04:39:35
github: wolfv
- name: Hugo Slepicka
Expand Down Expand Up @@ -587,7 +587,7 @@
github: zklaus
- name: pre-commit-ci[bot]
email: 66853113+pre-commit-ci[bot]@users.noreply.github.com
num_commits: 20
num_commits: 22
first_commit: 2023-10-30 15:49:50
github: carterbox
- name: Amit Kumar
Expand Down Expand Up @@ -628,7 +628,7 @@
first_commit: 2024-05-21 04:47:22
- name: nichmor
email: nmorkotilo@gmail.com
num_commits: 80
num_commits: 126
first_commit: 2024-03-21 10:10:04
github: nichmor
- name: Jan Lehnarsdt
Expand Down
6 changes: 3 additions & 3 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@ Isuru Fernando <isuru.11@cse.mrt.ac.lk> Isuru Fernando <isuruf@gmail.com>
Matthew R. Becker <becker.mr@gmail.com> Matthew R Becker <beckermr@users.noreply.github.com>
Matthew R. Becker <becker.mr@gmail.com> beckermr <beckermr@users.noreply.github.com>
Jaime Rodríguez-Guerra <jaimergp@users.noreply.github.com>
nichmor <nmorkotilo@gmail.com>
Christopher J. Wright <cjwright4242gh@gmail.com> christopher <cjwright4242@gmail.com>
Christopher J. Wright <cjwright4242gh@gmail.com> Christopher J. 'CJ' Wright <cjwright4242@gmail.com>
Anthony Scopatz <scopatz@gmail.com>
Phil Elson <pelson.pub@gmail.com> pelson <pelson.pub@gmail.com>
nichmor <nmorkotilo@gmail.com>
Wolf Vollprecht <w.vollprecht@gmail.com>
H. Vetinari <h.vetinari@gmx.com>
Uwe L. Korn <uwe.korn@quantco.com> Uwe L. Korn <xhochy@users.noreply.github.com>
Filipe Fernandes <ocefpaf@gmail.com> Filipe <ocefpaf@gmail.com>
Expand All @@ -27,9 +28,9 @@ Amit Kumar <dtu.amit@gmail.com>
Min RK <benjaminrk@gmail.com>
Marcel Bargull <marcel.bargull@udo.edu> Marcel Bargull <mbargull@users.noreply.github.com>
shadow_walker <shadowwalkersb@gmail.com>
Michael Sarahan <msarahan@gmail.com> Mike Sarahan <msarahan@gmail.com>
John Kirkham <jakirkham@gmail.com> John Kirkham <kirkhamj@janelia.hhmi.org>
John Kirkham <jakirkham@gmail.com> jakirkham <kirkhamj@janelia.hhmi.org>
Michael Sarahan <msarahan@gmail.com> Mike Sarahan <msarahan@gmail.com>
Bastian Zimmermann <10774221+BastianZim@users.noreply.github.com> BastianZim <10774221+BastianZim@users.noreply.github.com>
Mark Harfouche <mark.harfouche@gmail.com>
Leo Fang <leofang@bnl.gov> Leo Fang <leo80042@gmail.com>
Expand All @@ -40,7 +41,6 @@ Johnny Willemsen <jwillemsen@remedy.nl>
pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Chris Burr <christopher.burr@cern.ch> Chris Burr <chrisburr@users.noreply.github.com>
Julian Rüth <julian.rueth@fsfe.org>
Wolf Vollprecht <w.vollprecht@gmail.com>
Yannik Tausch <yannik.tausch@quantco.com>
Daniel Bast <2790401+dbast@users.noreply.github.com>
Billy K. Poon <bkpoon@lbl.gov>
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ repos:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 24.4.2
rev: 24.8.0
hooks:
- id: black
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.5.5
rev: v0.5.6
hooks:
- id: ruff
args: [ --fix ]
Expand Down
6 changes: 3 additions & 3 deletions AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ Authors are sorted by number of commits.
* Isuru Fernando
* Matthew R. Becker
* Jaime Rodríguez-Guerra
* nichmor
* Christopher J. Wright
* Anthony Scopatz
* Phil Elson
* nichmor
* Wolf Vollprecht
* H. Vetinari
* Uwe L. Korn
* Filipe Fernandes
Expand All @@ -16,8 +17,8 @@ Authors are sorted by number of commits.
* Min RK
* Marcel Bargull
* shadow_walker
* Michael Sarahan
* John Kirkham
* Michael Sarahan
* Bastian Zimmermann
* Mark Harfouche
* Leo Fang
Expand All @@ -27,7 +28,6 @@ Authors are sorted by number of commits.
* pre-commit-ci[bot]
* Chris Burr
* Julian Rüth
* Wolf Vollprecht
* Yannik Tausch
* Daniel Bast
* Billy K. Poon
Expand Down
33 changes: 33 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,39 @@ conda-smithy Change Log

.. current developments
v3.38.0
====================

**Added:**

* make `stdlib` linting work for v2 recipe format (#1992)
* add lint for noarch and runtime deps (#2001)
* Added linting for go license bundling check in conda v2 recipes. (#2013)
* Added linting for rust license bundling for v2 recipe format (#2015)
* Added linting for Jinja expressions in the new v2 conda recipe format (#2017)
* Added proper linting for `pin_subpackage` and `pin_compatible` for conda v2 recipes. (#2018)
* Added more lints / hints for conda v2 recipes. (#2000, #2003, #2008, #2016, #2022)

**Changed:**

* Exclude ruff commits from git ( #2007 )
* The conda recipe version was renamed from ``{1, 2}`` to ``{0, 1}``. (#2031)

**Fixed:**

* Add upper bound for rattler-build-conda-compat. (#2009)
* Reenabled service feedstocks that were removed by accident in #1703. (#2025)

**Authors:**

* Matthew R. Becker
* nichmor
* Wolf Vollprecht
* John Kirkham
* pre-commit-ci[bot]



v3.37.2ls
====================

Expand Down
24 changes: 13 additions & 11 deletions conda_smithy/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,19 @@
from typing import Optional, Union

import conda # noqa
import conda_build.api
from conda_build.metadata import MetaData
from rattler_build_conda_compat.render import MetaData as RattlerMetaData
from rattler_build_conda_compat.utils import has_recipe as has_rattler_recipe
from rattler_build_conda_compat.utils import has_recipe as has_recipe_v1
from ruamel.yaml import YAML

import conda_smithy.cirun_utils
from conda_smithy import __version__, configure_feedstock, feedstock_io
from conda_smithy import lint_recipe as linter
from conda_smithy.configure_feedstock import _load_forge_config
from conda_smithy.utils import (
CONDA_BUILD,
RATTLER_BUILD,
_get_metadata_from_feedstock_dir,
get_feedstock_name_from_meta,
merge_dict,
)
Expand Down Expand Up @@ -131,7 +132,7 @@ def __call__(self, args):
build_tool = CONDA_BUILD

# detect what recipe ( meta.yaml or recipe.yaml ) we should render
if has_rattler_recipe(args.recipe_directory):
if has_recipe_v1(args.recipe_directory):
build_tool = RATTLER_BUILD

if build_tool == CONDA_BUILD:
Expand Down Expand Up @@ -328,14 +329,15 @@ def __call__(self, args):
from conda_smithy import ci_register

owner = args.user or args.organization
meta = conda_build.api.render(
args.feedstock_directory,
permit_undefined_jinja=True,
finalize=False,
bypass_env_check=True,
trim_skip=False,
)[0][0]
feedstock_name = get_feedstock_name_from_meta(meta)

# Load the conda-forge config and read metadata from the feedstock recipe
forge_config = _load_forge_config(args.feedstock_directory, None)
metadata = _get_metadata_from_feedstock_dir(
args.feedstock_directory, forge_config
)

feedstock_name = get_feedstock_name_from_meta(metadata)

repo = f"{feedstock_name}-feedstock"

if args.feedstock_config is None:
Expand Down
9 changes: 6 additions & 3 deletions conda_smithy/configure_feedstock.py
Original file line number Diff line number Diff line change
Expand Up @@ -962,7 +962,7 @@ def _render_ci_provider(
if ver:
os.environ["DEFAULT_LINUX_VERSION"] = ver

# detect if it's rattler-build recipe
# detect if it's v1 recipe
if forge_config["conda_build_tool"] == RATTLER_BUILD:
recipe_file = "recipe.yaml"
else:
Expand Down Expand Up @@ -997,7 +997,7 @@ def _render_ci_provider(
)

# If we are using new recipe
# we also load rattler-build variants.yaml
# we also load v1 variants.yaml
if recipe_file == "recipe.yaml":
# get_selectors from conda-build return namespace
# so it is usefull to reuse it here
Expand Down Expand Up @@ -1027,7 +1027,10 @@ def _render_ci_provider(
if (
channel_target.startswith("conda-forge ")
and provider_name == "github_actions"
and not forge_config["github_actions"]["self_hosted"]
and not (
(forge_config["github_actions"]["self_hosted"])
or (os.path.basename(forge_dir) in SERVICE_FEEDSTOCKS)
)
):
raise RuntimeError(
"Using github_actions as the CI provider inside "
Expand Down
26 changes: 15 additions & 11 deletions conda_smithy/github.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
import os
from random import choice

import conda_build.api
import github
from git import Repo
from github import Github
from github.GithubException import GithubException
from github.Organization import Organization
from github.Team import Team

from conda_smithy.utils import get_feedstock_name_from_meta
from conda_smithy.configure_feedstock import _load_forge_config
from conda_smithy.utils import (
_get_metadata_from_feedstock_dir,
get_feedstock_name_from_meta,
)


def gh_token():
Expand Down Expand Up @@ -101,15 +104,14 @@ def get_cached_team(org, team_name, description=""):

def create_github_repo(args):
token = gh_token()
meta = conda_build.api.render(
args.feedstock_directory,
permit_undefined_jinja=True,
finalize=False,
bypass_env_check=True,
trim_skip=False,
)[0][0]

feedstock_name = get_feedstock_name_from_meta(meta)
# Load the conda-forge config and read metadata from the feedstock recipe
forge_config = _load_forge_config(args.feedstock_directory, None)
metadata = _get_metadata_from_feedstock_dir(
args.feedstock_directory, forge_config
)

feedstock_name = get_feedstock_name_from_meta(metadata)

gh = Github(token)
user_or_org = None
Expand Down Expand Up @@ -159,7 +161,9 @@ def create_github_repo(args):

if args.add_teams:
if isinstance(user_or_org, Organization):
configure_github_team(meta, gh_repo, user_or_org, feedstock_name)
configure_github_team(
metadata, gh_repo, user_or_org, feedstock_name
)


def accept_all_repository_invitations(gh):
Expand Down
Loading

0 comments on commit 9174bc8

Please sign in to comment.