-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from fusion-energy/adding_flake8_linting
added auto lint comments to pushes
- Loading branch information
Showing
9 changed files
with
101 additions
and
140 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 |
---|---|---|
@@ -1,47 +1,50 @@ | ||
|
||
# TODO this needs completing, the docker image would currently need a couple of | ||
# versions of openmc as the current 0.13-dev doesn't create an initial_source.h5 | ||
# while the older versions don't write the required xml tag. | ||
# <write_initial_source>true</write_initial_source> | ||
# note to self come back to this once the current version of openmc writes out | ||
# the initial_source.h5 | ||
|
||
|
||
|
||
# # This CI will launch a Docker image that contains all the dependencies required | ||
# # within that image the pytest test suite is run | ||
|
||
# name: CI with install | ||
|
||
# on: | ||
# pull_request: | ||
# branches: | ||
# - develop | ||
# - main | ||
# paths-ignore: | ||
# - 'docs/**' | ||
# - '.gitignore' | ||
# - '*.md' | ||
# - 'CITATION.cff' | ||
# - 'LICENSE.txt' | ||
# - 'readthedocs.yml' | ||
|
||
# jobs: | ||
# testing: | ||
# runs-on: ubuntu-latest | ||
# container: | ||
# image: ghcr.io/fusion-energy/paramak:dependencies | ||
# steps: | ||
# - name: Checkout repository | ||
# uses: actions/checkout@v2 | ||
|
||
# - name: install package | ||
# run: | | ||
# python setup.py install | ||
|
||
# - name: Run test_utils | ||
# run: | | ||
# pytest tests/test_utils.py -v --cov=openmc_source_plotter --cov-append --cov-report term --cov-report xml | ||
|
||
# - name: Upload to codecov | ||
# uses: codecov/codecov-action@v2 | ||
# This CI will launch a Docker image that contains all the dependencies required | ||
# within that image the pytest test suite is run | ||
|
||
name: CI with install | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- develop | ||
- main | ||
paths-ignore: | ||
- 'docs/**' | ||
- '.gitignore' | ||
- '*.md' | ||
- 'CITATION.cff' | ||
- 'LICENSE.txt' | ||
- 'readthedocs.yml' | ||
|
||
jobs: | ||
testing: | ||
runs-on: ubuntu-latest | ||
container: | ||
image: openmc/openmc:develop | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: install package | ||
run: | | ||
pip install . | ||
python -c "import openmc_source_plotter" | ||
- name: Run examples | ||
run: | | ||
python examples/example_get_particle_data.py | ||
python examples/example_plot_source_direction.py | ||
python examples/example_plot_source_energy.py | ||
python examples/example_plot_source_position.py | ||
python examples/example_plot_two_source_energies.py | ||
pip install openmc_plasma_source | ||
python examples/example_plot_plasma_source_position.py | ||
- name: Run test_utils | ||
run: | | ||
pip install .[tests] | ||
pytest tests -v --cov=openmc_source_plotter --cov-append --cov-report term --cov-report xml | ||
- name: Upload to codecov | ||
uses: codecov/codecov-action@v2 |
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,27 @@ | ||
name: Python Flake8 Lint | ||
|
||
on: | ||
# Trigger the workflow pull requests to any branch | ||
pull_request: | ||
|
||
jobs: | ||
run-linters: | ||
name: lint | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Check out Git repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.10" | ||
|
||
- name: Install Python dependencies | ||
run: pip install flake8 | ||
|
||
- name: Run linters | ||
uses: wearerequired/lint-action@v2 | ||
with: | ||
flake8: true |
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 |
---|---|---|
|
@@ -131,3 +131,6 @@ dmypy.json | |
# openmc files | ||
*.h5 | ||
*.xml | ||
|
||
# version file | ||
openmc_source_plotter/_version.py |
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
Empty file.
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
This file was deleted.
Oops, something went wrong.