Skip to content
This repository was archived by the owner on Jan 21, 2021. It is now read-only.

Commit 91cfcc7

Browse files
author
staticdev
committed
Update template
1 parent fc61369 commit 91cfcc7

File tree

14 files changed

+156
-156
lines changed

14 files changed

+156
-156
lines changed

.cookiecutter.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"_template": "cookiecutter-hypermodern-python/",
3-
"author": "Claudio Jolowicz",
3+
"author": "Thiago Carvalho D'\u00c1vila",
44
"email": "thiagocavila@gmail.com",
55
"friendly_name": "Pdf Split Tool",
66
"github_user": "staticdev",
77
"package_name": "pdf_split_tool",
88
"project_name": "pdf-split-tool",
9-
"version": "0.1.0"
9+
"version": "0.0.0"
1010
}

.github/workflows/constraints.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
pip==20.1
1+
pip==20.1.1
22
nox==2019.11.9
33
poetry==1.0.5
4+
virtualenv==20.0.21

.github/workflows/coverage.yml

Lines changed: 0 additions & 16 deletions
This file was deleted.

.github/workflows/docs.yml

Lines changed: 0 additions & 18 deletions
This file was deleted.

.github/workflows/release-drafter.yml

Lines changed: 0 additions & 12 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 57 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,72 @@
11
name: Release
2+
23
on:
3-
release:
4-
types: [published]
4+
push:
5+
branches:
6+
- master
7+
58
jobs:
69
release:
10+
name: Release
711
runs-on: ubuntu-latest
812
steps:
9-
- uses: actions/checkout@v2.1.0
10-
- uses: actions/setup-python@v2
13+
- name: Check out the repository
14+
uses: actions/checkout@v2.1.1
15+
with:
16+
fetch-depth: 2
17+
18+
- name: Set up Python
19+
uses: actions/setup-python@v2
1120
with:
1221
python-version: "3.8"
13-
- run: |
14-
pip install --constraint=.github/workflows/constraints.txt pip
15-
pip install --constraint=.github/workflows/constraints.txt nox poetry
16-
- name: Compute cache key prefix
17-
if: matrix.os != 'windows-latest'
18-
id: cache_key_prefix
19-
shell: python
22+
23+
- name: Upgrade pip
2024
run: |
21-
import hashlib
22-
import sys
25+
pip install --constraint=.github/workflows/constraints.txt pip
26+
pip --version
2327
24-
python = "py{}.{}".format(*sys.version_info[:2])
25-
payload = sys.version.encode() + sys.executable.encode()
26-
digest = hashlib.sha256(payload).hexdigest()
27-
result = "${{ runner.os }}-{}-{}-pre-commit".format(python, digest[:8])
28+
- name: Install Poetry
29+
run: |
30+
pip install --constraint=.github/workflows/constraints.txt poetry
31+
poetry --version
2832
29-
print("::set-output name=result::{}".format(result))
30-
- uses: actions/cache@v1.2.0
31-
if: matrix.os != 'windows-latest'
33+
- name: Detect and tag new version
34+
id: check-version
35+
uses: salsify/action-detect-and-tag-new-version@v1.0.3
3236
with:
33-
path: ~/.cache/pre-commit
34-
key: ${{ steps.cache_key_prefix.outputs.result }}-${{ hashFiles('.pre-commit-config.yaml') }}
35-
restore-keys: |
36-
${{ steps.cache_key_prefix.outputs.result }}-
37-
- run: nox --force-color
38-
- run: poetry build --ansi
39-
- uses: pypa/gh-action-pypi-publish@v1.1.0
37+
version-command: |
38+
poetry version | awk '{ print $2 }'
39+
40+
- name: Bump version for developmental release
41+
if: "! steps.check-version.outputs.tag"
42+
run: |
43+
poetry version patch &&
44+
version=$(poetry version | awk '{ print $2 }') &&
45+
poetry version $version.dev.$(date +%s)
46+
47+
- name: Build package
48+
run: |
49+
poetry build --ansi
50+
51+
- name: Publish package on PyPI
52+
if: steps.check-version.outputs.tag
53+
uses: pypa/gh-action-pypi-publish@v1.1.0
4054
with:
4155
user: __token__
4256
password: ${{ secrets.PYPI_TOKEN }}
57+
58+
- name: Publish package on TestPyPI
59+
if: "! steps.check-version.outputs.tag"
60+
uses: pypa/gh-action-pypi-publish@v1.1.0
61+
with:
62+
user: __token__
63+
password: ${{ secrets.TEST_PYPI_TOKEN }}
64+
repository_url: https://test.pypi.org/legacy/
65+
66+
- name: Publish the release notes
67+
uses: release-drafter/release-drafter@v5.8.0
68+
with:
69+
publish: ${{ steps.check-version.outputs.tag != '' }}
70+
tag: ${{ steps.check-version.outputs.tag }}
71+
env:
72+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/test-pypi.yml

Lines changed: 0 additions & 26 deletions
This file was deleted.

.github/workflows/tests.yml

Lines changed: 72 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,59 @@
11
name: Tests
2-
on: [push, pull_request]
2+
3+
on:
4+
- push
5+
- pull_request
6+
37
jobs:
48
tests:
9+
name: ${{ matrix.session }} ${{ matrix.python-version }} / ${{ matrix.os }}
10+
runs-on: ${{ matrix.os }}
511
strategy:
612
fail-fast: false
713
matrix:
814
include:
9-
- { python-version: 3.8, os: ubuntu-latest }
10-
- { python-version: 3.8, os: windows-latest }
11-
- { python-version: 3.8, os: macos-latest }
12-
- { python-version: 3.7, os: ubuntu-latest }
13-
- { python-version: 3.6, os: ubuntu-latest }
14-
runs-on: ${{ matrix.os }}
15-
name: Python ${{ matrix.python-version }} (${{ matrix.os }})
15+
- { python-version: 3.8, os: ubuntu-latest, session: "pre-commit" }
16+
- { python-version: 3.8, os: ubuntu-latest, session: "safety" }
17+
- { python-version: 3.8, os: ubuntu-latest, session: "mypy-3.8" }
18+
- { python-version: 3.7, os: ubuntu-latest, session: "mypy-3.7" }
19+
- { python-version: 3.6, os: ubuntu-latest, session: "mypy-3.6" }
20+
- { python-version: 3.8, os: ubuntu-latest, session: "tests-3.8" }
21+
- { python-version: 3.7, os: ubuntu-latest, session: "tests-3.7" }
22+
- { python-version: 3.6, os: ubuntu-latest, session: "tests-3.6" }
23+
- { python-version: 3.8, os: windows-latest, session: "tests-3.8" }
24+
- { python-version: 3.8, os: macos-latest, session: "tests-3.8" }
25+
- { python-version: 3.8, os: ubuntu-latest, session: "docs" }
26+
27+
env:
28+
NOXSESSION: ${{ matrix.session }}
29+
1630
steps:
17-
- uses: actions/checkout@v2.1.0
18-
- uses: actions/setup-python@v2
31+
- name: Check out the repository
32+
uses: actions/checkout@v2.1.1
33+
34+
- name: Set up Python ${{ matrix.python-version }}
35+
uses: actions/setup-python@v2
1936
with:
2037
python-version: ${{ matrix.python-version }}
21-
- name: Compute cache key prefix
22-
if: matrix.os != 'windows-latest'
23-
id: cache_key_prefix
38+
39+
- name: Upgrade pip
40+
run: |
41+
pip install --constraint=.github/workflows/constraints.txt pip
42+
pip --version
43+
44+
- name: Install Poetry
45+
run: |
46+
pip install --constraint=.github/workflows/constraints.txt poetry
47+
poetry --version
48+
49+
- name: Install Nox
50+
run: |
51+
pip install --constraint=.github/workflows/constraints.txt nox
52+
nox --version
53+
54+
- name: Compute pre-commit cache key
55+
if: matrix.session == 'pre-commit'
56+
id: pre-commit-cache
2457
shell: python
2558
run: |
2659
import hashlib
@@ -32,14 +65,32 @@ jobs:
3265
result = "${{ runner.os }}-{}-{}-pre-commit".format(python, digest[:8])
3366
3467
print("::set-output name=result::{}".format(result))
35-
- uses: actions/cache@v1.2.0
36-
if: matrix.os != 'windows-latest'
68+
69+
- name: Restore pre-commit cache
70+
uses: actions/cache@v1.2.0
71+
if: matrix.session == 'pre-commit'
3772
with:
3873
path: ~/.cache/pre-commit
39-
key: ${{ steps.cache_key_prefix.outputs.result }}-${{ hashFiles('.pre-commit-config.yaml') }}
74+
key: ${{ steps.pre-commit-cache.outputs.result }}-${{ hashFiles('.pre-commit-config.yaml') }}
4075
restore-keys: |
41-
${{ steps.cache_key_prefix.outputs.result }}-
42-
- run: |
43-
pip install --constraint=.github/workflows/constraints.txt pip
44-
pip install --constraint=.github/workflows/constraints.txt nox poetry
45-
- run: nox --force-color
76+
${{ steps.pre-commit-cache.outputs.result }}-
77+
78+
- name: Run Nox
79+
run: |
80+
nox --force-color
81+
82+
- name: Upload documentation
83+
if: matrix.session == 'docs'
84+
uses: actions/upload-artifact@v2
85+
with:
86+
name: docs
87+
path: docs/_build
88+
89+
- name: Create coverage report
90+
if: always() && matrix.session == 'tests'
91+
run: |
92+
nox --force-color --session=coverage -- xml
93+
94+
- name: Upload coverage report
95+
if: always() && matrix.session == 'tests'
96+
uses: codecov/codecov-action@v1.0.7

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v3.0.0
3+
rev: v3.0.1
44
hooks:
55
- id: check-toml
66
- id: check-yaml

LICENSE.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
MIT License
22
===========
33

4-
Copyright © 2020 Claudio Jolowicz
4+
Copyright © 2020 Thiago Carvalho D'Ávila
55

66
Permission is hereby granted, free of charge, to any person obtaining a copy
77
of this software and associated documentation files (the "Software"), to deal

0 commit comments

Comments
 (0)