From c00ded0eb45d3f8a5ac22ad754d3ece14cbaf085 Mon Sep 17 00:00:00 2001 From: Peter Williams Date: Fri, 13 Sep 2024 09:42:10 -0400 Subject: [PATCH 1/3] setup.py: whoops --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 6a8a22f..acfd362 100644 --- a/setup.py +++ b/setup.py @@ -29,7 +29,7 @@ def get_long_desc(): For more information, including installation instructions, please visit [the project homepage]. -[the project homepage]: https://pkgw.readthedocs.io/ +[the project homepage]: https://pwkit.readthedocs.io/ """ ) return "".join(lines) From 712dcad4ed2d3e3058731402bfa8ffa66bca66b6 Mon Sep 17 00:00:00 2001 From: Peter Williams Date: Fri, 11 Oct 2024 09:28:27 -0400 Subject: [PATCH 2/3] pwkit/kwargv.py: fix fixup processing of args with non-None defaults The fixup function was being called twice if an argument had a default that wasn't None, leading to problems in `omegafig`. --- pwkit/kwargv.py | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/pwkit/kwargv.py b/pwkit/kwargv.py index 5904eeb..615fb87 100644 --- a/pwkit/kwargv.py +++ b/pwkit/kwargv.py @@ -370,8 +370,14 @@ def __init__(self): ki.default = None elif ki.repeatable: ki.default = [] - elif ki.fixupfunc is not None and ki.default is not None: - # kinda gross structure here, oh well. + elif ki.fixupfunc is not None: + # Make sure to process the default through the fixup, if it + # exists. This helps code use "interesting" defaults with types + # that you might prefer to use when launching a task + # programmatically; e.g. a default output stream that is + # `sys.stdout`, not "-". Note, however, that the fixup will + # always get called for the default value, so it shouldn't do + # anything too expensive. ki.default = ki.fixupfunc(ki.default) kwinfos[kw] = ki @@ -472,14 +478,6 @@ def parse(self, args=None): 'required keyword argument "%s" was not provided', kw ) - # If there's a fixup, process it even if the keyword wasn't - # provided. This lets code use "interesting" defaults with - # types that you might prefer to use when launching a task - # programmatically; e.g. a default output stream that is - # `sys.stdout`, not "-". - if ki.fixupfunc is not None: - self.set_one(ki._attrname, ki.fixupfunc(None)) - return self # convenience def parse_or_die(self, args=None): From a2e65f9bbd4cc64507938ca1b669a5b34d738d3f Mon Sep 17 00:00:00 2001 From: Peter Williams Date: Fri, 11 Oct 2024 10:05:27 -0400 Subject: [PATCH 3/3] ci: update for macos-14 VM images that lack Conda --- ci/azure-job-setup.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/ci/azure-job-setup.yml b/ci/azure-job-setup.yml index 8224d30..2bae3ac 100644 --- a/ci/azure-job-setup.yml +++ b/ci/azure-job-setup.yml @@ -67,17 +67,20 @@ steps: - bash: | set -euo pipefail - if [[ $AGENT_OS == Windows_NT ]] ; then + if [[ $AGENT_OS == Darwin ]] ; then + # As of macos-14, these no longer have Anaconda built in. + CONDA="$TMPDIR/conda" + curl -fsSL https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-MacOSX-x86_64.sh >miniforge.sh + bash miniforge.sh -f -b -p "$CONDA" + rm -f miniforge.sh + condabin="$CONDA/bin" + elif [[ $AGENT_OS == Windows_NT ]] ; then CONDA=$(echo "$CONDA" | sed -e 's|\\|\/|g' -e 's|^\([A-Za-z]\)\:/\(.*\)|/\L\1\E/\2|') condabin="$CONDA/Scripts" else condabin="$CONDA/bin" fi - if [[ $AGENT_OS == Darwin ]] ; then - sudo chown -R $USER $CONDA - fi - cat >activate-conda.sh <