forked from complytime/trestle-bot
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: initial python project structure
Signed-off-by: Jennifer Power <barnabei.jennifer@gmail.com>
- Loading branch information
Showing
12 changed files
with
655 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# [Pull request title here] | ||
|
||
## Description | ||
|
||
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. | ||
|
||
Fixes # (issue) | ||
|
||
## Type of change | ||
|
||
Please delete options that are not relevant. | ||
|
||
- [ ] Bug fix (non-breaking change which fixes an issue) | ||
- [ ] New feature (non-breaking change which adds functionality) | ||
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) | ||
- [ ] This change requires a documentation update | ||
|
||
## How has this been tested? | ||
|
||
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration | ||
|
||
- [ ] Test A | ||
- [ ] Test B | ||
|
||
**Test Configuration**: | ||
|
||
- Firmware version: | ||
- Hardware: | ||
- Toolchain: | ||
- SDK: | ||
|
||
## Checklist | ||
|
||
- [ ] My code follows the style guidelines of this project | ||
- [ ] I have performed a self-review of my own code | ||
- [ ] I have commented my code, particularly in hard-to-understand areas | ||
- [ ] I have made corresponding changes to the documentation | ||
- [ ] My changes generate no new warnings | ||
- [ ] I have added tests that prove my fix is effective or that my feature works | ||
- [ ] New and existing unit tests pass locally with my changes | ||
- [ ] Any dependent changes have been merged and published in downstream modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
--- | ||
name: CI | ||
|
||
on: | ||
push: | ||
pull_request: | ||
branches: main | ||
|
||
concurrency: | ||
group: ${{ github.ref }}-${{ github.workflow }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
megalinter: | ||
name: Run linters | ||
runs-on: ubuntu-latest | ||
permissions: | ||
issues: write | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v3 | ||
|
||
- name: MegaLinter | ||
id: ml | ||
uses: oxsecurity/megalinter@v7 | ||
env: | ||
VALIDATE_ALL_CODEBASE: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
project_checks: | ||
name: Run project checks | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up python | ||
uses: actions/setup-python@v4 | ||
|
||
- name: Install Poetry | ||
uses: snok/install-poetry@v1 | ||
|
||
- name: Install dependencies | ||
run: poetry install --no-interaction --no-root | ||
|
||
- name: Run checks | ||
run: make lint | ||
|
||
test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: ['3.8', '3.9', '3.10', '3.11'] | ||
fail-fast: false | ||
steps: | ||
- name: Check out | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install Poetry | ||
uses: snok/install-poetry@v1 | ||
|
||
- name: Install dependencies | ||
run: poetry install --no-interaction --no-root | ||
|
||
- name: Run tests | ||
run: make test |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
|
||
ENABLE_LINTERS: | ||
- REPOSITORY_GITLEAKS | ||
- REPOSITORY_KICS | ||
- BASH_SHELLCHECK | ||
- ACTION_ACTIONLINT | ||
- MARKDOWN_MARKDOWNLINT | ||
- MAKEFILE_CHECKMAKE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
PYMODULE := trestlebot | ||
TESTS := tests | ||
|
||
all: develop lint test | ||
.PHONY: all | ||
|
||
develop: | ||
@poetry install | ||
@poetry shell | ||
.PHONY: develop | ||
|
||
lint: | ||
@poetry lock --check | ||
@poetry run isort --profile=black --lines-after-imports=2 \ | ||
--check-only $(TESTS) $(PYMODULE) | ||
@poetry run black --check $(TESTS) $(PYMODULE) --diff | ||
@poetry run mypy $(PYMODULE) $(TESTS) | ||
@poetry run flake8 | ||
.PHONY: lint | ||
|
||
test: | ||
@poetry run pytest --cov --cov-config=pyproject.toml --cov-report=xml | ||
.PHONY: test | ||
|
||
build: clean-build | ||
@poetry build | ||
.PHONY: build | ||
|
||
clean-build: | ||
@rm -rf dist | ||
.PHONY: clean-build | ||
|
||
clean: | ||
@git clean -Xdf | ||
.PHONY: clean | ||
|
||
publish: | ||
@poetry config pypi-token.pypi $(PYPI_TOKEN) | ||
@poetry publish --dry-run | ||
@poetry publish | ||
.PHONY: publish | ||
|
||
build-and-publish: build publish | ||
.PHONY: build-and-publish |
Oops, something went wrong.