Skip to content

Commit f65ae5c

Browse files
committed
Setup from copier_template
0 parents  commit f65ae5c

Some content is hidden

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

49 files changed

+2081
-0
lines changed

.copier-answers.yml

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
2+
_commit: 0c002dc
3+
_src_path: gh:scipp/copier_template
4+
description: Reflectometry data reduction for the European Spallation Source
5+
github_linux_image: ubuntu-20.04
6+
max_python: '3.11'
7+
min_python: '3.8'
8+
orgname: scipp
9+
projectname: essreflectometry
10+
year: 2023

.github/dependabot.yml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
7+
ignore:
8+
# Optional: Official actions have moving tags like v1;
9+
# if you use those, you don't need updates.
10+
- dependency-name: "actions/*"
11+
- package-ecosystem: "pip"
12+
directory: "/requirements"
13+
schedule:
14+
interval: "daily"
15+
allow:
16+
- dependency-name: "scipp"
17+
dependency-type: "direct"

.github/workflows/ci.yml

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# SPDX-License-Identifier: BSD-3-Clause
2+
# Copyright (c) 2023 Scipp contributors (https://github.com/scipp)
3+
4+
name: CI
5+
6+
on:
7+
push:
8+
branches:
9+
- main
10+
- release
11+
pull_request:
12+
13+
jobs:
14+
formatting:
15+
name: Formatting and static analysis
16+
runs-on: 'ubuntu-20.04'
17+
steps:
18+
- uses: actions/checkout@v3
19+
- uses: actions/setup-python@v3
20+
with:
21+
python-version: '3.8'
22+
- run: python -m pip install --upgrade pip
23+
- run: python -m pip install -r requirements/ci.txt
24+
- run: tox -e static
25+
- uses: stefanzweifel/git-auto-commit-action@v4
26+
with:
27+
commit_message: Apply automatic formatting
28+
29+
tests:
30+
name: Tests
31+
needs: formatting
32+
strategy:
33+
matrix:
34+
os: ['ubuntu-20.04']
35+
python:
36+
- version: '3.8'
37+
tox-env: 'py38'
38+
39+
uses: ./.github/workflows/test.yml
40+
with:
41+
os-variant: ${{ matrix.os }}
42+
python-version: ${{ matrix.python.version }}
43+
tox-env: ${{ matrix.python.tox-env }}
44+
45+
docs:
46+
needs: tests
47+
uses: ./.github/workflows/docs.yml
48+
with:
49+
publish: false
50+
branch: ${{ github.head_ref == '' && github.ref_name || github.head_ref }}

.github/workflows/docs.yml

+75
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# SPDX-License-Identifier: BSD-3-Clause
2+
# Copyright (c) 2023 Scipp contributors (https://github.com/scipp)
3+
4+
5+
name: Docs
6+
7+
on:
8+
workflow_dispatch:
9+
inputs:
10+
publish:
11+
default: false
12+
type: boolean
13+
version:
14+
default: ''
15+
required: false
16+
type: string
17+
branch:
18+
description: 'Branch/tag with documentation source. If not set, the current branch will be used.'
19+
default: ''
20+
required: false
21+
type: string
22+
workflow_call:
23+
inputs:
24+
publish:
25+
default: false
26+
type: boolean
27+
version:
28+
default: ''
29+
required: false
30+
type: string
31+
branch:
32+
description: 'Branch/tag with documentation source. If not set, the current branch will be used.'
33+
default: ''
34+
required: false
35+
type: string
36+
37+
env:
38+
VERSION: ${{ inputs.version }}
39+
40+
jobs:
41+
docs:
42+
name: Build documentation
43+
runs-on: 'ubuntu-20.04'
44+
steps:
45+
46+
- run: sudo apt install --yes graphviz pandoc
47+
- uses: actions/checkout@v3
48+
with:
49+
ref: ${{ inputs.branch == '' && github.ref_name || inputs.branch }}
50+
fetch-depth: 0 # history required so cmake can determine version
51+
- uses: actions/setup-python@v3
52+
with:
53+
54+
python-version: '3.8'
55+
- run: python -m pip install --upgrade pip
56+
- run: python -m pip install -r requirements/ci.txt
57+
- run: |
58+
tox --skip-pkg-install -e docs -- essreflectometry==${VERSION}
59+
60+
if: ${{ inputs.version != '' }}
61+
- run: tox -e docs
62+
if: ${{ inputs.version == '' }}
63+
- uses: actions/upload-artifact@v3
64+
with:
65+
name: docs_html
66+
path: html/
67+
68+
- uses: JamesIves/[email protected]
69+
if: ${{ inputs.publish }}
70+
with:
71+
branch: gh-pages
72+
folder: html
73+
single-commit: true
74+
ssh-key: ${{ secrets.GH_PAGES_DEPLOY_KEY }}
75+

.github/workflows/release.yml

+120
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
# SPDX-License-Identifier: BSD-3-Clause
2+
# Copyright (c) 2023 Scipp contributors (https://github.com/scipp)
3+
4+
name: Release
5+
6+
on:
7+
release:
8+
types: [published]
9+
workflow_dispatch:
10+
11+
defaults:
12+
run:
13+
shell: bash -l {0} # required for conda env
14+
15+
jobs:
16+
build_conda:
17+
name: Conda build
18+
runs-on: 'ubuntu-20.04'
19+
20+
steps:
21+
- uses: actions/checkout@v3
22+
with:
23+
submodules: true
24+
fetch-depth: 0 # history required so cmake can determine version
25+
26+
- uses: mamba-org/setup-micromamba@v1
27+
with:
28+
environment-name: build-env
29+
create-args: >-
30+
python=3.8
31+
conda-build
32+
boa
33+
- run: conda mambabuild --channel conda-forge --channel scipp --python=3.8 --no-anaconda-upload --override-channels --output-folder conda/package conda
34+
35+
- uses: actions/upload-artifact@v3
36+
with:
37+
name: conda-package-noarch
38+
path: conda/package/*/essreflectometry*.tar.bz2
39+
40+
build_wheels:
41+
name: Wheels
42+
runs-on: 'ubuntu-20.04'
43+
44+
steps:
45+
- uses: actions/checkout@v3
46+
with:
47+
fetch-depth: 0 # history required so setuptools_scm can determine version
48+
49+
- uses: actions/setup-python@v3
50+
with:
51+
python-version: '3.8'
52+
53+
- run: python -m pip install --upgrade pip
54+
- run: python -m pip install -r requirements/wheels.txt
55+
56+
- name: Build wheels
57+
run: python -m build
58+
59+
- name: Upload wheels
60+
uses: actions/upload-artifact@v3
61+
with:
62+
name: dist
63+
path: dist
64+
65+
upload_pypi:
66+
name: Deploy PyPI
67+
needs: [build_wheels, build_conda]
68+
runs-on: 'ubuntu-20.04'
69+
environment: release
70+
permissions:
71+
id-token: write
72+
if: github.event_name == 'release' && github.event.action == 'published'
73+
steps:
74+
- uses: actions/download-artifact@v3
75+
- uses: pypa/[email protected]
76+
77+
upload_conda:
78+
name: Deploy Conda
79+
needs: [build_wheels, build_conda]
80+
runs-on: 'ubuntu-20.04'
81+
if: github.event_name == 'release' && github.event.action == 'published'
82+
83+
steps:
84+
- uses: actions/download-artifact@v3
85+
- uses: mamba-org/setup-micromamba@v1
86+
with:
87+
environment-name: upload-env
88+
create-args: >-
89+
python=3.8
90+
anaconda-client
91+
92+
- run: anaconda --token ${{ secrets.ANACONDATOKEN }} upload --user scipp --label main $(ls conda-package-*/*/*.tar.bz2)
93+
94+
docs:
95+
needs: [upload_conda, upload_pypi]
96+
uses: ./.github/workflows/docs.yml
97+
with:
98+
publish: ${{ github.event_name == 'release' && github.event.action == 'published' }}
99+
secrets: inherit
100+
101+
102+
assets:
103+
name: Upload docs
104+
needs: docs
105+
runs-on: 'ubuntu-20.04'
106+
permissions:
107+
contents: write # This is needed so that the action can upload the asset
108+
109+
steps:
110+
- uses: actions/download-artifact@v3
111+
- name: Zip documentation
112+
run: |
113+
mv docs_html documentation-${{ github.ref_name }}
114+
zip -r documentation-${{ github.ref_name }}.zip documentation-${{ github.ref_name }}
115+
- name: Upload release assets
116+
uses: svenstaro/upload-release-action@v2
117+
with:
118+
file: ./documentation-${{ github.ref_name }}.zip
119+
overwrite: false
120+

.github/workflows/test.yml

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# SPDX-License-Identifier: BSD-3-Clause
2+
# Copyright (c) 2023 Scipp contributors (https://github.com/scipp)
3+
4+
name: Test
5+
6+
on:
7+
workflow_dispatch:
8+
inputs:
9+
os-variant:
10+
default: 'ubuntu-20.04'
11+
type: string
12+
python-version:
13+
default: '3.8'
14+
type: string
15+
tox-env:
16+
default: 'test'
17+
type: string
18+
pip-recipe:
19+
default: 'requirements/ci.txt'
20+
type: string
21+
coverage-report:
22+
default: false
23+
type: boolean
24+
workflow_call:
25+
inputs:
26+
os-variant:
27+
default: 'ubuntu-20.04'
28+
type: string
29+
python-version:
30+
default: '3.8'
31+
type: string
32+
tox-env:
33+
default: 'test'
34+
type: string
35+
pip-recipe:
36+
default: 'requirements/ci.txt'
37+
type: string
38+
coverage-report:
39+
default: false
40+
type: boolean
41+
42+
jobs:
43+
test:
44+
runs-on: ${{ inputs.os-variant }}
45+
46+
steps:
47+
- uses: actions/checkout@v3
48+
- uses: actions/setup-python@v3
49+
with:
50+
python-version: ${{ inputs.python-version }}
51+
- run: python -m pip install --upgrade pip
52+
- run: python -m pip install -r ${{ inputs.pip-recipe }}
53+
- run: tox -e ${{ inputs.tox-env }}
54+
- uses: actions/upload-artifact@v3
55+
if: ${{ inputs.coverage-report }}
56+
with:
57+
name: CoverageReport
58+
path: coverage_html/
59+

.gitignore

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
dist
2+
html
3+
.tox
4+
src/essreflectometry.egg-info
5+
6+
*.sw?
7+
8+
.clangd/
9+
.idea/
10+
.vscode/
11+
*.ipynb_checkpoints
12+
__pycache__/
13+
.vs/
14+
.virtual_documents
15+
.hypothesis
16+
.pytest_cache
17+
.mypy_cache
18+
docs/generated/

0 commit comments

Comments
 (0)