diff --git a/.github/ISSUE_TEMPLATE/bug-report.md b/.github/ISSUE_TEMPLATE/bug-report.md new file mode 100644 index 0000000..9786b8d --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug-report.md @@ -0,0 +1,25 @@ +--- +name: Bug report +about: Create a report to help us improve +title: "[BUG]" +labels: '' +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: + +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..618ceda --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,27 @@ +## Proposed changes + +Describe the big picture of your changes here to communicate to the maintainers why we should accept this pull request. If it fixes a bug or resolves a feature request, be sure to link to that issue. + +## Types of changes + +What types of changes does your code introduce to vtk2dolfinx? + + +- [ ] Bugfix (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) +- [ ] Code refactoring +- [ ] Documentation Update (if none of the other choices apply) +- [ ] New tests + +## Checklist + + + +- [ ] Unit tests pass locally with my changes +- [ ] I have added tests that prove my fix is effective or that my feature works +- [ ] I have added necessary documentation (if appropriate) + +## Further comments + +If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc... diff --git a/.github/workflows/ci_conda.yml b/.github/workflows/ci_conda.yml new file mode 100644 index 0000000..96354ef --- /dev/null +++ b/.github/workflows/ci_conda.yml @@ -0,0 +1,39 @@ +name: Conda CI +on: [pull_request, push] + +jobs: + run-tests: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up Conda + uses: conda-incubator/setup-miniconda@v3 + with: + activate-environment: myenv + miniforge-version: latest + # use-mamba: true + channels: conda-forge + + - name: Create Conda environment + shell: bash -l {0} + run: | + conda install -c conda-forge fenics-dolfinx=0.9.0 pyvista + + - name: Install local package and dependencies + shell: bash -l {0} + run: | + pip install .[test] + + - name: Run tests + shell: bash -l {0} + run: | + pytest test/ --cov vtk2dolfinx --cov-report xml --cov-report term + + - name: Upload to codecov + uses: codecov/codecov-action@v5 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: ./coverage.xml diff --git a/.github/workflows/ci_docker.yml b/.github/workflows/ci_docker.yml new file mode 100644 index 0000000..cea607c --- /dev/null +++ b/.github/workflows/ci_docker.yml @@ -0,0 +1,28 @@ +name: Docker CI +on: [pull_request, push] + +jobs: + run-tests: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + container_version: [v0.9.0, nightly] + container: dolfinx/dolfinx:${{ matrix.container_version }} + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Install local package and dependencies + run: | + pip install .[test] + + - name: Run tests + run: | + python3 -m pytest test/ --cov vtk2dolfinx --cov-report xml --cov-report term + + - name: Upload to codecov + uses: codecov/codecov-action@v5 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: ./coverage.xml \ No newline at end of file diff --git a/.github/workflows/code_formatting.yml b/.github/workflows/code_formatting.yml new file mode 100644 index 0000000..f203c66 --- /dev/null +++ b/.github/workflows/code_formatting.yml @@ -0,0 +1,30 @@ +name: Lint + +on: [pull_request] + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.12" + - name: Install linting tools + run: pip install mypy ruff + + - name: ruff format + run: | + ruff format --check . + + - name: ruff check + continue-on-error: true + run: | + ruff check . + + - name: mypy + continue-on-error: true + run: | + python -m mypy . diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 0000000..6d24294 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,2 @@ +ignore: + - "vtk2dolfinx/_version.py" # ignore version file \ No newline at end of file diff --git a/src/vtk2dolfinx/vtk_reader.py b/src/vtk2dolfinx/vtk_reader.py index be78168..d0285e6 100644 --- a/src/vtk2dolfinx/vtk_reader.py +++ b/src/vtk2dolfinx/vtk_reader.py @@ -1,6 +1,7 @@ import dolfinx import pyvista + class VTKReader: """""" @@ -15,9 +16,8 @@ def __init__(self): pass - class UnstructuredMeshReader(VTKReader): """""" def __init__(self): - pass \ No newline at end of file + pass diff --git a/test/test_example.py b/test/test_example.py new file mode 100644 index 0000000..592585e --- /dev/null +++ b/test/test_example.py @@ -0,0 +1,5 @@ +import pytest + + +def test_example(): + pass