Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf: sync configurations with gotrue-py (#66)
* fix: interpolations errors and other things reported by sourcery-ai * perf: sync configurations with gotrue-py * fix: warning of precommits rules
- Loading branch information
Showing
27 changed files
with
1,331 additions
and
285 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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.203.0/containers/python-3/.devcontainer/base.Dockerfile | ||
|
||
# [Choice] Python version (use -bullseye variants on local arm64/Apple Silicon): 3, 3.10, 3.9, 3.8, 3.7, 3.6, 3-bullseye, 3.10-bullseye, 3.9-bullseye, 3.8-bullseye, 3.7-bullseye, 3.6-bullseye, 3-buster, 3.10-buster, 3.9-buster, 3.8-buster, 3.7-buster, 3.6-buster | ||
ARG VARIANT="3.10-bullseye" | ||
FROM mcr.microsoft.com/vscode/devcontainers/python:0-${VARIANT} | ||
|
||
# [Choice] Node.js version: none, lts/*, 16, 14, 12, 10 | ||
ARG NODE_VERSION="none" | ||
RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi | ||
|
||
# [Optional] If your pip requirements rarely change, uncomment this section to add them to the image. | ||
# COPY requirements.txt /tmp/pip-tmp/ | ||
# RUN pip3 --disable-pip-version-check --no-cache-dir install -r /tmp/pip-tmp/requirements.txt \ | ||
# && rm -rf /tmp/pip-tmp | ||
|
||
# [Optional] Uncomment this section to install additional OS packages. | ||
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ | ||
# && apt-get -y install --no-install-recommends <your-package-list-here> | ||
|
||
# [Optional] Uncomment this line to install global node packages. | ||
# RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g <your-package-here>" 2>&1 |
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 |
---|---|---|
@@ -0,0 +1,81 @@ | ||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: | ||
// https://github.com/microsoft/vscode-dev-containers/tree/v0.203.0/containers/python-3 | ||
{ | ||
"name": "Python 3", | ||
"runArgs": [ | ||
"--init" | ||
], | ||
"build": { | ||
"dockerfile": "Dockerfile", | ||
"context": "..", | ||
"args": { | ||
// Update 'VARIANT' to pick a Python version: 3, 3.10, 3.9, 3.8, 3.7, 3.6 | ||
// Append -bullseye or -buster to pin to an OS version. | ||
// Use -bullseye variants on local on arm64/Apple Silicon. | ||
"VARIANT": "3.10-bullseye", | ||
// Options | ||
"NODE_VERSION": "lts/*" | ||
} | ||
}, | ||
// Set *default* container specific settings.json values on container create. | ||
"settings": { | ||
"python.pythonPath": "/usr/local/bin/python", | ||
"python.languageServer": "Pylance", | ||
"python.linting.enabled": true, | ||
"python.linting.flake8Enabled": true, | ||
"python.formatting.autopep8Path": "/usr/local/py-utils/bin/autopep8", | ||
"python.formatting.blackPath": "/usr/local/py-utils/bin/black", | ||
"python.formatting.yapfPath": "/usr/local/py-utils/bin/yapf", | ||
"python.linting.banditPath": "/usr/local/py-utils/bin/bandit", | ||
"python.linting.flake8Path": "/usr/local/py-utils/bin/flake8", | ||
"python.linting.mypyPath": "/usr/local/py-utils/bin/mypy", | ||
"python.linting.pycodestylePath": "/usr/local/py-utils/bin/pycodestyle", | ||
"python.linting.pydocstylePath": "/usr/local/py-utils/bin/pydocstyle", | ||
"python.linting.pylintPath": "/usr/local/py-utils/bin/pylint", | ||
"python.analysis.diagnosticMode": "workspace", | ||
"files.exclude": { | ||
"**/.ipynb_checkpoints": true, | ||
"**/.pytest_cache": true, | ||
"**/*pycache*": true | ||
}, | ||
"python.formatting.provider": "black", | ||
"python.linting.flake8Args": [ | ||
"--max-line-length=88", | ||
"--extend-ignore=E203" | ||
], | ||
"editor.formatOnSave": true, | ||
"editor.codeActionsOnSave": { | ||
"source.organizeImports": true | ||
}, | ||
"python.sortImports.args": [ | ||
"--multi-line=3", | ||
"--trailing-comma", | ||
"--force-grid-wrap=0", | ||
"--use-parentheses", | ||
"--line-width=88", | ||
] | ||
}, | ||
// Add the IDs of extensions you want installed when the container is created. | ||
"extensions": [ | ||
"ms-python.python", | ||
"ms-python.vscode-pylance", | ||
"ms-azuretools.vscode-docker", | ||
"donjayamanne.githistory", | ||
"felipecaputo.git-project-manager", | ||
"github.copilot-nightly", | ||
"eamodio.gitlens", | ||
"davidanson.vscode-markdownlint" | ||
], | ||
// Use 'forwardPorts' to make a list of ports inside the container available locally. | ||
// "forwardPorts": [], | ||
// Use 'postCreateCommand' to run commands after the container is created. | ||
// "postCreateCommand": "pip3 install --user -r requirements.txt", | ||
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. | ||
"remoteUser": "vscode", | ||
"features": { | ||
"docker-in-docker": "latest", | ||
"git": "latest", | ||
"git-lfs": "latest", | ||
"github-cli": "latest" | ||
} | ||
} |
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 |
---|---|---|
@@ -1,11 +1,7 @@ | ||
# To get started with Dependabot version updates, you'll need to specify which | ||
# package ecosystems to update and where the package manifests are located. | ||
# Please see the documentation for all configuration options: | ||
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates | ||
|
||
version: 2 | ||
updates: | ||
- package-ecosystem: "pip" # See documentation for possible values | ||
directory: "/" # Location of package manifests | ||
- package-ecosystem: "pip" | ||
directory: "/" | ||
schedule: | ||
interval: "monthly" | ||
interval: "daily" | ||
target-branch: "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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: CI/CD | ||
|
||
on: [pull_request, push, workflow_dispatch] | ||
|
||
jobs: | ||
test: | ||
name: Test / OS ${{ matrix.os }} / Python ${{ matrix.python-version }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
python-version: [3.7, 3.8, 3.9, '3.10'] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Clone Repository | ||
uses: actions/checkout@v2 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Set up Poetry | ||
uses: abatilo/actions-poetry@v2.1.4 | ||
with: | ||
poetry-version: 1.1.12 | ||
- name: Run Tests | ||
run: make run_tests | ||
- name: Upload Coverage | ||
uses: codecov/codecov-action@v1 | ||
|
||
publish: | ||
needs: test | ||
if: ${{ !startsWith(github.event.head_commit.message, 'bump') && !startsWith(github.event.head_commit.message, 'chore') && github.ref == 'refs/heads/master' && github.event_name == 'push' }} | ||
runs-on: ubuntu-latest | ||
name: "Bump version, create changelog and publish" | ||
steps: | ||
- name: Clone Repository | ||
uses: actions/checkout@v2 | ||
with: | ||
ref: ${{ github.ref }} | ||
fetch-depth: 0 | ||
- name: Python Semantic Release | ||
uses: relekang/python-semantic-release@master | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
repository_username: __token__ | ||
repository_password: ${{ secrets.PYPI_TOKEN }} |
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 |
---|---|---|
@@ -1,5 +1,7 @@ | ||
# CHANGELOG | ||
|
||
<!--next-version-placeholder--> | ||
|
||
### v0.5.0 | ||
|
||
#### Features | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,28 @@ | ||
install: install_poetry | ||
install: | ||
poetry install | ||
|
||
install_poetry: | ||
curl -sSL https://install.python-poetry.org | python - | ||
|
||
precommit: install | ||
tests: install tests_only tests_pre_commit | ||
|
||
tests_pre_commit: | ||
poetry run pre-commit run --all-files | ||
|
||
tests: install | ||
tests_only: | ||
poetry run pytest --cov=./ --cov-report=xml -vv | ||
|
||
build: install | ||
poetry run unasync postgrest_py tests | ||
run_infra: | ||
cd infra &&\ | ||
docker-compose down &&\ | ||
docker-compose up -d | ||
|
||
clean_infra: | ||
cd infra &&\ | ||
docker-compose down --remove-orphans &&\ | ||
docker system prune -a --volumes -f | ||
|
||
clean: | ||
sudo rm -r .venv | ||
run_tests: tests | ||
|
||
build_sync: | ||
poetry run unasync postgrest_py tests |
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
File renamed without changes.
Oops, something went wrong.