Skip to content

Commit

Permalink
setup poetry and move to github actions (#16)
Browse files Browse the repository at this point in the history
Update with files from the  sceptre-resolver-template[1]
repo to update this project to use poetry and github actions CI

[1] https://github.com/Sceptre/sceptre-resolver-template
  • Loading branch information
zaro0508 authored Feb 16, 2024
1 parent 7d226d6 commit d301da5
Show file tree
Hide file tree
Showing 18 changed files with 1,366 additions and 445 deletions.
160 changes: 0 additions & 160 deletions .circleci/config.yml

This file was deleted.

9 changes: 8 additions & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,12 @@ exclude =
build,
dist,
.tox,
venv
venv,
.venv,
.pytest_cache
max-complexity = 12
per-file-ignores =
docs/_api/conf.py: E265
integration-tests/steps/*: E501,F811,F403,F405
extend-ignore = E203
max-line-length = 120
17 changes: 17 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
### Subject of the issue
Describe your issue here.

### Your environment
* version of sceptre (sceptre --version)
* version of python (python --version)
* which OS/distro

### Steps to reproduce
Tell us how to reproduce this issue. Please provide sceptre projct files if possible,
you can use https://plnkr.co/edit/ANFHm61Ilt4mQVgF as a base.

### Expected behaviour
Tell us what should happen

### Actual behaviour
Tell us what happens instead
21 changes: 21 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[Your PR description here]

## PR Checklist

- [ ] Wrote a good commit message & description [see guide below].
- [ ] Commit message starts with `[Resolve #issue-number]`.
- [ ] Added/Updated unit tests.
- [ ] Added/Updated integration tests (if applicable).
- [ ] All unit tests (`poetry run tox`) are passing.
- [ ] Used the same coding conventions as the rest of the project.
- [ ] The new code passes pre-commit validations (`poetry run pre-commit run --all-files`).
- [ ] The PR relates to _only_ one subject with a clear title.
and description in grammatically correct, complete sentences.

## Approver/Reviewer Checklist

- [ ] Before merge squash related commits.

## Other Information

[Guide to writing a good commit](http://chris.beams.io/posts/git-commit/)
16 changes: 16 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: release

on:
push:
tags:
- 'v*.*.*'

jobs:
pypi-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Poetry
uses: snok/install-poetry@v1
- name: Publish to pypi
run: poetry publish --build -u __token__ -p ${{ secrets.PYPI_API_TOKEN }}
56 changes: 56 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: tests

on:
push:
branches:
- '*'
pull_request:
branches:
- '*'

jobs:
packaging:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Poetry
uses: snok/install-poetry@v1
- name: build package
run: poetry build
# use https://github.com/medmunds/tox-gh-matrix to export tox envlist to GH actions
get-tox-envlist:
runs-on: ubuntu-latest
outputs:
envlist: ${{ steps.generate-envlist.outputs.envlist }}
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Install Poetry
uses: snok/install-poetry@v1
- name: Install dependencies
run: poetry install --no-interaction --all-extras
- id: generate-envlist
run: poetry run tox --gh-matrix
unit-tests:
needs: get-tox-envlist
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
tox: ${{ fromJSON(needs.get-tox-envlist.outputs.envlist) }}
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Setup Python
id: setup-python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.tox.python.spec }}
- name: Install Poetry
uses: snok/install-poetry@v1
- name: Install dependencies
run: poetry install --no-interaction --all-extras
- name: run python tests
run: poetry run tox -e ${{ matrix.tox.name }}
- name: run python test report
run: poetry run tox -e report
46 changes: 42 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,51 @@ default_language_version:

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.4.0
rev: v4.5.0
hooks:
- id: end-of-file-fixer
- id: mixed-line-ending
- id: trailing-whitespace

- repo: https://gitlab.com/pycqa/flake8
rev: 3.9.0
- repo: https://github.com/PyCQA/flake8
rev: 7.0.0
hooks:
- id: flake8
- repo: https://github.com/adrienverge/yamllint
rev: v1.33.0
hooks:
- id: yamllint
- repo: https://github.com/awslabs/cfn-python-lint
rev: v0.84.0
hooks:
- id: cfn-python-lint
args:
- "-i=E0000"
- "-i=E1001"
- "-i=E3012"
- "-i=W6001"
exclude: |
(?x)(
^integration-tests/sceptre-project/config/|
^integration-tests/sceptre-project/templates/jinja/|
^tests/fixtures-vpc/config/|
^tests/fixtures/config/|
^temp/|
^.github/|
^.pre-commit-config.yaml
)
- repo: https://github.com/psf/black
rev: 23.12.1
hooks:
- id: black
- repo: https://github.com/python-poetry/poetry
rev: '1.7.0'
hooks:
- id: poetry-check
- id: poetry-lock
language_version: python3.10
args: ['--check']
- repo: https://github.com/sirosen/check-jsonschema
rev: 0.27.3
hooks:
- id: check-github-workflows
- id: check-github-actions
27 changes: 27 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---

extends: default

rules:
braces:
level: warning
max-spaces-inside: 1
brackets:
level: warning
max-spaces-inside: 1
commas:
level: warning
comments: disable
comments-indentation: disable
document-start: disable
empty-lines:
level: warning
hyphens:
level: warning
indentation:
level: warning
indent-sequences: consistent
line-length: disable
truthy: disable
new-line-at-end-of-file:
level: warning
Loading

0 comments on commit d301da5

Please sign in to comment.