Skip to content

Commit 2b76d9d

Browse files
committed
chore: update project structure to 78c5496a
1 parent cacad03 commit 2b76d9d

36 files changed

+1924
-609
lines changed

.coveragerc

-20
This file was deleted.

.cruft.json

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"template": "https://github.com/escaped/cookiecutter-pypackage.git",
3+
"commit": "78c5496a422a0047307d337f970c73f01dd9e392",
4+
"context": {
5+
"cookiecutter": {
6+
"author": "Alexander Frenzel",
7+
"author_email": "alex@relatedworks.com",
8+
"github_username": "escaped",
9+
"project_name": "django-inline-actions",
10+
"project_slug": "django_inline_actions",
11+
"short_description": "django-inline-actions adds actions to each row of the ModelAdmin or InlineModelAdmin.",
12+
"version": "2.3.0",
13+
"line_length": "88",
14+
"uses_django": "n",
15+
"_template": "https://github.com/escaped/cookiecutter-pypackage.git"
16+
}
17+
},
18+
"directory": null
19+
}

.github/FUNDING.yml

-2
This file was deleted.

.github/PULL_REQUEST_TEMPLATE.md

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
## Description
2+
3+
Please include a summary of the proposed changes.
4+
5+
Fixes #(issue)
6+
7+
## Checklist
8+
9+
- [ ] Tests covering the new functionality have been added
10+
- [ ] Code builds clean without any errors or warnings
11+
- [ ] Documentation has been updated
12+
- [ ] Changes have been added to the `CHANGELOG.md`
13+
- [ ] You added yourself to the `CONTRIBUTORS.md`

.github/workflows/release.yml

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
jobs:
9+
release:
10+
name: Create release
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v2
15+
- name: Get version from tag
16+
id: tag_name
17+
run: |
18+
echo ::set-output name=current_version::${GITHUB_REF#refs/tags/}
19+
shell: bash
20+
- name: Get Changelog Entry
21+
id: changelog_reader
22+
uses: mindsers/changelog-reader-action@v2
23+
with:
24+
version: ${{ steps.tag_name.outputs.current_version }}
25+
path: ./CHANGELOG.md
26+
- name: Create Release
27+
id: create_release
28+
uses: actions/create-release@v1
29+
env:
30+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31+
with:
32+
tag_name: ${{ steps.changelog_reader.outputs.version }}
33+
release_name: Release ${{ steps.changelog_reader.outputs.version }}
34+
body: ${{ steps.changelog_reader.outputs.changes }}
35+
prerelease: ${{ steps.changelog_reader.outputs.status == 'prereleased' }}
36+
draft: ${{ steps.changelog_reader.outputs.status == 'unreleased' }}
37+
38+
publish:
39+
needs: [release]
40+
name: Build and publish Python distributions to PyPI
41+
runs-on: ubuntu-latest
42+
steps:
43+
- uses: actions/checkout@master
44+
- name: Set up Python 3.7
45+
uses: actions/setup-python@v1
46+
with:
47+
python-version: 3.7
48+
- name: Install pep517
49+
run: |
50+
python -m pip install pep517
51+
- name: Build a binary wheel and a source tarball
52+
run: |
53+
python -m pep517.build . --source --binary --out-dir dist/
54+
- name: Publish distribution to PyPI
55+
uses: pypa/gh-action-pypi-publish@master
56+
with:
57+
password: ${{ secrets.pypi_token }}
58+

.github/workflows/test.yml

+83
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
name: Test & Lint
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- master
8+
- main
9+
10+
jobs:
11+
lint_cruft:
12+
name: Check if automatic project update was successful
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v2
17+
with:
18+
ref: ${{ github.event.pull_request.head.sha }}
19+
- name: Fail if .rej files exist as structure update was not successful
20+
run: test -z "$(find . -iname '*.rej')"
21+
22+
lint:
23+
name: Lint
24+
needs: [lint_cruft]
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: Checkout code
28+
uses: actions/checkout@v2
29+
with:
30+
ref: ${{ github.event.pull_request.head.sha }}
31+
- name: Set up Python
32+
uses: actions/setup-python@v2
33+
with:
34+
python-version: 3.8.5
35+
- name: Install dependencies
36+
run: |
37+
python -m pip install --upgrade pip
38+
pip install poetry
39+
poetry install
40+
- name: Lint
41+
run: poetry run pre-commit run -a
42+
43+
test:
44+
name: Test
45+
needs: [lint_cruft]
46+
runs-on: ${{ matrix.platform }}
47+
strategy:
48+
max-parallel: 4
49+
matrix:
50+
platform: [ubuntu-latest]
51+
python-version: [3.6, 3.7, 3.8, 3.9]
52+
steps:
53+
- uses: actions/checkout@v2
54+
with:
55+
ref: ${{ github.event.pull_request.head.sha }}
56+
- name: Set up Python ${{ matrix.python-version }}
57+
uses: actions/setup-python@v2
58+
with:
59+
python-version: ${{ matrix.python-version }}
60+
- name: Install dependencies
61+
run: |
62+
python -m pip install --upgrade pip
63+
pip install tox tox-gh-actions coveralls
64+
- name: Test with tox
65+
run: tox
66+
env:
67+
PLATFORM: ${{ matrix.platform }}
68+
- name: Coveralls
69+
uses: AndreMiras/coveralls-python-action@develop
70+
with:
71+
github-token: ${{ secrets.GITHUB_TOKEN }}
72+
parallel: true
73+
74+
coveralls_finish:
75+
needs: [test]
76+
runs-on: ubuntu-latest
77+
steps:
78+
- name: Coveralls Finished
79+
uses: AndreMiras/coveralls-python-action@develop
80+
with:
81+
github-token: ${{ secrets.GITHUB_TOKEN }}
82+
parallel-finished: true
83+

.github/workflows/update.yml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Update project structure
2+
on:
3+
schedule:
4+
- cron: "0 0 * * *" # at the end of every day
5+
6+
jobs:
7+
autoUpdateProject:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v2
11+
- name: Set up Python
12+
uses: actions/setup-python@v2
13+
with:
14+
python-version: 3.8.5
15+
16+
- name: Install dependencies
17+
run: pip install cruft poetry jello
18+
19+
- name: Update project structure
20+
run: |
21+
cruft update -y
22+
poetry lock --no-update # add new dependencies
23+
poetry install
24+
poetry run pre-commit run -a || true # we have to fix other issue manually
25+
26+
- name: Get new template version
27+
# extract new cooiecutter template version
28+
run: |
29+
echo "TEMPLATE_COMMIT=$(cat .cruft.json | jello -r "_['commit'][:8]")" >> $GITHUB_ENV
30+
31+
# behaviour if PR already exists: https://github.com/marketplace/actions/create-pull-request#action-behaviour
32+
- name: Create Pull Request
33+
uses: peter-evans/create-pull-request@v3
34+
with:
35+
token: ${{ secrets.AUTO_UPDATE_GITHUB_TOKEN }}
36+
commit-message: >-
37+
chore: update project structure to ${{ env.TEMPLATE_COMMIT }}
38+
title: "[Actions] Auto-Sync cookiecutter template"
39+
body: ""
40+
branch: chore/cookiecutter-pypackage
41+
delete-branch: true
42+

0 commit comments

Comments
 (0)