Skip to content

Commit

Permalink
Move to Poetry
Browse files Browse the repository at this point in the history
  • Loading branch information
stuart-bradley committed Jan 25, 2022
1 parent bb19b82 commit c6cc1f8
Show file tree
Hide file tree
Showing 21 changed files with 1,073 additions and 592 deletions.
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
35 changes: 35 additions & 0 deletions .github/workflows/continuous_integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
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

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

0 comments on commit c6cc1f8

Please sign in to comment.