Skip to content
This repository was archived by the owner on Aug 24, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
ecdfc52
Add the beautysh pre-commit hook
mcdonnnj Jan 15, 2021
12033ed
Add the mypy package to dev rquirements
mcdonnnj Feb 5, 2021
6bd93ff
Update pre-commit hooks with `pre-commit autoupdate`
mcdonnnj Feb 1, 2021
b54a0fc
Update the URL used for our Python packages
mcdonnnj Feb 11, 2021
7409f9d
Update the author_email field in package metadata
mcdonnnj Feb 11, 2021
19e1fb9
Remove download_url field and add project_urls field to package metadata
mcdonnnj Feb 11, 2021
7f96877
Fix capitalization of Python in description metadata
mcdonnnj Feb 11, 2021
de06bbc
Fix agency name in author metadata
mcdonnnj Feb 11, 2021
c97a883
Revert ansible-lint version update
mcdonnnj Feb 16, 2021
3313850
Merge pull request #69 from cisagov/maintenance/update_pre-commit_hooks
mcdonnnj Feb 16, 2021
c025046
Merge branch 'develop' into improvement/add_beautysh_pre-commit_hook
mcdonnnj Feb 16, 2021
09744fa
Merge pull request #67 from cisagov/improvement/add_beautysh_pre-comm…
mcdonnnj Feb 16, 2021
6fa89b5
Merge https://github.com/cisagov/skeleton-generic into lineage/skeleton
Feb 16, 2021
4d8089e
Autoformat bump_version.sh with beautysh
mcdonnnj Feb 16, 2021
3619cfd
Merge pull request #68 from cisagov/lineage/skeleton
mcdonnnj Feb 17, 2021
5b34e86
Merge branch 'develop' into improvement/add_mypy_to_dev_requirements
mcdonnnj Feb 17, 2021
ec60d4a
Merge pull request #65 from cisagov/improvement/add_mypy_to_dev_requi…
mcdonnnj Feb 17, 2021
3b21b3d
Merge branch 'develop' into improvement/update_package_metadata
mcdonnnj Feb 17, 2021
a7d1b25
Merge pull request #67 from cisagov/improvement/update_package_metadata
mcdonnnj Feb 17, 2021
0edc3e0
Merge github.com:cisagov/skeleton-python-library into lineage/skeleton
mcdonnnj Feb 26, 2021
cc0b336
Autoformat build.sh with beautysh
mcdonnnj Feb 26, 2021
d065768
Merge pull request #24 from cisagov/lineage/skeleton
mcdonnnj Mar 1, 2021
0036ea0
Merge github.com:cisagov/skeleton-aws-lambda into lineage/skeleton
mcdonnnj Mar 2, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,20 @@ repos:
hooks:
- id: prettier
- repo: https://github.com/adrienverge/yamllint
rev: v1.25.0
rev: v1.26.0
hooks:
- id: yamllint
args:
- --strict

# Shell script hooks
- repo: https://github.com/lovesegfault/beautysh
rev: 6.0.1
hooks:
- id: beautysh
args:
- --indent-size
- '2'
- repo: https://github.com/detailyang/pre-commit-shell
rev: 1.0.5
hooks:
Expand Down Expand Up @@ -85,16 +92,18 @@ repos:
hooks:
- id: isort
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.790
rev: v0.800
hooks:
- id: mypy
- repo: https://github.com/asottile/pyupgrade
rev: v2.7.4
rev: v2.10.0
hooks:
- id: pyupgrade

# Ansible hooks
- repo: https://github.com/ansible-community/ansible-lint
# This is intentionally being held back because of issues in v5 per
# https://github.com/cisagov/skeleton-ansible-role/issues/69
rev: v4.3.7
hooks:
- id: ansible-lint
Expand Down
4 changes: 2 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,12 @@ cp lambda_handler.py "$BUILD_DIR"
OUTPUT_DIR="/output"
if [ ! -d "$OUTPUT_DIR" ]
then
mkdir "$OUTPUT_DIR"
mkdir "$OUTPUT_DIR"
fi

if [ -e "$OUTPUT_DIR/$ZIP_FILE" ]
then
rm "$OUTPUT_DIR/$ZIP_FILE"
rm "$OUTPUT_DIR/$ZIP_FILE"
fi

cd $BUILD_DIR
Expand Down
66 changes: 33 additions & 33 deletions bump_version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,38 +14,38 @@ old_version=$(sed -n "s/^__version__ = \"\(.*\)\"$/\1/p" $VERSION_FILE)

if [ $# -ne 1 ]
then
echo "$HELP_INFORMATION"
echo "$HELP_INFORMATION"
else
case $1 in
major|minor|patch|prerelease|build)
new_version=$(python -c "import semver; print(semver.bump_$1('$old_version'))")
echo Changing version from "$old_version" to "$new_version"
# A temp file is used to provide compatability with macOS development
# as a result of macOS using the BSD version of sed
tmp_file=/tmp/version.$$
sed "s/$old_version/$new_version/" $VERSION_FILE > $tmp_file
mv $tmp_file $VERSION_FILE
git add $VERSION_FILE
git commit -m"Bump version from $old_version to $new_version"
git push
;;
finalize)
new_version=$(python -c "import semver; print(semver.finalize_version('$old_version'))")
echo Changing version from "$old_version" to "$new_version"
# A temp file is used to provide compatability with macOS development
# as a result of macOS using the BSD version of sed
tmp_file=/tmp/version.$$
sed "s/$old_version/$new_version/" $VERSION_FILE > $tmp_file
mv $tmp_file $VERSION_FILE
git add $VERSION_FILE
git commit -m"Bump version from $old_version to $new_version"
git push
;;
show)
echo "$old_version"
;;
*)
echo "$HELP_INFORMATION"
;;
esac
case $1 in
major|minor|patch|prerelease|build)
new_version=$(python -c "import semver; print(semver.bump_$1('$old_version'))")
echo Changing version from "$old_version" to "$new_version"
# A temp file is used to provide compatability with macOS development
# as a result of macOS using the BSD version of sed
tmp_file=/tmp/version.$$
sed "s/$old_version/$new_version/" $VERSION_FILE > $tmp_file
mv $tmp_file $VERSION_FILE
git add $VERSION_FILE
git commit -m"Bump version from $old_version to $new_version"
git push
;;
finalize)
new_version=$(python -c "import semver; print(semver.finalize_version('$old_version'))")
echo Changing version from "$old_version" to "$new_version"
# A temp file is used to provide compatability with macOS development
# as a result of macOS using the BSD version of sed
tmp_file=/tmp/version.$$
sed "s/$old_version/$new_version/" $VERSION_FILE > $tmp_file
mv $tmp_file $VERSION_FILE
git add $VERSION_FILE
git commit -m"Bump version from $old_version to $new_version"
git push
;;
show)
echo "$old_version"
;;
*)
echo "$HELP_INFORMATION"
;;
esac
fi
1 change: 1 addition & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
--requirement requirements-test.txt
ipython
mypy
semver
14 changes: 7 additions & 7 deletions setup-env
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@ while (( "$#" )); do
shift
;;
-*) # unsupported flags
echo "Error: Unsupported flag $1" >&2
exit 1
;;
echo "Error: Unsupported flag $1" >&2
exit 1
;;
*) # preserve positional arguments
PARAMS="$PARAMS $1"
shift
;;
esac
PARAMS="$PARAMS $1"
shift
;;
esac
done

# set positional arguments in their proper place
Expand Down
16 changes: 10 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,17 @@ def get_version(version_file):
description="Ingest data to a Mongo database",
long_description=readme(),
long_description_content_type="text/markdown",
# NCATS "homepage"
url="https://www.us-cert.gov/resources/ncats",
# The project's main homepage
download_url="https://github.com/cisagov/findings-data-import-lambda",
# Landing page for CISA's cybersecurity mission
url="https://www.cisa.gov/cybersecurity",
# Additional URLs for this project per
# https://packaging.python.org/guides/distributing-packages-using-setuptools/#project-urls
project_urls={
"Source": "https://github.com/cisagov/findings-data-import-lambda",
"Tracker": "https://github.com/cisagov/findings-data-import-lambda/issues",
},
# Author details
author="Cyber and Infrastructure Security Agency",
author_email="ncats@hq.dhs.gov",
author="Cybersecurity and Infrastructure Security Agency",
author_email="github@cisa.dhs.gov",
license="License :: CC0 1.0 Universal (CC0 1.0) Public Domain Dedication",
# See https://pypi.python.org/pypi?%3Aaction=list_classifiers
classifiers=[
Expand Down