Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CORE-211 Poetry Update #13

Merged
merged 5 commits into from
Jan 25, 2022
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
9 changes: 0 additions & 9 deletions .bumpversion.cfg

This file was deleted.

10 changes: 10 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[run]
branch = True
source =
drf_react_template
omit =
*example*
*tests*

[report]
show_missing = True
30 changes: 30 additions & 0 deletions .github/actions/drf-react-template-framework-build/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: 'DRF React Template Framework Build'
description: 'DRF React Template Framework build steps'
inputs:
python-version:
description: 'Python version to use'
required: true
default: '3.10'
runs:
using: "composite"
steps:
- name: Set up Python ${{ inputs.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ inputs.python-version }}
- name: Install Poetry
uses: snok/install-poetry@v1.3
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v2
with:
path: .venv
key: venv-${{ 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
shell: bash
45 changes: 45 additions & 0 deletions .github/workflows/continuous_integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: "Continuous Integration"
on: [push]

jobs:
lint:
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.10.0
uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Run pre-commit
uses: pre-commit/action@v2.0.0

test:
needs: lint
runs-on: ubuntu-latest
strategy:
matrix:
python: ["3.7", "3.8", "3.9", "3.10"]
fail-fast: false
services:
postgres:
image: postgres:12.5
env:
POSTGRES_DB: yoflow
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports:
- 5432:5432
# needed because the postgres container does not provide a healthcheck
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- name: Check out repository
uses: actions/checkout@v2
- name: Build steps
uses: ./.github/actions/drf-react-template-framework-build
with:
python-version: ${{ matrix.python }}
- name: Test with pytest
run: |
poetry run pytest --cov
22 changes: 22 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Release

on:
release:
types:
- created

jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v2
- name: Build steps
uses: ./.github/actions/drf-react-template-framework-build
with:
python-version: "3.10"
- name: Build and publish
uses: d1618033/gh-action-python-publish-using-poetry@0.1.1
with:
pypi_username: '__token__'
pypi_password: ${{ secrets.PYPI_TOKEN }}
9 changes: 9 additions & 0 deletions .isort.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[settings]
; Taken from https://black.readthedocs.io/en/stable/compatible_configs.html#isort
multi_line_output = 3
include_trailing_comma = True
force_grid_wrap = 0
use_parentheses = True
ensure_newline_before_comments = True
line_length = 88
known_third_party = django,factory,pytest,rest_framework,six
24 changes: 24 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
repos:
- repo: https://github.com/asottile/seed-isort-config
rev: v1.9.4
hooks:
- id: seed-isort-config
- repo: https://github.com/PyCQA/isort
rev: 5.5.4
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: 21.12b0
hooks:
- id: black
language_version: python3.10
- repo: https://gitlab.com/pycqa/flake8
rev: 3.8.4
hooks:
- id: flake8

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
- id: check-ast
- id: debug-statements
File renamed without changes.
25 changes: 0 additions & 25 deletions Pipfile

This file was deleted.

Loading