Skip to content

Commit 258525c

Browse files
mikeprosserniMike Prosser
andauthored
Implement Task AB#3090157 - Create poetry project and generate gRPC stubs (#1)
* poetry project and generated gRPC stubs * add files from github-repo-template * fill out workflows, issue template, folder structure, etc * exclude generated stubs from ni-python-styleguide and fix black issues * add settings for mypy (excluding generated stub files) * add tool.poetry.group.test.dependencies * poetry lock * clean up yml and toml files --------- Co-authored-by: Mike Prosser <Mike.Prosser@emerson.com>
1 parent 66f676a commit 258525c

30 files changed

+1943
-0
lines changed

.github/CODEOWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Default code owner for nipanel-python
2+
mikeprosserni
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: 'bug,triage'
6+
---
7+
8+
<!---
9+
Thanks for filing an issue! Before you submit, please read the following:
10+
11+
Search open/closed issues before submitting. Someone may have reported the same issue before.
12+
-->
13+
14+
# Bug Report
15+
16+
<!--- Provide a general summary of the issue here -->
17+
18+
## Repro or Code Sample
19+
20+
<!-- Please provide steps to reproduce the issue and/or a code repository, gist, code snippet or sample files -->
21+
22+
## Expected Behavior
23+
24+
<!--- Tell us what should happen -->
25+
26+
## Current Behavior
27+
28+
<!--- Tell us what happens instead of the expected behavior -->
29+
<!--- If you are seeing an error, please include the full error message and stack trace -->
30+
<!--- If applicable, provide screenshots -->
31+
32+
## Possible Solution
33+
34+
<!--- Not obligatory, but suggest a fix/reason for the bug -->
35+
<!--- Please let us know if you'd be willing to contribute the fix; we'd be happy to work with you -->
36+
37+
## Context
38+
39+
<!--- How has this issue affected you? What are you trying to accomplish? -->
40+
<!--- Providing context helps us come up with a solution that is most useful in the real world -->
41+
42+
## Your Environment
43+
44+
<!--- Include as many relevant details as possible about the environment you experienced the bug in -->
45+
46+
* `nipanel` version
47+
* Python version
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: 'enhancement,triage'
6+
---
7+
8+
<!---
9+
Thanks for filing an issue! Before you submit, please read the following:
10+
11+
Search open/closed issues before submitting. Someone may have requested the same feature before.
12+
-->
13+
14+
## Problem to Solve
15+
16+
<!--- Provide a clear and concise description of why this feature is wanted or what problem it solves. -->
17+
18+
## Proposed Solution
19+
20+
<!--- Provide a clear and concise description of the feature you're proposing. -->
21+
22+
<!--- The implementing team may build a list of tasks/sub-issues here:
23+
## Tasks
24+
- [ ] This is a subtask of the feature. (It can be converted to an issue.)
25+
-->
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
name: Tech debt
3+
about: (DEV TEAM ONLY) Non-user-visible improvement to code or development process
4+
title: ''
5+
labels: 'tech debt,triage'
6+
---
7+
## Tech Debt
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
name: User story
3+
about: (DEV TEAM ONLY) A small chunk of work to be done
4+
title: '(Fully descriptive title)'
5+
labels: 'user story,triage'
6+
---
7+
8+
<!-- Ensure the title can be understood without the parent item's context, e.g. "nimble-button Angular wrapper" rather than just "Angular wrapper" -->
9+
10+
## User Story

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
### What does this Pull Request accomplish?
2+
3+
TODO: Include high-level description of the changes in this pull request.
4+
5+
### Why should this Pull Request be merged?
6+
7+
TODO: Justify why this contribution should be part of the project.
8+
9+
### What testing has been done?
10+
11+
TODO: Detail what testing has been done to ensure this submission meets requirements.

.github/workflows/CI.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- 'releases/**'
8+
workflow_call:
9+
workflow_dispatch:
10+
11+
jobs:
12+
check_nipanel:
13+
name: Check
14+
uses: ./.github/workflows/check_nipanel.yml
15+
run_unit_tests:
16+
name: Run unit tests
17+
uses: ./.github/workflows/run_unit_tests.yml
18+
needs: [check_nipanel]
19+
report_test_results:
20+
name: Report test results
21+
uses: ./.github/workflows/report_test_results.yml
22+
needs: [run_unit_tests]
23+
if: always()

.github/workflows/PR.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: PR
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
- 'releases/**'
8+
workflow_call:
9+
workflow_dispatch:
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
run_ci:
17+
name: Run CI
18+
uses: ./.github/workflows/CI.yml
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Check nipanel
2+
3+
on:
4+
workflow_call:
5+
workflow_dispatch:
6+
7+
env:
8+
POETRY_VERSION: 1.8.2
9+
PYTHON_VERSION: 3.11.9
10+
11+
jobs:
12+
check_nipanel:
13+
name: Check nipanel
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Check out repo
17+
uses: actions/checkout@v4
18+
- name: Set up Python
19+
uses: actions/setup-python@v5
20+
id: setup-python
21+
with:
22+
python-version: ${{ env.PYTHON_VERSION }}
23+
- name: Set up Poetry
24+
uses: Gr1N/setup-poetry@v9
25+
with:
26+
poetry-version: ${{ env.POETRY_VERSION }}
27+
- name: Check for lock changes
28+
run: poetry check --lock
29+
- name: Cache virtualenv
30+
uses: actions/cache@v4
31+
with:
32+
path: .venv
33+
key: nipanel-${{ runner.os }}-py${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('poetry.lock') }}
34+
- name: Install nipanel
35+
run: poetry install -v
36+
- name: Lint
37+
run: poetry run ni-python-styleguide lint
38+
- name: Mypy static analysis (Linux)
39+
run: poetry run mypy
40+
- name: Mypy static analysis (Windows)
41+
run: poetry run mypy --platform win32
42+
- name: Bandit security checks
43+
run: poetry run bandit -c pyproject.toml -r src/nipanel
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Report test results
2+
3+
on:
4+
workflow_call:
5+
workflow_dispatch:
6+
7+
permissions:
8+
contents: read
9+
checks: write
10+
pull-requests: write
11+
12+
jobs:
13+
report_test_results:
14+
name: Report test results
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Check out repo
18+
uses: actions/checkout@v4
19+
- name: Download test results
20+
uses: actions/download-artifact@v4
21+
with:
22+
path: test_results
23+
pattern: test_results_*
24+
merge-multiple: true
25+
- name: List downloaded files
26+
run: ls -lR
27+
- name: Publish test results
28+
uses: EnricoMi/publish-unit-test-result-action@v2
29+
with:
30+
files: "test_results/**/*.xml"
31+
if: always()

0 commit comments

Comments
 (0)