Skip to content

Commit 4e71972

Browse files
Switch to the new easyscience/templates system (#129)
* Apply new templates * pixi run nonpy-format-fix * pixi run py-lint-fix * Disable some rules temporary * pixi run py-format-fix * Temporarily disable pydoclint until we are ready * Update license headers * Convert notebooks * Clean up * Add missing deps to test workflow * Add parameter-property consistency checker * Use structural type extraction in param consistency checker * Enhance property docstrings and type hints for clarity and consistency * Enhance docstrings by including type annotations for setter arguments * Ignore E501 lint rule in favor of formatter and W505 * Update line length settings in pyproject.toml for consistency and clarity * Simplify property docstring template and checker * Wrap long property docstrings to satisfy max-doc-length * Switch from docformatter to format-docstring * Apply formatting * Apply formatting * Convert docstrings from google to numpy style: Step 1 * Remove docstring-format-check * Convert docstrings from google to numpy style: Step 2 * Convert docstrings from google to numpy style: Step 3 * Enable ANN rules * Apply linting and formatting * Run docstring format fix for src/ only * Add types to the Parameters sections in docstrings * Apply docstrings formatting * More rules * Bump dependencies * Add some missing docstrings to public methods * New combination of rules * Make all docstring summaries to take single line * More docstring fixes * Remove unused script * Fix D401: use imperative mood in all docstring summaries * More formatting and linting * More fromatting * Add missing D101 class docstrings across 9 files * Add missing D105 magic method docstrings across 3 files * Minor changes * Fix broken nav entry, tutorial links, and anchor in docs * Bump dependencies * Refactor tutorial display to remove description and update title in index * Add platform-specific dependencies for GNU Scientific Library and libc++ on macOS * Consolidate GNU Scientific Library dependency for macOS in pixi.toml and test.yml
1 parent 25e84b7 commit 4e71972

File tree

408 files changed

+24321
-10182
lines changed

Some content is hidden

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

408 files changed

+24321
-10182
lines changed

.badgery.yaml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,18 @@ cards:
55
- group: Tests
66
type: gh_action
77
title: Code/package tests (GitHub)
8-
file: test.yaml
8+
file: test.yml
99
enabled: true
10-
1110
- group: Tests
1211
type: gh_action
1312
title: Tutorial tests (GitHub)
14-
file: tutorial-tests.yaml
13+
file: tutorial-tests.yml
1514
enabled: true
1615

1716
- group: Tests
1817
type: gh_action
1918
title: Package tests (PyPI)
20-
file: pypi-test.yaml
19+
file: pypi-test.yml
2120
enabled: true
2221

2322
- group: Code Quality
@@ -60,15 +59,14 @@ cards:
6059
title: Docstring coverage (interrogate)
6160
report: reports/{branch}/coverage-docstring.txt
6261
enabled: true
63-
6462
- group: Build & Release
6563
type: gh_action
6664
title: Publishing (PyPI)
67-
workflow: pypi-publish.yaml
65+
workflow: pypi-publish.yml
6866
enabled: true
6967

7068
- group: Build & Release
7169
type: gh_action
7270
title: Docs build/deployment
73-
workflow: docs.yaml
71+
workflow: docs.yml
7472
enabled: true

.copier-answers.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# WARNING: Do not edit this file manually.
2+
# Any changes will be overwritten by Copier.
3+
_commit: v0.10.1-25-ga5301e9
4+
_src_path: gh:easyscience/templates
5+
app_docs_url: https://easyscience.github.io/diffraction-app
6+
app_doi: 10.5281/zenodo.18163581
7+
app_package_name: easydiffraction_app
8+
app_python: '3.13'
9+
app_repo_name: diffraction-app
10+
home_page_url: https://easyscience.github.io/diffraction
11+
home_repo_name: diffraction
12+
lib_docs_url: https://easyscience.github.io/diffraction-lib
13+
lib_doi: 10.5281/zenodo.18163581
14+
lib_package_name: easydiffraction
15+
lib_python_max: '3.13'
16+
lib_python_min: '3.11'
17+
lib_repo_name: diffraction-lib
18+
project_contact_email: support@easydiffraction.org
19+
project_copyright_years: 2021-2026
20+
project_extended_description: A software for calculating neutron powder diffraction
21+
patterns based on a structural model and refining its parameters against experimental
22+
data
23+
project_name: EasyDiffraction
24+
project_short_description: Diffraction data analysis
25+
project_shortcut: ED
26+
project_type: both
27+
template_type: lib
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: 'Download artifact'
2+
description: 'Generic wrapper for actions/download-artifact'
3+
inputs:
4+
name:
5+
description: 'Name of the artifact to download'
6+
required: true
7+
8+
path:
9+
description: 'Destination path'
10+
required: false
11+
default: '.'
12+
13+
pattern:
14+
description: 'Glob pattern to match artifact names (optional)'
15+
required: false
16+
default: ''
17+
18+
merge-multiple:
19+
description: 'Merge multiple artifacts into the same directory'
20+
required: false
21+
default: 'false'
22+
23+
github-token:
24+
description: 'GitHub token for cross-repo download (optional)'
25+
required: false
26+
default: ''
27+
28+
repository:
29+
description: 'owner/repo for cross-repo download (optional)'
30+
required: false
31+
default: ''
32+
33+
run-id:
34+
description: 'Workflow run ID for cross-run download (optional)'
35+
required: false
36+
default: ''
37+
38+
runs:
39+
using: 'composite'
40+
steps:
41+
- name: Download artifact
42+
uses: actions/download-artifact@v4
43+
with:
44+
name: ${{ inputs.name }}
45+
path: ${{ inputs.path }}
46+
pattern: ${{ inputs.pattern }}
47+
merge-multiple: ${{ inputs.merge-multiple }}
48+
github-token: ${{ inputs.github-token }}
49+
repository: ${{ inputs.repository }}
50+
run-id: ${{ inputs.run-id }}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: 'GitHub Script'
2+
description: 'Wrapper for actions/github-script'
3+
inputs:
4+
script:
5+
description: 'JavaScript to run'
6+
required: true
7+
8+
github-token:
9+
description: 'GitHub token (defaults to github.token)'
10+
required: false
11+
default: ${{ github.token }}
12+
13+
runs:
14+
using: 'composite'
15+
steps:
16+
- uses: actions/github-script@v8
17+
with:
18+
script: ${{ inputs.script }}
19+
github-token: ${{ inputs.github-token }}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: 'Setup EasyScience bot for pushing'
2+
description: 'Create GitHub App token and configure git identity + origin remote'
3+
inputs:
4+
app-id:
5+
description: 'GitHub App ID'
6+
required: true
7+
private-key:
8+
description: 'GitHub App private key (PEM)'
9+
required: true
10+
repositories:
11+
description: 'Additional repositories to grant access to (newline-separated)'
12+
required: false
13+
default: ''
14+
15+
outputs:
16+
token:
17+
description: 'Installation access token'
18+
value: ${{ steps.app-token.outputs.token }}
19+
20+
runs:
21+
using: 'composite'
22+
steps:
23+
- name: Create GitHub App installation token
24+
id: app-token
25+
uses: actions/create-github-app-token@v2
26+
with:
27+
app-id: ${{ inputs.app-id }}
28+
private-key: ${{ inputs.private-key }}
29+
repositories: ${{ inputs.repositories }}
30+
31+
- name: Configure git for pushing
32+
shell: bash
33+
run: |
34+
git config user.name "easyscience[bot]"
35+
git config user.email "${{ inputs.app-id }}+easyscience[bot]@users.noreply.github.com"
36+
37+
- name: Configure origin remote to use the bot token
38+
shell: bash
39+
run: |
40+
git remote set-url origin https://x-access-token:${{ steps.app-token.outputs.token }}@github.com/${{ github.repository }}.git
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: 'Setup Pixi Environment'
2+
description: 'Sets up pixi with common configuration'
3+
inputs:
4+
environments:
5+
description: 'Pixi environments to setup'
6+
required: false
7+
default: 'default'
8+
activate-environment:
9+
description: 'Environment to activate'
10+
required: false
11+
default: 'default'
12+
run-install:
13+
description: 'Whether to run pixi install'
14+
required: false
15+
default: 'true'
16+
locked:
17+
description: 'Whether to run pixi install --locked'
18+
required: false
19+
default: 'false'
20+
frozen:
21+
description: 'Whether to run pixi install --frozen'
22+
required: false
23+
default: 'true'
24+
cache:
25+
description: 'Whether to use cache'
26+
required: false
27+
default: 'false'
28+
post-cleanup:
29+
description: 'Whether to run post cleanup'
30+
required: false
31+
default: 'false'
32+
33+
runs:
34+
using: 'composite'
35+
steps:
36+
- uses: prefix-dev/setup-pixi@v0.9.4
37+
with:
38+
environments: ${{ inputs.environments }}
39+
activate-environment: ${{ inputs.activate-environment }}
40+
run-install: ${{ inputs.run-install }}
41+
locked: ${{ inputs.locked }}
42+
frozen: ${{ inputs.frozen }}
43+
cache: ${{ inputs.cache }}
44+
post-cleanup: ${{ inputs.post-cleanup }}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: 'Upload artifact'
2+
description: 'Generic wrapper for actions/upload-artifact'
3+
inputs:
4+
name:
5+
description: 'Artifact name'
6+
required: true
7+
8+
path:
9+
description: 'File(s)/dir(s)/glob(s) to upload (newline-separated)'
10+
required: true
11+
12+
include-hidden-files:
13+
description: 'Include hidden files'
14+
required: false
15+
default: 'true'
16+
17+
if-no-files-found:
18+
description: 'warn | error | ignore'
19+
required: false
20+
default: 'error'
21+
22+
compression-level:
23+
description: '0-9 (0 = no compression)'
24+
required: false
25+
default: '0'
26+
27+
retention-days:
28+
description: 'Retention in days (optional)'
29+
required: false
30+
default: ''
31+
32+
overwrite:
33+
description: 'Overwrite an existing artifact with the same name'
34+
required: false
35+
default: 'false'
36+
37+
runs:
38+
using: 'composite'
39+
steps:
40+
- name: Upload artifact
41+
uses: actions/upload-artifact@v4
42+
with:
43+
name: ${{ inputs.name }}
44+
path: ${{ inputs.path }}
45+
include-hidden-files: ${{ inputs.include-hidden-files }}
46+
if-no-files-found: ${{ inputs.if-no-files-found }}
47+
compression-level: ${{ inputs.compression-level }}
48+
retention-days: ${{ inputs.retention-days }}
49+
overwrite: ${{ inputs.overwrite }}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: 'Upload coverage to Codecov'
2+
description: 'Generic wrapper for codecov/codecov-action@v5'
3+
4+
inputs:
5+
name:
6+
description: 'Codecov upload name'
7+
required: true
8+
9+
flags:
10+
description: 'Codecov flags'
11+
required: false
12+
default: ''
13+
14+
files:
15+
description: 'Coverage report files'
16+
required: true
17+
18+
fail_ci_if_error:
19+
description: 'Fail CI if upload fails'
20+
required: false
21+
default: 'true'
22+
23+
verbose:
24+
description: 'Enable verbose output'
25+
required: false
26+
default: 'true'
27+
28+
token:
29+
description: 'Codecov token'
30+
required: true
31+
32+
runs:
33+
using: composite
34+
steps:
35+
- uses: codecov/codecov-action@v5
36+
with:
37+
name: ${{ inputs.name }}
38+
flags: ${{ inputs.flags }}
39+
files: ${{ inputs.files }}
40+
fail_ci_if_error: ${{ inputs.fail_ci_if_error }}
41+
verbose: ${{ inputs.verbose }}
42+
token: ${{ inputs.token }}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"source": {
3+
"branch": "gh-pages",
4+
"path": "/"
5+
}
6+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"name": "develop branch",
3+
"target": "branch",
4+
"enforcement": "active",
5+
"conditions": {
6+
"ref_name": {
7+
"include": ["refs/heads/develop"],
8+
"exclude": []
9+
}
10+
},
11+
"bypass_actors": [
12+
{
13+
"actor_id": 2476259,
14+
"actor_type": "Integration",
15+
"bypass_mode": "always"
16+
}
17+
],
18+
"rules": [
19+
{
20+
"type": "non_fast_forward"
21+
},
22+
{
23+
"type": "deletion"
24+
},
25+
{
26+
"type": "pull_request",
27+
"parameters": {
28+
"allowed_merge_methods": ["squash"],
29+
"dismiss_stale_reviews_on_push": false,
30+
"require_code_owner_review": false,
31+
"require_last_push_approval": false,
32+
"required_approving_review_count": 0,
33+
"required_review_thread_resolution": false
34+
}
35+
}
36+
]
37+
}

0 commit comments

Comments
 (0)