Skip to content

Commit

Permalink
Formatting to comply with standards (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrocamargo authored Jul 2, 2024
1 parent 80621d9 commit 3d695b9
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 16 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
strategy:
max-parallel: 6
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -57,7 +57,7 @@ jobs:

- name: Install dependencies
run: |
pip install setuptools build
pip install setuptools build wheel
- name: Builds package
run: |
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ dynamic = ["version"]
authors = [{ name = "Jeremy Carbaugh", email = "[email protected]" }]
classifiers = [
"Programming Language :: Python",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
Expand Down
9 changes: 2 additions & 7 deletions us/cli/states.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ def main():
import argparse

parser = argparse.ArgumentParser(description="Lookup state information")
parser.add_argument(
"query", metavar="QUERY", nargs=1, help="name, abbreviation, or FIPS code"
)
parser.add_argument("query", metavar="QUERY", nargs=1, help="name, abbreviation, or FIPS code")

args = parser.parse_args()

Expand All @@ -23,10 +21,7 @@ def main():
region = "territory" if data.pop("is_territory") else "state"

sys.stdout.write("\n")
sys.stdout.write(
"*** The great %s of %s (%s) ***\n\n"
% (region, data.pop("name"), data.pop("abbr"))
)
sys.stdout.write("*** The great %s of %s (%s) ***\n\n" % (region, data.pop("name"), data.pop("abbr")))

sys.stdout.write(" FIPS code: %s\n" % data.pop("fips"))

Expand Down
4 changes: 1 addition & 3 deletions us/states.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,7 @@ def lookup(val, field: Optional[str] = None, use_cache: bool = True) -> Optional
return matched_state


def mapping(
from_field: str, to_field: str, states: Optional[Iterable[State]] = None
) -> Dict[Any, Any]:
def mapping(from_field: str, to_field: str, states: Optional[Iterable[State]] = None) -> Dict[Any, Any]:
if states is None:
states = STATES_AND_TERRITORIES
return {getattr(s, from_field): getattr(s, to_field) for s in states}
Expand Down
4 changes: 1 addition & 3 deletions us/tests/test_us.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,7 @@ def test_jellyfish_metaphone():

def test_mapping():
states = us.STATES[:5]
assert us.states.mapping("abbr", "fips", states=states) == dict(
(s.abbr, s.fips) for s in states
)
assert us.states.mapping("abbr", "fips", states=states) == dict((s.abbr, s.fips) for s in states)


def test_obsolete_mapping():
Expand Down

0 comments on commit 3d695b9

Please sign in to comment.