Skip to content

Commit 71c942b

Browse files
seanctechJonZeolla
andauthored
feat: move to taskfiles (#79)
Co-authored-by: Jon Zeolla <Jon.Zeolla@SeisoLLC.com>
1 parent a4fcda9 commit 71c942b

27 files changed

Lines changed: 466 additions & 659 deletions

.github/workflows/ci.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,15 @@ jobs:
3737
if: github.event_name != 'push_request'
3838
with:
3939
fetch-depth: 0
40+
submodules: 'true'
4041
- name: Checkout the repository
4142
uses: actions/checkout@v3
4243
# Necessary for hooks to succeed during tests for PRs
4344
if: github.event_name == 'pull_request'
4445
with:
4546
ref: ${{ github.event.pull_request.head.ref }}
4647
fetch-depth: 0
48+
submodules: 'true'
4749
- name: Setup python
4850
uses: actions/setup-python@v4
4951
with:
@@ -56,8 +58,10 @@ jobs:
5658
${{ runner.os }}-python-${{ env.python_version }}-pipenv-
5759
${{ runner.os }}-python-
5860
- name: Install the dependencies
59-
run: |
60-
python -m pip install --upgrade pipenv
61-
pipenv install --deploy --ignore-pipfile --dev
61+
run: python -m pip install --upgrade pipenv
62+
- name: Install Task
63+
uses: arduino/setup-task@v1
64+
- name: Initialize the repo
65+
run: task init
6266
- name: Run the tests
63-
run: pipenv run invoke test
67+
run: task test

.github/workflows/update.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,10 @@ jobs:
3333
run: |
3434
python -m pip install --upgrade pipenv
3535
pipenv install --deploy --ignore-pipfile --dev
36+
- name: Install Task
37+
uses: arduino/setup-task@v1
3638
- name: Update the repository
37-
run: pipenv run invoke update
39+
run: task update
3840
- name: Create or update a pull request
3941
uses: peter-evans/create-pull-request@v4
4042
with:

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
super-linter.log
1+
.task/*
22

33
# Created by https://www.toptal.com/developers/gitignore/api/vim,emacs,visualstudiocode,python,macos,windows
44
# Edit at https://www.toptal.com/developers/gitignore?templates=vim,emacs,visualstudiocode,python,macos,windows

.gitmodules

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[submodule "goat"]
2+
path = goat
3+
url = https://github.com/SeisoLLC/goat
4+
branch = main

.pre-commit-config.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
repos:
3+
- repo: https://github.com/seisollc/goat
4+
rev: 1182cb0e3c396e21a4fe887191295a11e129724e # frozen: latest
5+
hooks:
6+
- id: seiso-lint

Pipfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,18 @@ name = "pypi"
66
[packages]
77

88
[dev-packages]
9-
bumpversion = "*"
109
black = "*"
10+
bumpversion = "*"
1111
coverage = "*"
1212
docker = "*"
1313
flake8 = "*"
1414
gitpython = "*"
15-
invoke = "*"
1615
mypy = "*"
16+
pre-commit = "*"
1717
pylint = "*"
1818
pytest = "*"
1919
pytest-cookies = "*"
20+
pytest-cov = "*"
2021
pyyaml = "*"
2122
refurb = "*"
2223

Pipfile.lock

Lines changed: 227 additions & 174 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,22 +39,22 @@ pipenv install --deploy --ignore-pipfile --dev
3939
# Commit and test your work
4040
git add -A
4141
git commit -m "Initial content"
42-
pipenv run invoke build test
42+
task test
4343

4444
# Push your branch and open a PR
4545
git push origin $(git branch --show-current)
4646
# Open a PR, setup a Wrike approval, follow the Seiso Software Development guidelines
4747

4848
# If you chose SemVer-ish, after the PR is merged, run a release
49-
if grep -q SemVer setup.cfg; then pipenv run invoke release minor; git push --atomic origin $(git branch --show-current) $(git describe --tags); fi
49+
if grep -q SemVer setup.cfg; then task release -- minor; git push --atomic origin $(git branch --show-current) $(git describe --tags); fi
5050
```
5151

5252
## Troubleshooting
5353

54-
If you're troubleshooting the results of any of the invoke tasks, you can add `--debug` to enable debug logging, for instance:
54+
If you're troubleshooting the results of any of the tasks, you can add `-v` to enable debug logging, for instance:
5555

5656
```bash
57-
pipenv run invoke build --debug
57+
task -v build
5858
```
5959

6060
### Using pyenv
@@ -72,7 +72,7 @@ You may also want to consider storing this in your .zshrc or similar if it fixes
7272
## Updating the dependencies
7373

7474
```bash
75-
pipenv run invoke update
75+
task update
7676
```
7777

7878
## FAQs

Taskfile.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
---
2+
# https://taskfile.dev
3+
4+
version: '3'
5+
6+
includes:
7+
py:
8+
taskfile: ./goat/Task/python/Taskfile.yml
9+
internal: true
10+
vars:
11+
INPUT_DISABLE_MYPY: "true"
12+
INPUT_EXCLUDE: .*\{\{.*\}\}.*
13+
PROJECT_SLUG: cookiecutter-python
14+
PYTHON_VERSION: 3.11
15+
16+
silent: true
17+
18+
tasks:
19+
lock:
20+
internal: true
21+
sources:
22+
- Pipfile
23+
generates:
24+
- Pipfile.lock
25+
cmds:
26+
- pipenv lock
27+
28+
init:
29+
deps: [lock]
30+
sources:
31+
- Pipfile.lock
32+
cmds:
33+
- git submodule init
34+
- pipenv install --deploy --ignore-pipfile --dev
35+
- pipenv run pre-commit install
36+
37+
lint:
38+
cmds:
39+
- task: py:lint
40+
41+
test:
42+
cmds:
43+
- pipenv run pytest --keep-baked-projects tests
44+
45+
update:
46+
cmds:
47+
- task: py:update
48+
49+
clean:
50+
cmds:
51+
- task: py:clean
52+
53+
release:
54+
deps: [test]
55+
cmds:
56+
- task: py:release

cookiecutter.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
"project_short_description": "TODO",
55
"project_owner_github_username": "jonzeolla",
66
"python_version": ["3.11", "3.10", "3.9"],
7-
"docker_base": ["ubuntu:20.04", "ubuntu:20.10", "ubuntu:21.04"],
8-
"dockerhub": ["yes", "no"],
7+
"docker_base": ["ubuntu:20.04", "ubuntu:22.04", "ubuntu:23.04"],
8+
"dockerhub": ["no", "yes"],
99
"versioning": ["CalVer", "SemVer-ish"],
1010
"public": ["no", "yes"],
1111
"license": ["NONE", "MIT", "BSD-3-Clause"]

0 commit comments

Comments
 (0)