Skip to content

Commit

Permalink
Merge pull request #7 from cisagov/improvement/merge_in_upstream_chan…
Browse files Browse the repository at this point in the history
…ges_from_skeleton_python_library

Merge in upstream changes from skeleton-python-library
  • Loading branch information
jsf9k committed May 3, 2019
2 parents 820b0cd + 5e04d85 commit 021bb2c
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 5 deletions.
4 changes: 3 additions & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ max-line-length = 80
# Select (turn on)
# * Complexity violations reported by mccabe (C) -
# http://flake8.pycqa.org/en/latest/user/error-codes.html#error-violation-codes
# * Documentation conventions compliance reported by pydocstyle (D) -
# http://www.pydocstyle.org/en/stable/error_codes.html
# * Default errors and warnings reported by pycodestyle (E and W) -
# https://pycodestyle.readthedocs.io/en/latest/intro.html#error-codes
# * Default errors reported by pyflakes (F) -
Expand All @@ -11,7 +13,7 @@ max-line-length = 80
# https://github.com/PyCQA/flake8-bugbear#list-of-warnings
# * The B950 flake8-bugbear opinionated warning -
# https://github.com/PyCQA/flake8-bugbear#opinionated-warnings
select = C,E,F,W,B,B950
select = C,D,E,F,W,B,B950
# Ignore flake8's default warning about maximum line length, which has
# a hard stop at the configured value. Instead we use
# flake8-bugbear's B950, which allows up to 10% overage.
Expand Down
2 changes: 2 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ repos:
rev: 3.7.7
hooks:
- id: flake8
additional_dependencies:
- flake8-docstrings
- repo: https://github.com/asottile/pyupgrade
rev: v1.14.0
hooks:
Expand Down
2 changes: 2 additions & 0 deletions mongo_db_from_config/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"""This package contains the mongo_db_from_config code."""

from .mongo_db_from_config import db_from_config

__version__ = "0.0.1"
Expand Down
7 changes: 5 additions & 2 deletions mongo_db_from_config/mongo_db_from_config.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
"""This module contains the mongo_db_from_config code."""


def db_from_config(config_filename):
"""Given the name of the YAML file containing the configuration
information, return a corresponding MongoDB connection.
"""Given a YAML file, return a corresponding MongoDB connection.
Sample config file:
database:
Expand All @@ -25,6 +27,7 @@ def db_from_config(config_filename):
KeyError: If the YAML in the database configuration file is valid YAML
but does not contain the expected keys
"""
# third-party libraries (install with pip)
from pymongo import MongoClient
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
"""
setup module for mongo-db-from-config
This is the setup module for mongo-db-from-config.
Based on:
- https://packaging.python.org/distributing/
- https://github.com/pypa/sampleproject/blob/master/setup.py
"""
Expand All @@ -12,6 +11,7 @@


def readme():
"""Read in and return the contents of the project's README.md file."""
with open("README.md") as f:
return f.read()

Expand Down

0 comments on commit 021bb2c

Please sign in to comment.