-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Refactor base HTTP client to enable request limits to work (#67)
* feat: Refactor base HTTP client to enable request limits to work Fix CI/CD pipelines.
- Loading branch information
Showing
13 changed files
with
301 additions
and
164 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,9 @@ on: | |
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
env: | ||
POETRY_VERSION: 1.5.1 | ||
|
||
jobs: | ||
create-virtualenv: | ||
runs-on: ubuntu-latest | ||
|
@@ -20,29 +23,26 @@ jobs: | |
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
|
||
- name: virtualenv cache | ||
uses: syphar/[email protected] | ||
id: cache-virtualenv | ||
- name: Install Poetry | ||
uses: snok/install-poetry@v1 | ||
with: | ||
custom_cache_key_element: v1.2 | ||
version: ${{ env.POETRY_VERSION }} | ||
virtualenvs-create: true | ||
virtualenvs-in-project: true | ||
|
||
- name: pip cache | ||
uses: syphar/restore-pip-download-cache@v1 | ||
if: steps.cache-virtualenv.outputs.cache-hit != 'true' | ||
- name: Load cached venv | ||
id: cached-poetry-dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: .venv | ||
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} | ||
|
||
- name: Install Python dependencies | ||
if: steps.cache-virtualenv.outputs.cache-hit != 'true' | ||
env: | ||
POETRY_VERSION: 1.6.1 | ||
run: | | ||
pip install pip==23.2.1 setuptools==68.2.2 | ||
curl -sSL https://install.python-poetry.org | python3 - | ||
export VENV="$(poetry env info -p)" | ||
source ${VENV}/bin/activate | ||
poetry install --no-interaction | ||
- name: Install Dependencies | ||
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | ||
run: poetry install --no-interaction -vv | ||
|
||
- name: Log currently installed packages and versions | ||
run: pip list | ||
run: poetry show | ||
|
||
release: | ||
needs: create-virtualenv | ||
|
@@ -56,15 +56,19 @@ jobs: | |
if: startsWith(github.ref, 'refs/tags/') | ||
uses: actions/setup-python@v4 | ||
|
||
- name: Install Poetry | ||
uses: snok/install-poetry@v1 | ||
with: | ||
version: ${{ env.POETRY_VERSION }} | ||
virtualenvs-create: true | ||
virtualenvs-in-project: true | ||
|
||
- name: Release to PyPI | ||
if: startsWith(github.ref, 'refs/tags/') | ||
env: | ||
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} | ||
POETRY_VERSION: 1.6.1 | ||
POETRY_VERSION: ${{ env.POETRY_VERSION }} | ||
run: | | ||
pip install pip==23.2.1 setuptools==68.2.2 | ||
curl -sSL https://install.python-poetry.org | python3 - | ||
echo "$HOME/.local/bin" >> $GITHUB_PATH | ||
poetry build | ||
poetry config pypi-token.pypi $PYPI_TOKEN | ||
poetry publish |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,9 @@ on: | |
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
env: | ||
POETRY_VERSION: 1.5.1 | ||
|
||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | ||
jobs: | ||
create-virtualenv: | ||
|
@@ -30,35 +33,31 @@ jobs: | |
- name: Checkout source code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Python | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
allow-prereleases: true | ||
|
||
- name: virtualenv cache | ||
uses: syphar/[email protected] | ||
id: cache-virtualenv | ||
- name: Install Poetry | ||
uses: snok/install-poetry@v1 | ||
with: | ||
custom_cache_key_element: v1.2 | ||
version: ${{ env.POETRY_VERSION }} | ||
virtualenvs-create: true | ||
virtualenvs-in-project: true | ||
|
||
- name: pip cache | ||
uses: syphar/restore-pip-download-cache@v1 | ||
if: steps.cache-virtualenv.outputs.cache-hit != 'true' | ||
- name: Load cached venv | ||
id: cached-poetry-dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: .venv | ||
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} | ||
|
||
- name: Install Python dependencies | ||
if: steps.cache-virtualenv.outputs.cache-hit != 'true' | ||
env: | ||
POETRY_VERSION: 1.6.1 | ||
run: | | ||
pip install pip==23.2.1 setuptools==68.2.2 | ||
curl -sSL https://install.python-poetry.org | python3 - | ||
export VENV="$(poetry env info -p)" | ||
source ${VENV}/bin/activate | ||
poetry install --no-interaction -vv | ||
- name: Install Dependencies | ||
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | ||
run: poetry install --no-interaction -vv | ||
|
||
- name: Log currently installed packages and versions | ||
run: pip list | ||
run: poetry show | ||
|
||
linters-black: | ||
needs: create-virtualenv | ||
|
@@ -68,16 +67,30 @@ jobs: | |
uses: actions/checkout@v3 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v3 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: virtualenv cache | ||
uses: syphar/[email protected] | ||
id: cache-virtualenv | ||
- name: Install Poetry | ||
uses: snok/install-poetry@v1 | ||
with: | ||
custom_cache_key_element: v1.2 | ||
virtualenvs-create: true | ||
virtualenvs-in-project: true | ||
installer-parallel: true | ||
|
||
- name: Load cached venv | ||
id: cached-poetry-dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: .venv | ||
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} | ||
|
||
- name: Install dependencies | ||
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | ||
run: poetry install --no-interaction --no-root | ||
|
||
- name: Check code style | ||
run: black --check --line-length=120 --diff async_firebase | ||
run: poetry run black --check --line-length=120 --diff async_firebase | ||
|
||
linters-mypy: | ||
needs: create-virtualenv | ||
|
@@ -87,16 +100,32 @@ jobs: | |
uses: actions/checkout@v3 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v3 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: virtualenv cache | ||
uses: syphar/[email protected] | ||
id: cache-virtualenv | ||
- name: Install Poetry | ||
uses: snok/install-poetry@v1 | ||
with: | ||
custom_cache_key_element: v1.2 | ||
virtualenvs-create: true | ||
virtualenvs-in-project: true | ||
installer-parallel: true | ||
|
||
- name: Load cached venv | ||
id: cached-poetry-dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: .venv | ||
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} | ||
|
||
- name: Install dependencies | ||
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | ||
run: poetry install --no-interaction --no-root | ||
|
||
- name: Static type checker | ||
run: mypy --no-error-summary --hide-error-codes --follow-imports=skip async_firebase | ||
run: | | ||
python -m pip install types-setuptools | ||
poetry run mypy --install-types --no-error-summary --hide-error-codes --follow-imports=skip async_firebase | ||
test: | ||
needs: [ linters-black, linters-mypy ] | ||
|
@@ -109,18 +138,30 @@ jobs: | |
uses: actions/checkout@v3 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v3 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: virtualenv cache | ||
uses: syphar/[email protected] | ||
id: cache-virtualenv | ||
- name: Install Poetry | ||
uses: snok/install-poetry@v1 | ||
with: | ||
custom_cache_key_element: v1.2 | ||
virtualenvs-create: true | ||
virtualenvs-in-project: true | ||
installer-parallel: true | ||
|
||
- name: Load cached venv | ||
id: cached-poetry-dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: .venv | ||
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} | ||
|
||
- name: Install dependencies | ||
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | ||
run: poetry install --no-interaction --no-root | ||
|
||
- name: Run pytest | ||
run: pytest tests/ | ||
run: poetry run pytest tests/ | ||
|
||
- name: Submit coverage report | ||
if: github.ref == 'refs/heads/master' | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.