Skip to content

Commit

Permalink
Only generate catalog info when in DiamondLightSource
Browse files Browse the repository at this point in the history
Doesn't make sense in per-user repos as they aren't scanned. Also doesn't make sense for bluesky
  • Loading branch information
coretl committed Sep 13, 2024
1 parent cefd623 commit 81248ff
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
17 changes: 10 additions & 7 deletions copier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
package_name:
type: str
help: |
Name of the python import package.
Name of the python import package.
Must be a valid python identifier, i.e. my_package
validator: >-
{% if not (package_name | regex_search('^[a-zA-Z][a-zA-Z_0-9]+$')) %}
Expand Down Expand Up @@ -58,20 +58,22 @@ author_email:
help: Your email address
placeholder: [email protected]

# Catalog info
component_owner:
type: str
when: "{{ github_org == 'DiamondLightSource' }}"
help: |
The unique name of the person or group who owns this component in
The unique name of the person or group who owns this component in
the Developer Portal Software Catalogue.
This will normally be group:default/<your_group>. For a full list of groups visit
This will normally be group:default/<your_group>. For a full list of groups visit
https://dev-portal.diamond.ac.uk/catalog?filters%5Bkind%5D=group&filters%5Buser%5D=all
and hover over each group link to see its group ID, e.g.
https://dev-portal.diamond.ac.uk/catalog/default/group/accelerator-controls
would go here as group:default/accelerator-controls.
component_type:
type: str
when: "{{ github_org == 'DiamondLightSource' }}"
help: |
Type of the component in the Developer Portal Software Catalogue.
Most likely service, library or application (without quotes).
Expand All @@ -84,8 +86,9 @@ component_type:

component_lifecycle:
type: str
when: "{{ github_org == 'DiamondLightSource' }}"
help: |
Project's current lifecycle stage, to be displayed in the Developer
Project's current lifecycle stage, to be displayed in the Developer
Portal Software Catalogue.
choices:
- experimental
Expand Down Expand Up @@ -147,6 +150,6 @@ _tasks:
_migrations:
- version: 2.0.0
before:
- echo This update will require you to login to pypi.org and make changes before you can make a new release to PyPI. If you do not have time to do this now, press CTRL+C to abort this update.
- echo This update will require you to login to pypi.org and make changes before you can make a new release to PyPI. If you do not have time to do this now, press CTRL+C to abort this update.
after:
- echo Visit https://diamondlightsource.github.io/python-copier-template/main/how-to/pypi.html to find out how to set up PyPI trusted publishing
- echo Visit https://diamondlightsource.github.io/python-copier-template/main/how-to/pypi.html to find out how to set up PyPI trusted publishing
File renamed without changes.
8 changes: 8 additions & 0 deletions tests/test_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ def test_template_defaults(tmp_path: Path):
run = make_venv(tmp_path)
container_doc = tmp_path / "docs" / "how-to" / "run-container.md"
assert container_doc.exists()
catalog_info = tmp_path / "catalog-info.yaml"
assert catalog_info.exists()
run("./venv/bin/tox -p")
run("./venv/bin/pip install build twine")
run("./venv/bin/python -m build")
Expand Down Expand Up @@ -114,6 +116,12 @@ def test_template_no_docs(tmp_path: Path):
run("./venv/bin/tox -p")


def test_template_in_different_org_has_no_catalog(tmp_path: Path):
copy_project(tmp_path, github_org="bluesky")
catalog_info = tmp_path / "catalog-info.yaml"
assert not catalog_info.exists()


def test_template_no_docker_has_no_docs_and_works(tmp_path: Path):
copy_project(tmp_path, docker=False)
container_doc = tmp_path / "docs" / "how-to" / "run-container.md"
Expand Down

0 comments on commit 81248ff

Please sign in to comment.