Skip to content

Commit e2c9f68

Browse files
committed
Merge branch 'stable' into devel
2 parents f33ff95 + d08901b commit e2c9f68

472 files changed

Lines changed: 27509 additions & 23162 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.codacy.yaml

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
1-
engines:
2-
duplication:
3-
enabled: true
4-
exclude_paths:
5-
- doc/**
6-
bandit:
7-
enabled: true
8-
propspector:
9-
enabled: true
10-
pylint:
11-
enabled: true
12-
13-
14-
15-
exclude_paths:
16-
- 'build/**'
17-
- 'dist/**'
18-
- 'recipe/**'
19-
- 'sample-data/**'
20-
- 'Stoner.egginfo/**'
21-
- 'tests/**'
22-
- 'setup.py'
23-
- '**/conf.py'
24-
- 'doc/modified_plot_directive.py'
25-
1+
engines:
2+
duplication:
3+
enabled: true
4+
exclude_paths:
5+
- doc/**
6+
bandit:
7+
enabled: true
8+
propspector:
9+
enabled: true
10+
pylint:
11+
enabled: true
12+
13+
14+
15+
exclude_paths:
16+
- 'build/**'
17+
- 'dist/**'
18+
- 'recipe/**'
19+
- 'sample-data/**'
20+
- 'Stoner.egginfo/**'
21+
- 'tests/**'
22+
- 'setup.py'
23+
- '**/conf.py'
24+
- 'doc/modified_plot_directive.py'
25+

.coveragerc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
[run]
22
branch = True
33
source = Stoner
4-
omit =
5-
*/widgets.py # Skip gui files that are difficult to test
4+
relative_files = True

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.ovf binary

.github/workflows/build_conda.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
2+
name: Conda
3+
4+
on:
5+
release:
6+
types: ['released', 'prereleased']
7+
8+
# workflow_dispatch: # Un comment line if you also want to trigger action manually
9+
10+
jobs:
11+
conda_deployment_with_new_tag:
12+
name: Conda deployment of package for platform ${{ matrix.os }} with Python ${{ matrix.python-version }}
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
18+
- name: Conda environment creation and activation
19+
uses: conda-incubator/setup-miniconda@505e6394dae86d6a5c7fbb6e3fb8938e3e863830
20+
with:
21+
python-version: "3.12"
22+
environment-file: recipe/build-env.yml
23+
activate-environment: build-environment
24+
auto-update-conda: true
25+
auto-activate-base: false
26+
show-channel-urls: true
27+
- name: Build and upload the conda packages
28+
uses: uibcdf/action-build-and-upload-conda-packages@4940704d2be7906d3bda5b00e3c3e4472fd7808f
29+
with:
30+
meta_yaml_dir: recipe
31+
overwrite: true
32+
python-version: "3.12"
33+
user: phygbu
34+
label: main
35+
token: ${{ secrets.ANACONDA }} # Replace with the right name of your secret
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
name: pytest
2+
on: push
3+
jobs:
4+
run_pytest:
5+
name: run-tests (${{ matrix.python-version }}, ${{ matrix.os }})
6+
runs-on: ${{ matrix.os }}
7+
defaults:
8+
run:
9+
shell: bash -l {0}
10+
strategy:
11+
fail-fast: false
12+
matrix:
13+
python-version: ["3.11", "3.12","3.13"]
14+
os: ["ubuntu-latest"]
15+
steps:
16+
- name: Check out repository code
17+
uses: actions/checkout@v4
18+
- name: Install Conda environment with Micromamba
19+
uses: conda-incubator/setup-miniconda@v3
20+
with:
21+
environment-file: tests/test-env.yml
22+
python: ${{ matrix.python-version }}
23+
channels: conda-forge,phygbu
24+
channel-priority: flexible
25+
activate-environment: test-environment
26+
auto-activate-base: false
27+
- name: Conda information
28+
run: |
29+
conda info
30+
conda list
31+
conda config --show-sources
32+
conda config --show
33+
- name: install package
34+
run: pip install --no-deps .
35+
- name: Install headless server
36+
run: |
37+
sudo apt-get update
38+
sudo apt-get install xvfb
39+
sudo apt-get install qtbase5-dev
40+
- name: Test with xvfb
41+
run: |
42+
xvfb-run --auto-servernum /usr/share/miniconda/envs/test-environment/bin/pytest -n 2 --cov-report= --cov=Stoner --junitxml pytest.xml
43+
coverage xml
44+
env:
45+
TZ: Europe/London
46+
LC_CTYPE: en_GB.UTF-8
47+
GH_ACTION: True
48+
- name: Cleanup X11 server
49+
uses: bcomnes/cleanup-xvfb@v1
50+
- name: Coveralls Parallel
51+
uses: coverallsapp/github-action@v2
52+
with:
53+
flag-name: run-${{ join(matrix.*, '-') }}
54+
format: cobertura
55+
github-token: ${{ secrets.GITHUB_TOKEN }}
56+
- name: Upload Unit Test Results
57+
if: always()
58+
uses: actions/upload-artifact@v4
59+
with:
60+
name: Unit Test Results (Python ${{ matrix.python-version }})
61+
path: pytest.xml
62+
- name: Post Coveraage result to Codacy
63+
run: |
64+
export CODACY_PROJECT_TOKEN=${{ secrets.CODACY_PROJECT_TOKEN }}
65+
bash <(curl -Ls https://coverage.codacy.com/get.sh) report -r coverage.xml
66+
67+
publish-test-results:
68+
name: "Publish Unit Tests Results"
69+
needs: run_pytest
70+
runs-on: ubuntu-latest
71+
if: always()
72+
73+
steps:
74+
- name: Download Artifacts
75+
uses: actions/download-artifact@v4
76+
with:
77+
path: artifacts
78+
79+
- name: Publish Unit Test Results
80+
uses: EnricoMi/publish-unit-test-result-action@v2
81+
with:
82+
files: artifacts/**/*.xml
83+
84+
coverage-finish:
85+
needs: run_pytest
86+
runs-on: ubuntu-latest
87+
steps:
88+
- name: Coveralls Finished
89+
uses: coverallsapp/github-action@v2
90+
with:
91+
parallel-finished: true
92+
carryforward: "run-1,run-2"

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
1+
.eggs
2+
untitled*.py
3+
.pytest_cache
4+
.ipynb_checkpoints
5+
.spyproject
16
*.py[cod]
27
__pycache__
8+
*.lock
9+
*.dirlock
310

411
# sphinx
512
_build

.prospector.yaml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,22 @@ pep257:
6767
- D417
6868
run: true
6969

70+
pydocstyle:
71+
enable:
72+
- D203
73+
- D212
74+
- D404
75+
- D405
76+
disable:
77+
- D211
78+
- D213
79+
- D209
80+
- D406
81+
- D407
82+
- D413
83+
- D417
84+
run: false
85+
7086
pyroma:
7187
run: true
7288

@@ -82,4 +98,4 @@ pyflakes:
8298
run: true
8399

84100
frosted:
85-
run: true
101+
run: true

0 commit comments

Comments
 (0)