Skip to content
This repository was archived by the owner on Nov 10, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
23 changes: 11 additions & 12 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,21 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
# Avoid caching to be 100% confident things are working properly
- name: Init python poetry action
uses: abatilo/actions-poetry@v2.1.0

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
run: poetry install

- name: Check that formatting, linting, and tests pass
run: |
make ci
run: poetry run make ci

- name: Check docs are up to date
run: |
make docs-build-ci
- name: Install poetry
run: |
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python
run: poetry run make docs-build-ci

- name: Build distribution
run: |
source $HOME/.poetry/env && poetry build
run: poetry build

- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
Expand Down
12 changes: 5 additions & 7 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ jobs:
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Python Poetry Action
uses: abatilo/actions-poetry@v2.1.0
- uses: actions/cache@v1
id: cache-deps
with:
Expand All @@ -27,9 +29,7 @@ jobs:
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
run: poetry install
- uses: actions/cache@v1
with:
path: .mypy_cache
Expand All @@ -41,9 +41,7 @@ jobs:
- name: Check docs build
# only run this for the python version used by netlify:
if: matrix.python-version == 3.8
run: |
make docs-build-ci
run: poetry run make docs-build-ci
- name: Check that formatting, linting, and tests pass
run: |
make ci
run: poetry run make ci

2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ First, you might want to see the basic ways to [help and get help](help-fastapi-

Once you've cloned the repository, here are some guidelines to set up your environment:

### Set up the development evironment
### Set up the development environment

After cloning the repository, you can use `poetry` to create a virtual environment:

Expand Down
2 changes: 1 addition & 1 deletion docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ First, you might want to see the basic ways to [help and get help](help-fastapi-

Once you've cloned the repository, here are some guidelines to set up your environment:

### Set up the development evironment
### Set up the development environment

After cloning the repository, you can use `poetry` to create a virtual environment:

Expand Down
2 changes: 1 addition & 1 deletion fastapi_restful/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "0.2.4.3"
__version__ = "0.2.5"

from .cbv_base import Api, Resource, set_responses, take_init_parameters

Expand Down
10 changes: 5 additions & 5 deletions fastapi_restful/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
def repeat_every(
*,
seconds: float,
wait_first: bool = False,
wait_first: float = None,
logger: Optional[logging.Logger] = None,
raise_exceptions: bool = False,
max_repetitions: Optional[int] = None,
Expand All @@ -30,8 +30,8 @@ def repeat_every(
----------
seconds: float
The number of seconds to wait between repeated calls
wait_first: bool (default False)
If True, the function will wait for a single period before the first call
wait_first: float (default None)
If not None, the function will wait for the given duration before the first call
logger: Optional[logging.Logger] (default None)
The logger to use to log any exceptions raised by calls to the decorated function.
If not provided, exceptions will not be logged by this function (though they may be handled by the event loop).
Expand All @@ -56,8 +56,8 @@ async def wrapped() -> None:

async def loop() -> None:
nonlocal repetitions
if wait_first:
await asyncio.sleep(seconds)
if wait_first is not None:
await asyncio.sleep(wait_first)
while max_repetitions is None or repetitions < max_repetitions:
try:
if is_coroutine:
Expand Down
Loading