squashed changes for 0.13.0
- support Python 3.6, refactor CI/test setup, increase test coverage
- refactor BidirectionalMapping, BidictBase, OrderedBidictBase,
FrozenBidictBase, and subclasses
- move frozenorderedbidict into _frozen and looseorderedbidict into _loose
- register bidict as a virtual subclass of MutableMapping rather than
inheriting from it directly. This makes it clearer that it does not use any
of the concrete generic methods that MutableMapping provides.
- improve performance and flexibility of frozenbidict and
frozenorderedbidict hashing
- docs, including new type-hierarchy.png diagram
- rm unused imap, ifilter, izip_longest from compat, add PYPY
- update to latest versions of dependencies
- restore benchmarking on travis
2017-01-09 15:37:31 +00:00
|
|
|
#!/bin/bash
|
2018-08-13 17:57:07 +00:00
|
|
|
#
|
2019-12-31 23:14:23 +00:00
|
|
|
# Copyright 2009-2020 Joshua Bronson. All Rights Reserved.
|
2018-08-13 17:57:07 +00:00
|
|
|
#
|
|
|
|
# This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
|
2018-12-28 01:30:29 +00:00
|
|
|
set -euo pipefail
|
squashed changes for 0.13.0
- support Python 3.6, refactor CI/test setup, increase test coverage
- refactor BidirectionalMapping, BidictBase, OrderedBidictBase,
FrozenBidictBase, and subclasses
- move frozenorderedbidict into _frozen and looseorderedbidict into _loose
- register bidict as a virtual subclass of MutableMapping rather than
inheriting from it directly. This makes it clearer that it does not use any
of the concrete generic methods that MutableMapping provides.
- improve performance and flexibility of frozenbidict and
frozenorderedbidict hashing
- docs, including new type-hierarchy.png diagram
- rm unused imap, ifilter, izip_longest from compat, add PYPY
- update to latest versions of dependencies
- restore benchmarking on travis
2017-01-09 15:37:31 +00:00
|
|
|
|
2018-12-28 01:30:29 +00:00
|
|
|
log() {
|
|
|
|
echo >&2 " *" "$@"
|
|
|
|
}
|
|
|
|
|
|
|
|
# Generate a new graph image from its source file if it's been modified.
|
|
|
|
update_graph() {
|
|
|
|
local -r graph_src="bidict-types-diagram.dot"
|
|
|
|
local -r graph_dst="${graph_src%.*}.png"
|
|
|
|
|
|
|
|
if [[ ! "$(git diff --name-only -- "$graph_src")" ]] &&
|
|
|
|
[[ ! "$(git diff --name-only --cached -- "$graph_src")" ]]; then
|
|
|
|
log "$graph_src not modified -> skipping graph update."
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
if ! command -v dot &>/dev/null; then
|
|
|
|
log "'dot' not found -> skipping graph update. Hint: brew install graphviz"
|
|
|
|
return 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if ! dot -v -Tpng -o "$graph_dst" <"$graph_src"; then
|
|
|
|
log "dot exited nonzero."
|
|
|
|
return 1
|
2017-11-16 20:44:51 +00:00
|
|
|
fi
|
|
|
|
|
2018-12-28 01:30:29 +00:00
|
|
|
# return 0 if any of the below fail because running dot succeeded, which is the main thing.
|
|
|
|
if ! command -v optipng &>/dev/null; then
|
|
|
|
log "'optipng' not found -> skipping png optimization. Hint: brew install optipng"
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
if ! optipng "$graph_dst"; then
|
|
|
|
log "optipng exited nonzero."
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
# Use parentheses instead of braces around body so it runs in a subshell -> cd doesn't leak.
|
|
|
|
build_docs() (
|
|
|
|
make clean html
|
|
|
|
)
|
|
|
|
|
|
|
|
main() {
|
2020-07-26 17:21:27 +00:00
|
|
|
cd assets
|
|
|
|
update_graph
|
|
|
|
cd -
|
|
|
|
cd docs
|
|
|
|
build_docs
|
|
|
|
cd -
|
2018-12-28 01:30:29 +00:00
|
|
|
}
|
2018-04-06 04:28:44 +00:00
|
|
|
|
2018-12-28 01:30:29 +00:00
|
|
|
main
|