Skip to content

Commit 860e1d8

Browse files
committed
More bootstrap (#1)
1 parent 2b1cbcf commit 860e1d8

18 files changed

Lines changed: 450 additions & 13 deletions

.flake8

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[flake8]
2+
extend-ignore =
3+
E203,
4+
E501,
5+
F401, # duplicate of pylint W0611 (unused-import)
6+
F821, # duplicate of pylint E0602 (undefined-variable)
7+
F841, # duplicate of pylint W0612 (unused-variable)
8+
DAR # we don't use darling

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @ssbarnea

.github/release-drafter.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
# see https://github.com/ansible/devtools
3+
_extends: ansible/devtools

.github/workflows/ack.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
# See https://github.com/ansible/devtools/blob/main/.github/workflows/ack.yml
3+
name: ack
4+
on:
5+
pull_request_target:
6+
types: [opened, labeled, unlabeled, synchronize]
7+
8+
jobs:
9+
ack:
10+
uses: ansible/devtools/.github/workflows/ack.yml@main

.github/workflows/push.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
# See https://github.com/ansible/devtools/blob/main/.github/workflows/push.yml
3+
name: push
4+
on:
5+
push:
6+
branches:
7+
- main
8+
- "releases/**"
9+
- "stable/**"
10+
11+
jobs:
12+
ack:
13+
uses: ansible/devtools/.github/workflows/push.yml@main

.github/workflows/release.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
name: release
3+
4+
on:
5+
release:
6+
types: [published]
7+
8+
jobs:
9+
pypi:
10+
name: Publish to PyPI registry
11+
environment: release
12+
runs-on: ubuntu-20.04
13+
14+
env:
15+
FORCE_COLOR: 1
16+
PY_COLORS: 1
17+
TOXENV: packaging
18+
TOX_PARALLEL_NO_SPINNER: 1
19+
20+
steps:
21+
- name: Switch to using Python 3.8 by default
22+
uses: actions/setup-python@v4
23+
with:
24+
python-version: 3.8
25+
- name: Install tox
26+
run: >-
27+
python3 -m
28+
pip install
29+
--user
30+
tox
31+
- name: Check out src from Git
32+
uses: actions/checkout@v3
33+
with:
34+
fetch-depth: 0 # needed by setuptools-scm
35+
- name: Build dists
36+
run: python -m tox
37+
- name: Publish to pypi.org
38+
if: >- # "create" workflows run separately from "push" & "pull_request"
39+
github.event_name == 'release'
40+
uses: pypa/gh-action-pypi-publish@master
41+
with:
42+
password: ${{ secrets.pypi_password }}

.github/workflows/tox.yml

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: tox
2+
3+
on:
4+
create: # is used for publishing to PyPI and TestPyPI
5+
tags: # any tag regardless of its name, no branches
6+
- "**"
7+
push: # only publishes pushes to the main branch to TestPyPI
8+
branches: # any integration branch but not tag
9+
- "main"
10+
pull_request:
11+
12+
jobs:
13+
tox:
14+
name: ${{ matrix.name }}
15+
runs-on: ${{ matrix.os || 'ubuntu-latest' }}
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
include:
20+
- name: lint
21+
python-version: "3.9"
22+
- name: packaging
23+
python-version: "3.9"
24+
- name: py37
25+
python-version: "3.7"
26+
- name: py38
27+
python-version: "3.8"
28+
- name: py39
29+
python-version: "3.9"
30+
- name: py310
31+
python-version: "3.10"
32+
- name: py311
33+
python-version: "~3.11.0-0"
34+
35+
env:
36+
FORCE_COLOR: 1
37+
38+
steps:
39+
- name: Check out src from Git
40+
uses: actions/checkout@v3
41+
with:
42+
fetch-depth: 0 # needed by setuptools-scm
43+
44+
- name: Set up Python ${{ matrix.python-version }}
45+
uses: actions/setup-python@v4
46+
with:
47+
python-version: ${{ matrix.python-version }}
48+
49+
- name: Pre-commit cache
50+
uses: actions/cache@v2
51+
with:
52+
path: ~/.cache/pre-commit
53+
key: ${{ matrix.name }}-pre-commit-${{ hashFiles('setup.cfg', 'tox.ini', 'pyproject.toml', '.pre-commit-config.yaml') }}
54+
55+
- name: Pip cache
56+
uses: actions/cache@v2
57+
with:
58+
path: ~/.cache/pip
59+
key: ${{ matrix.name }}-pip-${{ hashFiles('setup.cfg', 'tox.ini', 'pyproject.toml', '.pre-commit-config.yaml') }}
60+
61+
- name: Install tox
62+
run: python3 -m pip install --upgrade tox
63+
64+
- name: Log installed dists
65+
run: python -m pip freeze --all
66+
67+
- name: tox -e ${{ matrix.name }}
68+
run: python3 -m tox -e ${{ matrix.name }}
69+
70+
- name: Archive logs
71+
uses: actions/upload-artifact@v2
72+
with:
73+
name: logs.zip
74+
path: .tox/**/log/
75+
76+
check: # This job does nothing and is only used for the branch protection
77+
if: always()
78+
79+
needs:
80+
- tox
81+
82+
runs-on: ubuntu-latest
83+
84+
steps:
85+
- name: Decide whether the needed jobs succeeded or failed
86+
uses: re-actors/alls-green@release/v1
87+
with:
88+
jobs: ${{ toJSON(needs) }}

.pre-commit-config.yaml

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
---
2+
ci:
3+
# format compatible with commitlint
4+
autoupdate_commit_msg: "chore: pre-commit autoupdate"
5+
autoupdate_schedule: monthly
6+
autofix_commit_msg: |
7+
chore: auto fixes from pre-commit.com hooks
8+
9+
for more information, see https://pre-commit.ci
10+
skip:
11+
# https://github.com/pre-commit-ci/issues/issues/55
12+
- pip-compile
13+
default_language_version:
14+
# Needed in order to make pip-compile output predictable.
15+
python: python3.9
16+
repos:
17+
- repo: https://github.com/pre-commit/mirrors-prettier
18+
# keep it before yamllint
19+
rev: "v2.7.1"
20+
hooks:
21+
- id: prettier
22+
additional_dependencies:
23+
- prettier
24+
- prettier-plugin-toml
25+
- repo: https://github.com/pre-commit/pre-commit-hooks.git
26+
rev: v4.3.0
27+
hooks:
28+
- id: end-of-file-fixer
29+
- id: trailing-whitespace
30+
exclude: >
31+
(?x)^(
32+
examples/playbooks/(with-skip-tag-id|unicode).yml|
33+
examples/playbooks/example.yml
34+
)$
35+
- id: mixed-line-ending
36+
- id: check-byte-order-marker
37+
- id: check-executables-have-shebangs
38+
- id: check-merge-conflict
39+
- id: debug-statements
40+
language_version: python3
41+
- repo: https://github.com/codespell-project/codespell
42+
rev: v2.1.0
43+
hooks:
44+
- id: codespell
45+
- repo: https://github.com/adrienverge/yamllint.git
46+
rev: v1.27.1
47+
hooks:
48+
- id: yamllint
49+
files: \.(yaml|yml)$
50+
types: [file, yaml]
51+
entry: yamllint --strict
52+
- repo: https://github.com/PyCQA/isort
53+
rev: 5.10.1
54+
hooks:
55+
- id: isort
56+
args:
57+
# https://github.com/pre-commit/mirrors-isort/issues/9#issuecomment-624404082
58+
- --filter-files
59+
- repo: https://github.com/psf/black
60+
rev: 22.6.0
61+
hooks:
62+
- id: black
63+
language_version: python3
64+
- repo: https://github.com/pycqa/flake8.git
65+
rev: 5.0.2
66+
hooks:
67+
- id: flake8
68+
language_version: python3
69+
additional_dependencies:
70+
- flake8-2020>=1.6.0
71+
- flake8-docstrings>=1.5.0
72+
- flake8-pytest-style>=1.2.2
73+
- flake8-rst-docstrings>=0.2.3
74+
- flake8-rst>=0.8.0
75+
- repo: https://github.com/pre-commit/mirrors-mypy
76+
rev: v0.971
77+
hooks:
78+
- id: mypy
79+
# empty args needed in order to match mypy cli behavior
80+
args: ["--strict"]
81+
additional_dependencies:
82+
- pytest
83+
- repo: https://github.com/pycqa/pylint
84+
rev: v2.14.5
85+
hooks:
86+
- id: pylint
87+
additional_dependencies:
88+
- pytest
89+
# Keep last due to being considerably slower than the others:
90+
- repo: local
91+
hooks:
92+
- id: pip-compile-upgrade
93+
# To run it execute: `pre-commit run pip-compile-upgrade --hook-stage manual`
94+
name: Upgrade constraints files and requirements
95+
files: ^(setup\.py|setup\.cfg|requirements\.txt)$
96+
language: python
97+
entry: python -m piptools compile --upgrade -q --strip-extras --extra test --output-file=requirements.txt setup.cfg
98+
pass_filenames: false
99+
stages:
100+
- manual
101+
additional_dependencies:
102+
- pip-tools>=6.8.0
103+
- id: pip-compile
104+
name: Check constraints files and requirements
105+
files: ^(setup\.py|setup\.cfg|requirements\.txt)$
106+
language: python
107+
entry: python -m piptools compile -q --strip-extras --extra test --output-file=requirements.txt setup.cfg
108+
pass_filenames: false
109+
additional_dependencies:
110+
- pip-tools>=6.8.0

.yamllint

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
rules:
2+
document-start: disable
3+
indentation:
4+
level: error
5+
indent-sequences: consistent
6+
ignore: |
7+
.tox
8+
# ignore added because this file includes on-purpose errors

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
# pinfo
1+
# pinfo

0 commit comments

Comments
 (0)