scipp / copier_template

Copier template for Scipp projects
BSD 3-Clause "New" or "Revised" License
1 stars 1 forks source link

Remove Scipp-specifics, or make them optional? #141

Closed SimonHeybrock closed 3 months ago

SimonHeybrock commented 4 months ago

If we want to make this more widely usable, we should consider removing as many Scipp-specifics as possible, or least make them optional.

Start by addressing the simple and obvious, it does not have to be perfect in the first iteration!

Here is a list (maybe incomplete) of potential offenders:

$ grep -r scipp template/
template/CODE_OF_CONDUCT.md:scipp[at]ess.eu.
template/requirements/make_base.py:# Copyright (c) 2023 Scipp contributors (https://github.com/scipp)
template/requirements/make_base.py:        org = "scipp"
template/requirements/make_base.py:    if repo == "scipp":
template/requirements/make_base.py:        base = "https://github.com/scipp/scipp/releases/download/nightly/scipp-nightly"
template/docs/about/index.md.jinja:Older versions of the documentation pages can be found under the assets of each [release](https://github.com/scipp/{{projectname}}/releases).
template/docs/about/index.md.jinja:{{prettyname}} is hosted and developed [on GitHub](https://github.com/scipp/{{projectname}}).
template/docs/conf.py.jinja:    'scipp': ('https://scipp.github.io/', None),
template/docs/conf.py.jinja:    'scipp._scipp.core.DataArray': 'scipp.DataArray',
template/docs/conf.py.jinja:    'scipp._scipp.core.Dataset': 'scipp.Dataset',
template/docs/conf.py.jinja:    'scipp._scipp.core.DType': 'scipp.DType',
template/docs/conf.py.jinja:    'scipp._scipp.core.Unit': 'scipp.Unit',
template/docs/conf.py.jinja:    'scipp._scipp.core.Variable': 'scipp.Variable',
template/docs/conf.py.jinja:    'scipp.core.data_group.DataGroup': 'scipp.DataGroup',
template/docs/conf.py.jinja:        {"name": "{{ link }}", "url": "https://scipp.github.io{% if link == 'Scipp' %}{% else %}/{{ link|lower }}{% endif %}"},
template/docs/conf.py.jinja:    "--Session.metadata=scipp_sphinx_build=True",
template/docs/conf.py.jinja:    import scipp as sc
template/docs/conf.py.jinja:# Using normalize whitespace because many __str__ functions in scipp produce
template/docs/_templates/doc_version.html:Current {{ project }} version: {{ version }} (<a href="https://github.com/scipp/{{ project|lower }}/releases">older versions</a>).
template/pyproject.toml.jinja:"Documentation" = "https://{{orgname}}.github.io{% if projectname != 'scipp' %}/{{projectname}}{% endif %}"
template/.github/dependabot.yml:  # noise in all template instances. Instead dependabot.yml in scipp/copier_template
template/.github/dependabot.yml:      - dependency-name: "scipp"
template/.github/workflows/ci.yml:# Copyright (c) 2023 Scipp contributors (https://github.com/scipp)
template/.github/workflows/unpinned.yml:# Copyright (c) 2023 Scipp contributors (https://github.com/scipp)
template/.github/workflows/test.yml:# Copyright (c) 2023 Scipp contributors (https://github.com/scipp)
template/.github/workflows/nightly_at_main.yml:# Copyright (c) 2023 Scipp contributors (https://github.com/scipp)
template/.github/workflows/docs.yml:# Copyright (c) 2023 Scipp contributors (https://github.com/scipp)
template/.github/workflows/nightly_at_release.yml:# Copyright (c) 2023 Scipp contributors (https://github.com/scipp)
template/.github/workflows/release.yml:# Copyright (c) 2023 Scipp contributors (https://github.com/scipp)
template/.github/workflows/release.yml:      - run: conda mambabuild --channel conda-forge --channel scipp --no-anaconda-upload --override-channels --output-folder conda/package conda
template/.github/workflows/release.yml:      - run: anaconda --token ${{ secrets.ANACONDATOKEN }} upload --user scipp --label main $(ls conda-package-noarch/*.tar.bz2)
nvaytet commented 4 months ago

Can you solve this by having a second template just for Scipp? (like we did with the ess template?)

SimonHeybrock commented 4 months ago

I think most of the above can be solved without a second template. And combining templates would become tricky if they touch the same file.

nvaytet commented 4 months ago

And combining templates would become tricky if they touch the same file.

Yes, I don't really know how that works.

jl-wynen commented 4 months ago

Concerning the copyright notices, we could just remove them. As I understand it, they are optional anyway. And copyrighting CI workflows, etc. doesn't gain us much.

jokasimr commented 3 months ago

Summary of the remaining scipp specifics:

# Makes sense to keep the email address here
  template/CODE_OF_CONDUCT.md:scipp[at]ess.eu.
# The org of the template is unchanged, so makes sense to keep
  template/.github/dependabot.yml:  # noise in all template instances. Instead dependabot.yml in scipp/copier_template
# Could remove / make optional
  template/.github/dependabot.yml:      - dependency-name: "scipp"
# Could ask in the questionnaire for the conda channel and user
  template/.github/workflows/release.yml:      - run: conda mambabuild --channel conda-forge --channel scipp --no-anaconda-upload --override-channels --output-folder conda/package conda
  template/.github/workflows/release.yml:      - run: anaconda --token ${{ secrets.ANACONDATOKEN }} upload --user scipp --label main $(ls conda-package-noarch/*.tar.bz2)
# This isn't really scipp specific, it doesn't do anything if the org is not 'scipp'
  template/requirements/make_base.py:        org = "scipp"
  template/requirements/make_base.py:    if repo == "scipp":
  template/requirements/make_base.py:        base = "https://github.com/scipp/scipp/releases/download/nightly/scipp-nightly"
# Could make this optional
  template/docs/conf.py.jinja:    'scipp': ('https://scipp.github.io/', None),
  template/docs/conf.py.jinja:    'scipp._scipp.core.DataArray': 'scipp.DataArray',
  template/docs/conf.py.jinja:    'scipp._scipp.core.Dataset': 'scipp.Dataset',
  template/docs/conf.py.jinja:    'scipp._scipp.core.DType': 'scipp.DType',
  template/docs/conf.py.jinja:    'scipp._scipp.core.Unit': 'scipp.Unit',
  template/docs/conf.py.jinja:    'scipp._scipp.core.Variable': 'scipp.Variable',
  template/docs/conf.py.jinja:    'scipp.core.data_group.DataGroup': 'scipp.DataGroup',
  template/docs/conf.py.jinja:    "--Session.metadata=scipp_sphinx_build=True",
  template/docs/conf.py.jinja:    import scipp as sc
  template/docs/conf.py.jinja:# Using normalize whitespace because many __str__ functions in scipp produce
# Doesn't do anything unless the projectname is 'scipp'
  template/pyproject.toml.jinja:"Documentation" = "https://{{orgname}}.github.io{% if projectname != 'scipp' %}/{{projectname}}{% endif %}"

I think the two main categories of scipp specifics that we could remove are:

SimonHeybrock commented 3 months ago

We are already checking the org name in some places, can we make the above conditional if the org name is not scipp?

jokasimr commented 3 months ago

Yes we can make

conditional on the orgname being scipp