From 4fec43cc5c6f974dd4b16e1ad5a07e2646b65edd Mon Sep 17 00:00:00 2001 From: YooSunYoung <17974113+YooSunYoung@users.noreply.github.com> Date: Fri, 27 Feb 2026 13:18:26 +0100 Subject: [PATCH 1/2] Remove dependabot and issue template. --- .../ISSUE_TEMPLATE/high-level-requirement.yml | 97 ------------------- template/.github/dependabot.yml | 13 --- 2 files changed, 110 deletions(-) delete mode 100644 template/.github/ISSUE_TEMPLATE/high-level-requirement.yml delete mode 100644 template/.github/dependabot.yml diff --git a/template/.github/ISSUE_TEMPLATE/high-level-requirement.yml b/template/.github/ISSUE_TEMPLATE/high-level-requirement.yml deleted file mode 100644 index 4d87603..0000000 --- a/template/.github/ISSUE_TEMPLATE/high-level-requirement.yml +++ /dev/null @@ -1,97 +0,0 @@ -name: High-level requirement -description: Describe a high-level requirement -title: "[Requirement] " -labels: ["requirement"] -projects: [] -body: - - type: markdown - attributes: - value: | - Thanks for taking the time to provide as many details as possible for this requirement! - - type: input - id: summary - attributes: - label: Executive summary - description: Provide a short summary of the requirement - placeholder: "Example: We need to correct for X when processing Y." - validations: - required: true - - type: textarea - id: context - attributes: - label: Context and background knowledge - description: | - - What is the context of this requirement? - - What background knowledge is required to understand it? - - Does this depend on previous tasks? Provide links! - - Is there follow-up work? - placeholder: "Example: See summary on Wikipedia, or the following paper." - validations: - required: true - - type: textarea - id: inputs - attributes: - label: Inputs - description: | - Describe in detail all the input data and data properties that are known. - This is not about test data (see below), but about general properties of data that will be used in practice. - placeholder: "Example: A single 1-D spectrum with a known wavelength range." - validations: - required: true - - type: textarea - id: methodology - attributes: - label: Methodology - description: | - Describe, e.g., the computation to be performed. - When linking to references, please refer to the specific section, page, or equation. - placeholder: "Remember you can write equations such as $n\\lambda = 2d\\sin(\\theta)$ using LaTeX syntax, as well as other Markdown formatting." - validations: - required: true - - type: textarea - id: outputs - attributes: - label: Outputs - description: | - Describe in detail all the output data and data properties. - This is not about test data (see below), but about general properties of data that will be used in practice. - placeholder: "Example: The position of the peak in the spectrum." - validations: - required: true - - type: dropdown - id: interfaces - attributes: - label: Which interfaces are required? - multiple: true - options: - - Integrated into reduction workflow - - Python module / function - - Python script - - Jupyter notebook - - Other (please describe in comments) - default: 0 - validations: - required: true - - type: textarea - id: testcases - attributes: - label: Test cases - description: How can we test this requirement? Links to tests data and reference data, or other suggestions. - validations: - required: true - - type: textarea - id: existingimplementations - attributes: - label: Existing implementations - description: Are there any existing implementations or proof-of-concept implementations that we can imitate? This field is specifically for linking to source code. - placeholder: "Example: See this repository ... This script implements the procedure: https://file-storage.server.eu/script.code." - validations: - required: false - - type: textarea - id: comments - attributes: - label: Comments - description: Do you have other comments that do not fall in the above categories? - placeholder: "Example: Depends on issues #1234, blocked by #666." - validations: - required: false diff --git a/template/.github/dependabot.yml b/template/.github/dependabot.yml deleted file mode 100644 index 33f314a..0000000 --- a/template/.github/dependabot.yml +++ /dev/null @@ -1,13 +0,0 @@ -version: 2 -updates: - # Note: We are not listing package-ecosystem: "github-actions". This causes - # noise in all template instances. Instead dependabot.yml in scipp/copier_template - # triggers updates of github-actions in the *template*. We then use `copier update` - # in template instances. - - package-ecosystem: "pip" - directory: "/requirements" - schedule: - interval: "quarterly" - allow: - - dependency-name: "scipp" - dependency-type: "direct" From 16b0648f3385a6f09a7aa779a03064702704cda3 Mon Sep 17 00:00:00 2001 From: YooSunYoung <17974113+YooSunYoung@users.noreply.github.com> Date: Fri, 27 Feb 2026 14:32:46 +0100 Subject: [PATCH 2/2] README template for the ess monorepo to render subpackage informations. --- copier.yml | 16 ++++++ template/README.md.jinja | 112 +++++++++++++++++++++++++++++++++++++++ template/pixi.toml.jinja | 62 ++++++++++++++++++++++ 3 files changed, 190 insertions(+) create mode 100644 template/README.md.jinja create mode 100644 template/pixi.toml.jinja diff --git a/copier.yml b/copier.yml index 6731daa..700449a 100644 --- a/copier.yml +++ b/copier.yml @@ -1,2 +1,18 @@ _subdirectory: template _answers_file: .copier-answers.ess.yml +# Questions +subpackages: + type: yaml + multiline: true + help: Subpackages information. Name, description and dependencies. + default: + # Include the existing packages as defaults for easier template settings for now. + # They should be deleted once we have the answer file in the ess project. + - name: essreduce + description: Common data reduction tools (core) + dependencies: [] + - name: essimaging + description: Neutron imaging (ODIN, TBL, YMIR) + dependencies: + - essreduce + diff --git a/template/README.md.jinja b/template/README.md.jinja new file mode 100644 index 0000000..b05b412 --- /dev/null +++ b/template/README.md.jinja @@ -0,0 +1,112 @@ +# ESS Data Reduction Monorepo + +Monorepo for ESS neutron scattering data reduction packages, managed with [pixi](https://pixi.sh/). + +| Package | Description | +|---------|-------------| +{% for package in subpackages %}| [{{ package.name }}](packages/{{ package.name }}/) | {{ package.description }} | +{% endfor %} +## Dependency graph + +``` +essreduce +└── essimaging +``` + +--- + +## Developer Guide + +### Prerequisites + +Install [pixi](https://pixi.sh/): + +```bash +curl -fsSL https://pixi.sh/install.sh | bash +``` + +### Setup + +```bash +git clone git@github.com:scipp/ess.git +cd ess + +# Install all packages (editable, with test deps): +pixi install + +# Or just one package: +pixi install -e essreduce +``` + +The `pixi.lock` file pins all dependencies reproducibly. No tox, no pip-compile, no manual virtualenv. + +### Running tests + +```bash +# Test a package: +pixi run test essreduce +pixi run test essimaging + +# Test a single file: +pixi run -e essreduce pytest packages/essreduce/tests/normalization_test.py +``` + +### Linting and formatting + +```bash +pixi run -e lint lint # all pre-commit hooks +pixi run -e lint check # ruff check +pixi run -e lint format # ruff format +``` + +### Building docs + +```bash +pixi run docs essreduce +pixi run docs essimaging +``` + +### Adding or changing dependencies + +Edit the package's `pyproject.toml`, then re-lock: + +```bash +pixi install +``` + +Commit the updated `pixi.lock`. + +### Releasing a package + +Push a tag with the package prefix: + +```bash +git tag essreduce/26.3.0 +git push origin main --tags +``` + +The `release.yml` workflow builds, publishes to PyPI, and deploys docs. + +### How CI works + +- **On PRs:** Only changed packages are tested (changing `essreduce` also tests `essimaging`) +- **Nightly:** All packages tested against latest deps + lower-bound deps +- **Weekly:** All packages tested on macOS and Windows + +### Repo structure + +``` +pixi.toml ← workspace root (features, tasks, environments) +pixi.lock ← single lockfile for all packages +.pre-commit-config.yaml ← shared linting hooks +packages/ + essreduce/ + pyproject.toml ← package deps, version, pytest config + src/ess/reduce/ ← source code (ess.reduce namespace) + tests/ + docs/ + essimaging/ + pyproject.toml + src/ess/imaging/ ← source code (ess.imaging namespace) + ... +``` diff --git a/template/pixi.toml.jinja b/template/pixi.toml.jinja new file mode 100644 index 0000000..1bc45fe --- /dev/null +++ b/template/pixi.toml.jinja @@ -0,0 +1,62 @@ +[workspace] +name = "ess" +channels = ["conda-forge"] +platforms = ["linux-64", "osx-64", "osx-arm64", "win-64"] +version = "2026.2.0" + +[dependencies] +python = "3.11.*" + +# ==================== Parameterized tasks ==================== + +[tasks.test] +cmd = "pytest packages/{% raw %}{{ package }}{% endraw %}/tests/" +args = ["package"] + +[tasks.docs] +cmd = "python -m sphinx -v -b html -d /tmp/docs_doctrees packages/{% raw %}{{ package }}{% endraw %}/docs packages/{% raw %}{{ package }}{% endraw %}/html" +args = ["package"] + +# ==================== Package features ==================== + +{% for package in subpackages %}# {{ package.name }} {% if package.name == "essreduce" %}(core package, no workspace deps){% else %}(depends on {{ ', '.join(package.dependencies) }}){% endif %} +[feature.{{ package.name }}.pypi-dependencies] +{{ package.name }} = { path = "packages/{{ package.name }}", editable = true, extras = ["test"] } + +{% endfor %}# ==================== Lint feature ==================== + +[feature.lint.pypi-dependencies] +pre-commit = "*" +ruff = ">=0.15" + +[feature.lint.tasks] +lint = "pre-commit run --all-files" +check = "ruff check ." +format = "ruff format ." + +# ==================== Docs feature ==================== + +[feature.docs.dependencies] +pandoc = "*" + +# Per-package docs features (install with docs extra) +{% for package in subpackages %}[feature.docs-{{ package.name }}.pypi-dependencies] +{{ package.name }} = { path = "packages/{{ package.name }}", editable = true, extras = ["test", "docs"] } + +{% endfor %}# ==================== Environments ==================== + +[environments] +# Default: all packages (for full dev setup) +default = { features = [{% for package in subpackages %}"{{ package.name }}"{% if not loop.last %}, {% endif %}{% endfor %}], solve-group = "default" } + +# Per-package test environments (include workspace dep features) +{% for package in subpackages %}{{ package.name }} = { features = ["{{ package.name }}"{% if package.dependencies %}, {% endif %}{% for dep in package.dependencies %}"{{ dep }}"{% if not loop.last %}, {% endif %}{% endfor %}], solve-group = "default" } +{% endfor %} +# Lower-bound test environments (separate resolution) +{% for package in subpackages %}lb-{{ package.name }} = { features = ["{{ package.name }}"{% if package.dependencies %}, {% endif %}{% for dep in package.dependencies %}"{{ dep }}"{% if not loop.last %}, {% endif %}{% endfor %}], solve-group = "lower-bound" } +{% endfor %} +# Docs environments (package with docs extra + pandoc) +{% for package in subpackages %}docs-{{ package.name }} = { features = ["docs-{{ package.name }}", {% for dep in package.dependencies %}"docs-{{ dep }}", {% endfor %}"docs"], solve-group = "default" } +{% endfor %} +# Lint environment (standalone, no package deps) +lint = { features = ["lint"], solve-group = "lint" }