Skip to content

Commit d03f927

Browse files
committed
Merge github.com:cisagov/skeleton-python-library into lineage/skeleton
2 parents c4b07e8 + a7d1b25 commit d03f927

File tree

5 files changed

+63
-49
lines changed

5 files changed

+63
-49
lines changed

.pre-commit-config.yaml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,20 @@ repos:
4141
hooks:
4242
- id: prettier
4343
- repo: https://github.com/adrienverge/yamllint
44-
rev: v1.25.0
44+
rev: v1.26.0
4545
hooks:
4646
- id: yamllint
4747
args:
4848
- --strict
4949

5050
# Shell script hooks
51+
- repo: https://github.com/lovesegfault/beautysh
52+
rev: 6.0.1
53+
hooks:
54+
- id: beautysh
55+
args:
56+
- --indent-size
57+
- '2'
5158
- repo: https://github.com/detailyang/pre-commit-shell
5259
rev: 1.0.5
5360
hooks:
@@ -85,16 +92,18 @@ repos:
8592
hooks:
8693
- id: isort
8794
- repo: https://github.com/pre-commit/mirrors-mypy
88-
rev: v0.790
95+
rev: v0.800
8996
hooks:
9097
- id: mypy
9198
- repo: https://github.com/asottile/pyupgrade
92-
rev: v2.7.4
99+
rev: v2.10.0
93100
hooks:
94101
- id: pyupgrade
95102

96103
# Ansible hooks
97104
- repo: https://github.com/ansible-community/ansible-lint
105+
# This is intentionally being held back because of issues in v5 per
106+
# https://github.com/cisagov/skeleton-ansible-role/issues/69
98107
rev: v4.3.7
99108
hooks:
100109
- id: ansible-lint

bump_version.sh

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -14,38 +14,38 @@ old_version=$(sed -n "s/^__version__ = \"\(.*\)\"$/\1/p" $VERSION_FILE)
1414

1515
if [ $# -ne 1 ]
1616
then
17-
echo "$HELP_INFORMATION"
17+
echo "$HELP_INFORMATION"
1818
else
19-
case $1 in
20-
major|minor|patch|prerelease|build)
21-
new_version=$(python -c "import semver; print(semver.bump_$1('$old_version'))")
22-
echo Changing version from "$old_version" to "$new_version"
23-
# A temp file is used to provide compatability with macOS development
24-
# as a result of macOS using the BSD version of sed
25-
tmp_file=/tmp/version.$$
26-
sed "s/$old_version/$new_version/" $VERSION_FILE > $tmp_file
27-
mv $tmp_file $VERSION_FILE
28-
git add $VERSION_FILE
29-
git commit -m"Bump version from $old_version to $new_version"
30-
git push
31-
;;
32-
finalize)
33-
new_version=$(python -c "import semver; print(semver.finalize_version('$old_version'))")
34-
echo Changing version from "$old_version" to "$new_version"
35-
# A temp file is used to provide compatability with macOS development
36-
# as a result of macOS using the BSD version of sed
37-
tmp_file=/tmp/version.$$
38-
sed "s/$old_version/$new_version/" $VERSION_FILE > $tmp_file
39-
mv $tmp_file $VERSION_FILE
40-
git add $VERSION_FILE
41-
git commit -m"Bump version from $old_version to $new_version"
42-
git push
43-
;;
44-
show)
45-
echo "$old_version"
46-
;;
47-
*)
48-
echo "$HELP_INFORMATION"
49-
;;
50-
esac
19+
case $1 in
20+
major|minor|patch|prerelease|build)
21+
new_version=$(python -c "import semver; print(semver.bump_$1('$old_version'))")
22+
echo Changing version from "$old_version" to "$new_version"
23+
# A temp file is used to provide compatability with macOS development
24+
# as a result of macOS using the BSD version of sed
25+
tmp_file=/tmp/version.$$
26+
sed "s/$old_version/$new_version/" $VERSION_FILE > $tmp_file
27+
mv $tmp_file $VERSION_FILE
28+
git add $VERSION_FILE
29+
git commit -m"Bump version from $old_version to $new_version"
30+
git push
31+
;;
32+
finalize)
33+
new_version=$(python -c "import semver; print(semver.finalize_version('$old_version'))")
34+
echo Changing version from "$old_version" to "$new_version"
35+
# A temp file is used to provide compatability with macOS development
36+
# as a result of macOS using the BSD version of sed
37+
tmp_file=/tmp/version.$$
38+
sed "s/$old_version/$new_version/" $VERSION_FILE > $tmp_file
39+
mv $tmp_file $VERSION_FILE
40+
git add $VERSION_FILE
41+
git commit -m"Bump version from $old_version to $new_version"
42+
git push
43+
;;
44+
show)
45+
echo "$old_version"
46+
;;
47+
*)
48+
echo "$HELP_INFORMATION"
49+
;;
50+
esac
5151
fi

requirements-dev.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
--requirement requirements-test.txt
22
ipython
3+
mypy
34
semver

setup-env

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,14 @@ while (( "$#" )); do
5050
shift
5151
;;
5252
-*) # unsupported flags
53-
echo "Error: Unsupported flag $1" >&2
54-
exit 1
55-
;;
53+
echo "Error: Unsupported flag $1" >&2
54+
exit 1
55+
;;
5656
*) # preserve positional arguments
57-
PARAMS="$PARAMS $1"
58-
shift
59-
;;
60-
esac
57+
PARAMS="$PARAMS $1"
58+
shift
59+
;;
60+
esac
6161
done
6262

6363
# set positional arguments in their proper place

setup.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,17 @@ def get_version(version_file):
4848
description="HTTP content hasher",
4949
long_description=readme(),
5050
long_description_content_type="text/markdown",
51-
# NCATS "homepage"
52-
url="https://www.us-cert.gov/resources/ncats",
53-
# The project's main homepage
54-
download_url="https://github.com/cisagov/hash-http-content",
51+
# Landing page for CISA's cybersecurity mission
52+
url="https://www.cisa.gov/cybersecurity",
53+
# Additional URLs for this project per
54+
# https://packaging.python.org/guides/distributing-packages-using-setuptools/#project-urls
55+
project_urls={
56+
"Source": "https://github.com/cisagov/hash-http-content",
57+
"Tracker": "https://github.com/cisagov/hash-http-content/issues",
58+
},
5559
# Author details
56-
author="Cyber and Infrastructure Security Agency",
57-
author_email="ncats@hq.dhs.gov",
60+
author="Cybersecurity and Infrastructure Security Agency",
61+
author_email="github@cisa.dhs.gov",
5862
license="License :: CC0 1.0 Universal (CC0 1.0) Public Domain Dedication",
5963
# See https://pypi.python.org/pypi?%3Aaction=list_classifiers
6064
classifiers=[

0 commit comments

Comments
 (0)