Skip to content

Commit

Permalink
chore: update project structure
Browse files Browse the repository at this point in the history
  • Loading branch information
escaped committed Jan 3, 2021
1 parent 2a3ed43 commit bdb4e6f
Show file tree
Hide file tree
Showing 12 changed files with 127 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .cruft.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"template": "https://github.com/escaped/cookiecutter-pypackage.git",
"commit": "b58e99ccf10eede92dee5810738871726199ecbb",
"commit": "46edce6ba837a29c6a7b6867ab259ce93391fd13",
"context": {
"cookiecutter": {
"author": "Alexander Frenzel",
Expand Down
13 changes: 13 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
## Description

Please include a summary of the proposed changes.

Fixes #(issue)

## Checklist

- [ ] Tests covering the new functionality have been added
- [ ] Code builds clean without any errors or warnings
- [ ] Documentation has been updated
- [ ] Changes have been added to the `CHANGELOG.md`
- [ ] You added yourself to the `CONTRIBUTORS.md`
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ jobs:
draft: ${{ steps.changelog_reader.outputs.status == 'unreleased' }}

publish:
needs: [release]
name: Build and publish Python distributions to PyPI
runs-on: ubuntu-latest
steps:
Expand Down
36 changes: 18 additions & 18 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
push:
branches:
- master
- main

jobs:
lint:
Expand All @@ -13,6 +14,8 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Set up Python
uses: actions/setup-python@v2
with:
Expand All @@ -32,9 +35,11 @@ jobs:
max-parallel: 4
matrix:
platform: [ubuntu-latest]
python-version: [3.6, 3.7, 3.8]
python-version: [3.6, 3.7, 3.8, 3.9]
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
Expand All @@ -48,24 +53,19 @@ jobs:
run: tox
env:
PLATFORM: ${{ matrix.platform }}
- name: coveralls
run: coveralls
env:
COVERALLS_PARALLEL: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Coveralls
uses: AndreMiras/coveralls-python-action@develop
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel: true

coveralls:
coveralls_finish:
needs: [test]
runs-on: ubuntu-latest
steps:
- name: Set up Python
uses: actions/setup-python@v2
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install coveralls
- name: coveralls
run: coveralls --finish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Coveralls Finished
uses: AndreMiras/coveralls-python-action@develop
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true

41 changes: 41 additions & 0 deletions .github/workflows/update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Update project structure
on:
schedule:
- cron: "0 0 * * *" # at the end of every day

jobs:
autoUpdateProject:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8.5

- name: Install dependencies
run: pip install cruft poetry jello

- name: Update project structure
run: |
cruft update -y
poetry lock --no-update # add new dependencies
poetry run pre-commit run -a
- name: Get new template version
# extract new cooiecutter template version
run: |
echo "TEMPLATE_COMMIT=$(cat .cruft.json | jello -r "_['commit'][:8]")" >> $GITHUB_ENV
# behaviour if PR already exists: https://github.com/marketplace/actions/create-pull-request#action-behaviour
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
with:
token: ${{ secrets.AUTO_UPDATE_GITHUB_TOKEN }}
commit-message: >-
chore: update project structure to ${{ env.TEMPLATE_COMMIT }}
title: "[Cruft] Auto-Update project structure"
body: ""
branch: chore/cookiecutter-pypackage
delete-branch: true

10 changes: 9 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,21 @@ repos:
language: system
entry: poetry run black
types: [python]

- repo: local
hooks:
- id: autoflake
name: autoflake
language: system
entry: poetry run autoflake --expand-star-imports --remove-all-unused-imports --remove-unused-variables --in-place --recursive test_proj/ video_encoding/
types: [python]

- repo: local
hooks:
- id: isort
name: isort
language: system
entry: poetry run isort -profile black
entry: poetry run isort
types: [python]

- repo: local
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) Alexander Frenzel.
Copyright (c) Alexander Frenzel <alex@relatedworks.com>.
All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
Expand Down
41 changes: 37 additions & 4 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,10 @@ django = ">=2.2"
pillow = ">=5.0"

[tool.poetry.dev-dependencies]
autoflake = "^1.4"
black = "^20.8b1"
flake8 = "^3.8.3"
flake8-bugbear = "^20.11.1"
isort = "^5.5.2"
mypy = "^0.782"
pre-commit = "^2.7.1"
Expand Down
3 changes: 2 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[isort]
line_length = 88
known_project = video_encoding
profile = black


[flake8]
Expand All @@ -17,6 +17,7 @@ max-complexity = 9


[coverage:run]
relative_files = True
branch = True
include = video_encoding/*
omit =
Expand Down
2 changes: 2 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ python =
3.6: py36
3.7: py37
3.8: py38
3.9: py39

[tox]
skipsdist = True
Expand All @@ -11,6 +12,7 @@ envlist =
py36-{2.2,3.0,3.1}
py37-{2.2,3.0,3.1}
py38-{2.2,3.0,3.1}
py39-{2.2,3.0,3.1}

[testenv]
skip_install = True
Expand Down
3 changes: 0 additions & 3 deletions video_encoding/backends/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ def encode(
All encoder specific options are passed in using `params`.
"""
pass

@abc.abstractmethod
def get_media_info(
Expand All @@ -30,7 +29,6 @@ def get_media_info(
"""
Return duration, width and height of the video.
"""
pass

@abc.abstractmethod
def get_thumbnail(
Expand All @@ -42,4 +40,3 @@ def get_thumbnail(
If the requested thumbnail is not within the duration of the video
an `InvalidTimeError` is thrown.
"""
pass

0 comments on commit bdb4e6f

Please sign in to comment.