Skip to content

Commit 11ae525

Browse files
authored
Release v1.2.0 (#40)
* bump workflow actions to latest version * bump pyproject version to 1.2.0 * update workflow * add --version option to all namespaces * update readme, include auto-completion docs * update codecov action * add 3.11 and 3.12 to pyproject.toml
1 parent 5da8799 commit 11ae525

File tree

11 files changed

+84
-39
lines changed

11 files changed

+84
-39
lines changed
Lines changed: 28 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
---
12
# This workflow will install Python dependencies, run tests and lint
23
# On publish event, it will build and publish a package to PyPI
3-
44
name: Lint, Test & Upload fred-py-api
55

66
on:
@@ -9,60 +9,69 @@ on:
99
push:
1010
branches: ["main"]
1111
pull_request:
12-
branches: [ "main" ]
12+
branches: ["main"]
1313

1414
jobs:
1515
build:
16-
17-
runs-on: ubuntu-latest
16+
runs-on: ubuntu-22.04
1817
strategy:
1918
fail-fast: false
2019
matrix:
21-
python-version: ["3.10"]
20+
python-version: ["3.12"]
2221
env:
2322
FRED_API_KEY: ${{ secrets.FRED_API_KEY }}
2423
TEST_FRED_API_KEY__API: ${{ secrets.TEST_FRED_API_KEY__API }}
2524
TEST_FRED_API_KEY__CLI: ${{ secrets.TEST_FRED_API_KEY__CLI }}
26-
2725
steps:
28-
- uses: actions/checkout@v3
26+
- uses: actions/checkout@v4
27+
2928
- name: Set up Python ${{ matrix.python-version }}
30-
uses: actions/setup-python@v3
29+
uses: actions/setup-python@v5
3130
with:
3231
python-version: ${{ matrix.python-version }}
32+
3333
- name: Install dependencies
3434
run: |
35-
python -m pip install --upgrade pip
36-
python -m pip install -e .[ci]
35+
python3 -m pip install --upgrade pip
36+
python3 -m pip install -e .[ci]
37+
3738
- name: Lint with black
3839
run: |
3940
# Run black on all Python files
4041
black --check ./
42+
4143
- name: Test with coverage
4244
run: |
4345
coverage run -m unittest
4446
coverage report -m
47+
4548
- name: Upload coverage report
46-
uses: codecov/codecov-action@v2
49+
uses: codecov/codecov-action@v4
50+
with:
51+
token: ${{ secrets.CODECOV_TOKEN }}
52+
fail_ci_if_error: true
4753

4854
pypi:
4955
needs: build
50-
runs-on: ubuntu-latest
56+
runs-on: ubuntu-22.04
5157
if: github.event_name == 'release'
5258
steps:
53-
- uses: actions/checkout@v3
59+
- uses: actions/checkout@v4
60+
5461
- name: Set up Python
55-
uses: actions/setup-python@v3
62+
uses: actions/setup-python@v5
5663
with:
57-
python-version: '3.x'
64+
python-version: '3.12'
65+
5866
- name: Install dependencies
5967
run: |
60-
python -m pip install --upgrade pip
61-
pip install build
68+
python3 -m pip install --upgrade pip build
69+
6270
- name: Build package
63-
run: python -m build
71+
run: python3 -m build
72+
6473
- name: Publish package
65-
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
74+
uses: pypa/gh-action-pypi-publish@v1
6675
with:
6776
user: __token__
6877
password: ${{ secrets.PYPI_API_TOKEN }}

README.md

Lines changed: 46 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,52 @@
33
[![Supported Python Versions](https://img.shields.io/pypi/pyversions/fred-py-api?style=flat)](https://pypi.org/project/fred-py-api/)
44
[![codecov](https://codecov.io/gh/zachspar/fred-py-api/branch/main/graph/badge.svg?token=BG1948D8Y7)](https://codecov.io/gh/zachspar/fred-py-api)
55

6-
# Fred Python API
7-
A fully-featured FRED Command Line Interface & Python API Wrapper.
6+
# Fred CLI & Python API
7+
A fully-featured FRED Command-Line Interface & Python API Wrapper.
88

9-
### Documentation:
10-
- [fred-py-api Docs](https://fred-py-api.readthedocs.io/en/latest/)
9+
## Python API Documentation:
10+
- [fred-py-api Docs](https://fred-py-api.readthedocs.io/en/latest/)
1111

12-
### Wiki:
13-
- [fred-py-api Wiki](https://github.com/zachspar/fred-py-api/wiki)
12+
## Wiki:
13+
- [fred-py-api Wiki](https://github.com/zachspar/fred-py-api/wiki)
1414

15-
### FRED References:
16-
- [Create an API Key Here](https://fredaccount.stlouisfed.org/apikey)
17-
- [API Documentation](https://fred.stlouisfed.org/docs/api/fred/)
15+
## FRED References:
16+
- [Create an API Key Here](https://fredaccount.stlouisfed.org/apikey)
17+
- [API Documentation](https://fred.stlouisfed.org/docs/api/fred/)
18+
19+
## Shell Auto-Completion:
20+
Fred CLI supports auto-completion for `zsh`, `bash` and `fish` shells. See instructions
21+
for each directly below.
22+
23+
### `zsh` Completions
24+
Add this to `~/.zshrc`
25+
```zsh
26+
eval "$(_FRED_COMPLETE=zsh_source fred)"
27+
eval "$(_CATEGORIES_COMPLETE=zsh_source categories)"
28+
eval "$(_RELEASES_COMPLETE=zsh_source releases)"
29+
eval "$(_SERIES_COMPLETE=zsh_source series)"
30+
eval "$(_SOURCES_COMPLETE=zsh_source sources)"
31+
eval "$(_TAGS_COMPLETE=zsh_source tags)"
32+
```
33+
34+
### `bash` Completions
35+
Add this to `~/.bashrc`
36+
```bash
37+
eval "$(_FRED_COMPLETE=bash_source fred)"
38+
eval "$(_CATEGORIES_COMPLETE=bash_source categories)"
39+
eval "$(_RELEASES_COMPLETE=bash_source releases)"
40+
eval "$(_SERIES_COMPLETE=bash_source series)"
41+
eval "$(_SOURCES_COMPLETE=bash_source sources)"
42+
eval "$(_TAGS_COMPLETE=bash_source tags)"
43+
```
44+
45+
### `fish` Completions
46+
Add this to `~/.config/fish/completions/fred.fish`
47+
```fish
48+
_FRED_COMPLETE=fish_source fred | source
49+
_CATEGORIES_COMPLETE=fish_source categories | source
50+
_RELEASES_COMPLETE=fish_source releases | source
51+
_SERIES_COMPLETE=fish_source series | source
52+
_SOURCES_COMPLETE=fish_source sources | source
53+
_TAGS_COMPLETE=fish_source tags | source
54+
```

docs/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
project = "fred-py-api"
1414
copyright = "2024, Zachary Spar"
1515
author = "Zachary Spar"
16-
release = "1.1.3"
16+
release = "1.2.0"
1717

1818
# -- General configuration ---------------------------------------------------
1919
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

pyproject.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "fred-py-api"
7-
version = "1.1.3"
7+
version = "1.2.0"
88
authors = [
99
{ name="Zachary Spar", email="[email protected]" },
10-
{ name="Prasiddha Parthsarthy", email="[email protected]" },
1110
]
1211
description = "A fully featured FRED Command Line Interface & Python API client library."
1312
readme = "README.md"
@@ -22,6 +21,8 @@ classifiers = [
2221
"Programming Language :: Python :: 3.8",
2322
"Programming Language :: Python :: 3.9",
2423
"Programming Language :: Python :: 3.10",
24+
"Programming Language :: Python :: 3.11",
25+
"Programming Language :: Python :: 3.12",
2526
"License :: OSI Approved :: MIT License",
2627
"Operating System :: OS Independent",
2728
]

src/fred/cli/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
@group()
2020
@click.option("--api-key", type=click.STRING, required=False, help="FRED API key.")
21+
@click.version_option(version="1.2.0")
2122
@click.pass_context
2223
def fred_cli(ctx: click.Context, api_key: str):
2324
"""CLI for the Federal Reserve Economic Data (FRED)."""

src/fred/cli/categories.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
@click.group()
1717
@click.option("--api-key", type=click.STRING, required=False, help="FRED API key.")
18+
@click.version_option(version="1.2.0")
1819
@click.pass_context
1920
def categories(ctx: click.Context, api_key: str):
2021
"""

src/fred/cli/releases.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
@click.group()
1414
@click.option("--api-key", type=click.STRING, required=False, help="FRED API key.")
15+
@click.version_option(version="1.2.0")
1516
@click.pass_context
1617
def releases(ctx: click.Context, api_key: str):
1718
"""

src/fred/cli/series.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
@click.group()
1717
@click.option("--api-key", type=click.STRING, required=False, help="FRED API key.")
18+
@click.version_option(version="1.2.0")
1819
@click.pass_context
1920
def series(ctx: click.Context, api_key: str):
2021
"""

src/fred/cli/sources.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
@click.group()
1717
@click.option("--api-key", type=click.STRING, required=False, help="FRED API key.")
18+
@click.version_option(version="1.2.0")
1819
@click.pass_context
1920
def sources(ctx: click.Context, api_key: str):
2021
"""

src/fred/cli/tags.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
@click.group()
1717
@click.option("--api-key", type=click.STRING, required=False, help="FRED API key.")
18+
@click.version_option(version="1.2.0")
1819
@click.pass_context
1920
def tags(ctx: click.Context, api_key: str):
2021
"""

0 commit comments

Comments
 (0)