Skip to content

Commit

Permalink
Merge branch 'main' of github.com:conda-forge/conda-smithy into gha-s…
Browse files Browse the repository at this point in the history
…elf-hosted-cirun
  • Loading branch information
isuruf committed Oct 20, 2023
2 parents 98eb99c + 2a082a7 commit f480723
Show file tree
Hide file tree
Showing 15 changed files with 113 additions and 691 deletions.
8 changes: 4 additions & 4 deletions .authors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
first_commit: 2019-02-17 13:35:45
- name: Min RK
email: [email protected]
num_commits: 29
num_commits: 30
first_commit: 2016-09-15 09:07:34
github: minrk
- name: Phil Elson
Expand Down Expand Up @@ -236,7 +236,7 @@
email: [email protected]
alternate_emails:
- [email protected]
num_commits: 32
num_commits: 39
first_commit: 2019-06-27 08:26:49
github: xhochy
- name: C.A.M. Gerlach
Expand Down Expand Up @@ -393,7 +393,7 @@
github: shadowwalkersb
- name: Matthew R. Becker
email: [email protected]
num_commits: 152
num_commits: 154
first_commit: 2020-01-07 17:44:33
github: beckermr
alternate_emails:
Expand Down Expand Up @@ -476,7 +476,7 @@
github: jwillemsen
- name: Jaime Rodríguez-Guerra
email: [email protected]
num_commits: 99
num_commits: 104
first_commit: 2020-11-01 14:18:08
github: jaimergp
- name: Bastian Zimmermann
Expand Down
4 changes: 2 additions & 2 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@
Isuru Fernando <[email protected]> Isuru Fernando <[email protected]>
Matthew R. Becker <[email protected]> Matthew R Becker <[email protected]>
Matthew R. Becker <[email protected]> beckermr <[email protected]>
Jaime Rodríguez-Guerra <[email protected]>
Christopher J. Wright <[email protected]> christopher <[email protected]>
Christopher J. Wright <[email protected]> Christopher J. 'CJ' Wright <[email protected]>
Anthony Scopatz <[email protected]>
Jaime Rodríguez-Guerra <[email protected]>
Phil Elson <[email protected]> pelson <[email protected]>
Filipe Fernandes <[email protected]> Filipe <[email protected]>
Filipe Fernandes <[email protected]> ocefpaf <[email protected]>
Uwe L. Korn <[email protected]> Uwe L. Korn <[email protected]>
Dougal J. Sutherland <[email protected]>
shadow_walker <[email protected]>
Uwe L. Korn <[email protected]> Uwe L. Korn <[email protected]>
Michael Sarahan <[email protected]> Mike Sarahan <[email protected]>
Min RK <[email protected]>
Leo Fang <[email protected]> Leo Fang <[email protected]>
Expand Down
4 changes: 2 additions & 2 deletions AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ Authors are sorted by number of commits.

* Isuru Fernando
* Matthew R. Becker
* Jaime Rodríguez-Guerra
* Christopher J. Wright
* Anthony Scopatz
* Jaime Rodríguez-Guerra
* Phil Elson
* Filipe Fernandes
* Uwe L. Korn
* Dougal J. Sutherland
* shadow_walker
* Uwe L. Korn
* Michael Sarahan
* Min RK
* Leo Fang
Expand Down
37 changes: 37 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,43 @@ conda-smithy Change Log

.. current developments
v3.27.1
====================

**Fixed:**

* Crash when XDG_CACHE_DIR is defined

**Authors:**

* Min RK



v3.27.0
====================

**Added:**

* Cache the contents of ``conda-forge-pinning`` and only check every 15min for an updated version.
The re-check interval can be configured via the ``CONDA_FORGE_PINNING_LIFETIME`` environment variable.

**Changed:**

* Do not strip version constraints for ``mamba update``. (#1773 via #1774)
* If one supplies ``--no-check-uptodate`` on the commandline, we will no longer check and print a warning if conda-smithy is outdated.

**Removed:**

* Removed the ``updatecb3`` command. It is advised to do this update manually if you still encounter a recipe using the old compiler ``toolchain``.

**Authors:**

* Jaime Rodríguez-Guerra
* Uwe L. Korn



v3.26.3
====================

Expand Down
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,6 @@ out of by specifying `--without-anaconda-token`, as such execpted package upload
```
github:
user_or_org: YOUR_GITHUB_USER_OR_ORG
channels:
targets:
-
- YOUR_ANACONDA_CHANNEL
```

6. **Re-render the feedstock:** ``conda smithy rerender --feedstock_directory ./foo-feedstock``
Expand Down
46 changes: 1 addition & 45 deletions conda_smithy/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def __call__(self, args):
)

print(
"\nRepository created, please edit conda-forge.yml to configure the upload channels\n"
"\nRepository created, please edit recipe/conda_build_config.yaml to configure the upload channels\n"
"and afterwards call 'conda smithy register-github'"
)

Expand Down Expand Up @@ -654,50 +654,6 @@ def __call__(self, args):
print(POST_SKELETON_MESSAGE.format(args=args).strip())


class UpdateCB3(Subcommand):
subcommand = "update-cb3"

def __init__(self, parser):
# conda-smithy update-cb3 ./
super(UpdateCB3, self).__init__(
parser, "Update a feedstock for conda-build=3"
)
scp = self.subcommand_parser
scp.add_argument(
"--recipe_directory",
default=os.path.join(os.getcwd(), "recipe"),
help="The path to the source recipe directory.",
)
scp.add_argument(
"--output",
default=None,
help="Filename for the output. No output edits the recipe inplace",
)
scp.add_argument(
"--cbc",
default=None,
help="Path to conda_build_config.yaml. No path will use conda-forge-pinning",
)

def __call__(self, args):
from conda_smithy.update_cb3 import update_cb3
from conda_smithy.configure_feedstock import get_cfp_file_path

recipe_file = os.path.join(args.recipe_directory, "meta.yaml")
output_file = args.output
if output_file is None:
output_file = recipe_file
if args.cbc is None:
cbc, _ = get_cfp_file_path()
else:
cbc = os.path.join(os.getcwd(), args.cbc)
output_content, messages = update_cb3(recipe_file, cbc)
with io.open(output_file, "w") as fh:
fh.write(output_content)
print("List of changes done to the recipe:")
print(messages)


def main():
logging.basicConfig(level=logging.INFO)

Expand Down
42 changes: 30 additions & 12 deletions conda_smithy/configure_feedstock.py
Original file line number Diff line number Diff line change
Expand Up @@ -733,6 +733,9 @@ def _render_ci_provider(
if os.path.exists(_recipe_cbc):
os.rename(_recipe_cbc, _recipe_cbc + ".conda.smithy.bak")

channel_sources = migrated_combined_variant_spec.get(
"channel_sources", [""]
)[0].split(",")
metas = conda_build.api.render(
os.path.join(forge_dir, forge_config["recipe_dir"]),
platform=platform,
Expand All @@ -742,9 +745,7 @@ def _render_ci_provider(
permit_undefined_jinja=True,
finalize=False,
bypass_env_check=True,
channel_urls=forge_config.get("channels", {}).get(
"sources", []
),
channel_urls=channel_sources,
)
finally:
if os.path.exists(_recipe_cbc + ".conda.smithy.bak"):
Expand Down Expand Up @@ -1690,11 +1691,23 @@ def render_README(jinja_env, forge_config, forge_dir, render_info=None):

ci_support_path = os.path.join(forge_dir, ".ci_support")
variants = []
channel_targets = []
if os.path.exists(ci_support_path):
for filename in os.listdir(ci_support_path):
if filename.endswith(".yaml"):
variant_name, _ = os.path.splitext(filename)
variants.append(variant_name)
with open(os.path.join(ci_support_path, filename)) as fh:
data = yaml.safe_load(fh)
for channel in data.get("channel_targets", ()):
# channel_targets are in the form of "channel_name label"
channel_targets.append(channel.split(" "))
if not channel_targets:
# default to conda-forge if no channel_targets are specified (shouldn't happen)
channel_targets = ["conda-forge main"]
else:
# de-duplicate in-order
channel_targets = list(dict.fromkeys(channel_targets))

subpackages_metas = OrderedDict((meta.name(), meta) for meta in metas)
subpackages_about = [(package_name, package_about)]
Expand Down Expand Up @@ -1726,6 +1739,7 @@ def render_README(jinja_env, forge_config, forge_dir, render_info=None):
)
)
)
forge_config["channel_targets"] = channel_targets

if forge_config["azure"].get("build_id") is None:

Expand Down Expand Up @@ -1902,10 +1916,6 @@ def _load_forge_config(forge_dir, exclusive_config_file, forge_yml=None):
"max_py_ver": "37",
"min_r_ver": "34",
"max_r_ver": "34",
"channels": {
"sources": ["conda-forge"],
"targets": [["conda-forge", "main"]],
},
"github": {
"user_or_org": "conda-forge",
"repo_name": "",
Expand Down Expand Up @@ -1983,6 +1993,11 @@ def _load_forge_config(forge_dir, exclusive_config_file, forge_yml=None):
"Setting docker image in conda-forge.yml is removed now."
" Use conda_build_config.yaml instead"
)
if file_config.get("channels"):
raise ValueError(
"Setting channels in conda-forge.yml is removed now."
" Use conda_build_config.yaml instead"
)

for plat in ["linux", "osx", "win"]:
if config["azure"]["timeout_minutes"] is not None:
Expand Down Expand Up @@ -2134,10 +2149,13 @@ def _load_forge_config(forge_dir, exclusive_config_file, forge_yml=None):
config["remote_ci_setup"] = _santize_remote_ci_setup(
config["remote_ci_setup"]
)
config["remote_ci_setup_names"] = [
MatchSpec(pkg.strip('"').strip("'")).name
for pkg in config["remote_ci_setup"]
]
if config["conda_install_tool"] == "conda":
config["remote_ci_setup_update"] = [
MatchSpec(pkg.strip('"').strip("'")).name
for pkg in config["remote_ci_setup"]
]
else:
config["remote_ci_setup_update"] = config["remote_ci_setup"]

# Older conda-smithy versions supported this with only one
# entry. To avoid breakage, we are converting single elements
Expand Down Expand Up @@ -2284,7 +2302,7 @@ def get_cache_dir():
if sys.platform.startswith("win"):
return Path(os.environ.get("TEMP"))
else:
return os.environ.get("XDG_CACHE_HOME", Path.home() / ".cache")
return Path(os.environ.get("XDG_CACHE_HOME", Path.home() / ".cache"))


def get_cached_cfp_file_path(temporary_directory):
Expand Down
2 changes: 1 addition & 1 deletion conda_smithy/templates/README.md.tmpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{%- set channel_name = channels.targets[0][0] -%}
{%- set channel_name = channel_targets[0] -%}
{#-
# -*- mode: jinja -*-
-#}
Expand Down
6 changes: 3 additions & 3 deletions conda_smithy/templates/build_steps.sh.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ export CONDA_LIBMAMBA_SOLVER_NO_CHANNELS_FROM_INSTALLED=1

{{ conda_install_tool }} install --update-specs --yes --quiet --channel conda-forge --strict-channel-priority \
pip {{ conda_install_tool_deps }} {{ conda_build_tool_deps }} {{ " ".join(remote_ci_setup) }}
{%- if conda_build_tool_deps != "" or conda_install_tool_deps != "" %}
{%- if conda_install_tool == "mamba" and (conda_build_tool_deps != "" or conda_install_tool_deps != "") %}
{{ conda_install_tool }} update --update-specs --yes --quiet --channel conda-forge --strict-channel-priority \
pip {{ conda_install_tool_deps }} {{ conda_build_tool_deps }} {{ " ".join(remote_ci_setup_names) }}
pip {{ conda_install_tool_deps }} {{ conda_build_tool_deps }} {{ " ".join(remote_ci_setup_update) }}
{%- endif %}
{% if local_ci_setup %}
conda uninstall --quiet --yes --force {{ " ".join(remote_ci_setup_names)}}
conda uninstall --quiet --yes --force {{ " ".join(remote_ci_setup)}}
pip install --no-deps ${RECIPE_ROOT}/.
{%- endif %}
# set up the condarc
Expand Down
6 changes: 3 additions & 3 deletions conda_smithy/templates/run_osx_build.sh.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ export CONDA_LIBMAMBA_SOLVER_NO_CHANNELS_FROM_INSTALLED=1

{{ conda_install_tool }} install --update-specs --quiet --yes --channel conda-forge --strict-channel-priority \
pip {{ conda_install_tool_deps }} {{ conda_build_tool_deps }} {{ " ".join(remote_ci_setup) }}
{%- if conda_build_tool_deps != "" or conda_install_tool_deps != "" %}
{%- if conda_install_tool == "mamba" and (conda_build_tool_deps != "" or conda_install_tool_deps != "") %}
{{ conda_install_tool }} update --update-specs --yes --quiet --channel conda-forge --strict-channel-priority \
pip {{ conda_install_tool_deps }} {{ conda_build_tool_deps }} {{ " ".join(remote_ci_setup_names) }}
pip {{ conda_install_tool_deps }} {{ conda_build_tool_deps }} {{ " ".join(remote_ci_setup_update) }}
{%- endif %}

{% if local_ci_setup %}
conda uninstall --quiet --yes --force {{ " ".join(remote_ci_setup_names) }}
conda uninstall --quiet --yes --force {{ " ".join(remote_ci_setup) }}
pip install --no-deps {{ recipe_dir }}/.
{%- endif %}

Expand Down
2 changes: 1 addition & 1 deletion conda_smithy/templates/run_win_build.bat.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ if !errorlevel! neq 0 exit /b !errorlevel!

{%- if local_ci_setup %}
echo Overriding conda-forge-ci-setup with local version
conda.exe uninstall --quiet --yes --force {{ " ".join(remote_ci_setup_names) }}
conda.exe uninstall --quiet --yes --force {{ " ".join(remote_ci_setup) }}
if !errorlevel! neq 0 exit /b !errorlevel!
pip install --no-deps ".\{{ recipe_dir }}\."
if !errorlevel! neq 0 exit /b !errorlevel!
Expand Down
Loading

0 comments on commit f480723

Please sign in to comment.