Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
name: Bug report
about: Create a report to help us improve
title: '[BUG] '
labels: bug
assignees: ''
---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Import module '...'
2. Call function '...' with parameters '...'
3. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Error output**
If applicable, paste the full error traceback:
```
Paste error here
```

**Environment:**
- OS: [e.g., Ubuntu 22.04, macOS 13.0]
- Python version: [e.g., 3.11]
- pyfk version: [e.g., 0.4.0]
- MPI enabled: [yes/no]

**Additional context**
Add any other context about the problem here.
19 changes: 19 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
name: Feature request
about: Suggest an idea for this project
title: '[FEATURE] '
labels: enhancement
assignees: ''
---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
31 changes: 31 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
## Description

Please include a summary of the changes and the related issue.

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)
- [ ] Documentation update

## How Has This Been Tested?

Please describe the tests that you ran to verify your changes.

- [ ] Test A
- [ ] Test B

## 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
22 changes: 22 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
version: 2
updates:
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "weekly"
open-pull-requests-limit: 5
labels:
- "dependencies"
commit-message:
prefix: "deps"

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
open-pull-requests-limit: 5
labels:
- "dependencies"
- "github-actions"
commit-message:
prefix: "ci"
36 changes: 36 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: "CodeQL"
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
schedule:
- cron: '0 0 * * 0' # Weekly on Sunday
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: [ 'python' ]
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}

- name: Autobuild
uses: github/codeql-action/autobuild@v3

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
30 changes: 30 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: lint
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Install linting tools
run: |
pip install ruff

- name: Run Ruff linter
run: |
ruff check pyfk --ignore E501,F401,E402,F841,E711,E712,F541

- name: Run Ruff formatter check
run: |
ruff format --check pyfk || echo "Formatting issues found (non-blocking)"
43 changes: 38 additions & 5 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,58 @@ on:
release:
types: [published]
jobs:
# Run all tests including MPI tests before publishing
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install OpenMPI
run: |
sudo apt update
sudo apt install openmpi-bin libopenmpi-dev -y

- name: Set up python
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Run standard tests
run: |
pip install .
pip install pytest pytest-mpi
pytest --pyargs pyfk

- name: Run MPI tests
run: |
pip uninstall pyfk -y
pip install mpi4py
PYFK_USE_MPI=1 pip install ".[mpi]"
export OMPI_ALLOW_RUN_AS_ROOT=1
export OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1
mpirun --oversubscribe -np 1 pytest --with-mpi --pyargs pyfk
mpirun --oversubscribe -np 3 pytest --with-mpi --pyargs pyfk

pypi:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up python
id: setup-python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: 3.9
python-version: "3.11"
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 1.2.0b1
version: "1.8.5"
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
Expand Down
46 changes: 40 additions & 6 deletions .github/workflows/publish-to-test-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,58 @@ on:
branches:
- 'test/**'
jobs:
# Run all tests including MPI tests before publishing
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install OpenMPI
run: |
sudo apt update
sudo apt install openmpi-bin libopenmpi-dev -y

- name: Set up python
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Run standard tests
run: |
pip install .
pip install pytest pytest-mpi
pytest --pyargs pyfk

- name: Run MPI tests
run: |
pip uninstall pyfk -y
pip install mpi4py
PYFK_USE_MPI=1 pip install ".[mpi]"
export OMPI_ALLOW_RUN_AS_ROOT=1
export OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1
mpirun --oversubscribe -np 1 pytest --with-mpi --pyargs pyfk
mpirun --oversubscribe -np 3 pytest --with-mpi --pyargs pyfk

testpypi:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up python
id: setup-python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: 3.9
python-version: "3.11"
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 1.2.0b1
version: "1.8.5"
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
Expand All @@ -33,4 +66,5 @@ jobs:
run: |
poetry build -f sdist
poetry config repositories.testpypi https://test.pypi.org/legacy/
poetry publish --repository testpypi --username xiziyi --password ${{ secrets.TestPypiPassWord }}
poetry config pypi-token.testpypi ${{ secrets.TEST_PYPI_TOKEN }}
poetry publish --repository testpypi
12 changes: 6 additions & 6 deletions .github/workflows/sphinx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,24 @@ jobs:
sphinx:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: 3.9
python-version: "3.11"
- name: run doc
run: |
pip install poetry-core@https://github.com/python-poetry/poetry-core/archive/refs/tags/1.1.0a7.zip
pip install poetry-core
pip install numpy obspy cython scipy cysignals
pip install . --no-build-isolation
pip install sphinx==4.5 pydata-sphinx-theme sphinx-autoapi jupyter-sphinx sphinx-copybutton pytest
pip install sphinx pydata-sphinx-theme sphinx-autoapi jupyter-sphinx sphinx-copybutton pytest
cd docs
make html
echo "pyfk.ziyixi.science" > _build/html/CNAME
cd ..
- name: push to github page
if: ${{ !env.ACT }}
uses: peaceiris/actions-gh-pages@v3
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/_build/html
Expand Down
Loading
Loading