Skip to content

Commit

Permalink
Release request commit created with Cranko.
Browse files Browse the repository at this point in the history
+++ cranko-rc-info-v1
[[projects]]
qnames = ["pwkit", "pypa"]
bump_spec = "micro bump"

+++
  • Loading branch information
cranko committed Oct 11, 2024
2 parents eeaf15c + a048396 commit 0d2201b
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 16 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# rc: micro bump

- Correct fixup processing of args with non-None defaults in `pwkit.kwargv` (#24)
- Correct the docs link in the README! (#23)

The version DOI of this release is [xx.xxxx/dev-build.pwkit.version][vdoi].

[vdoi]: https://doi.org/xx.xxxx/dev-build.pwkit.version


# pwkit 1.2.1 (2024-09-13)

- Fix `pwkit.parallel.SerialHelper.get_map()` for Python 3 (#22)
- Fix `pwkit.lmmin.Problem.set_npar()` for recent Numpys (#20). I'm not sure if
we'll be compatible with Numpy 2.0, though.
Expand Down
13 changes: 8 additions & 5 deletions ci/azure-job-setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 <<EOF
eval "\$($condabin/conda shell.bash hook)"
conda activate
Expand Down
18 changes: 8 additions & 10 deletions pwkit/kwargv.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 0d2201b

Please sign in to comment.