Skip to content

Commit

Permalink
BREAK: rename repository to ComPWA/policy
Browse files Browse the repository at this point in the history
  • Loading branch information
redeboer committed Jan 12, 2024
1 parent b7a6b23 commit edf22f6
Show file tree
Hide file tree
Showing 78 changed files with 271 additions and 249 deletions.
1 change: 0 additions & 1 deletion .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
"oneline",
"pytest",
"PYTHONHASHSEED",
"repoma",
"sympy",
"toctree",
"Zenodo"
Expand Down
4 changes: 2 additions & 2 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name-template: ComPWA Repository Maintenance $NEXT_PATCH_VERSION
name-template: ComPWA repository policy $NEXT_PATCH_VERSION
tag-template: $NEXT_PATCH_VERSION

references:
Expand Down Expand Up @@ -34,4 +34,4 @@ sort-direction: ascending
template: |
$CHANGES
_The full changelog as commits can be found [here](https://github.com/ComPWA/repo-maintenance/compare/$PREVIOUS_TAG...$NEXT_PATCH_VERSION)._
_The full changelog as commits can be found [here](https://github.com/ComPWA/policy/compare/$PREVIOUS_TAG...$NEXT_PATCH_VERSION)._
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
pytest:
uses: ComPWA/actions/.github/workflows/pytest.yml@v1
with:
coverage-target: repoma
coverage-target: compwa_policy
macos-python-version: "3.9"
specific-pip-packages: ${{ inputs.specific-pip-packages }}
style:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/sync-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ jobs:
pip install labels
- name: Sync general issue labels
run: |
labels sync --filename labels/default.toml --owner ComPWA --repo RUB-EP1-AG
labels sync --filename labels/default.toml --owner ComPWA --repo ampform
labels sync --filename labels/default.toml --owner ComPWA --repo benchmarks
labels sync --filename labels/default.toml --owner ComPWA --repo compwa-org
labels sync --filename labels/default.toml --owner ComPWA --repo RUB-EP1-AG
labels sync --filename labels/default.toml --owner ComPWA --repo policy
labels sync --filename labels/default.toml --owner ComPWA --repo qrules
labels sync --filename labels/default.toml --owner ComPWA --repo repo-maintenance
labels sync --filename labels/default.toml --owner ComPWA --repo sphinxcontrib-hep-pdgref
labels sync --filename labels/default.toml --owner ComPWA --repo tensorwaves
labels sync --filename labels/default.toml --owner ComPWA --repo update-pip-constraints
Expand Down
12 changes: 6 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ci:
- mypy
- prettier
- pyright
- repoma-self-check
- self-check
- taplo

repos:
Expand Down Expand Up @@ -47,12 +47,12 @@ repos:
- --no-notebooks
- --no-prettierrc
- --no-pypi
- --repo-name=repo-maintenance
- --repo-title=ComPWA Repository Maintenance
- --repo-name=policy
- --repo-title=ComPWA repository policy

- id: repoma-self-check
name: repoma-self-check
entry: repoma-self-check
- id: self-check
name: self-check
entry: self-check
language: python
files: ^\.pre\-commit\-(config|hooks)\.yaml$

Expand Down
10 changes: 5 additions & 5 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,11 @@
".github/workflows/cd.yml": true,
".github/workflows/ci.yml": true,
".taplo.toml": true,
"src/repoma/.github/workflows/clean-caches.yml": true,
"src/repoma/.github/workflows/pr-linting.yml": true,
"src/repoma/.github/workflows/release-drafter.yml": true,
"src/repoma/.template/.gitpod.yml": true,
"src/repoma/.template/.prettierrc": true
"src/compwa_policy/.github/workflows/clean-caches.yml": true,
"src/compwa_policy/.github/workflows/pr-linting.yml": true,
"src/compwa_policy/.github/workflows/release-drafter.yml": true,
"src/compwa_policy/.template/.gitpod.yml": true,
"src/compwa_policy/.template/.prettierrc": true
},
"yaml.schemas": {
"https://citation-file-format.github.io/1.2.0/schema.json": "CITATION.cff",
Expand Down
16 changes: 6 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,23 @@
# Repository maintenance
# ComPWA repository policy

[![BSD 3-Clause license](https://img.shields.io/badge/License-BSD_3--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)
[![Spelling checked](https://img.shields.io/badge/cspell-checked-brightgreen.svg)](https://github.com/streetsidesoftware/cspell/tree/master/packages/cspell)
[![GitPod](https://img.shields.io/badge/gitpod-open-blue?logo=gitpod)](https://gitpod.io/#https://github.com/ComPWA/repo-maintenance)
[![GitPod](https://img.shields.io/badge/gitpod-open-blue?logo=gitpod)](https://gitpod.io/#https://github.com/ComPWA/policy)
[![pytest](https://github.com/ComPWA/qrules/workflows/pytest/badge.svg)](https://github.com/ComPWA/qrules/actions?query=branch%3Amain+workflow%3Apytest)
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/ComPWA/repo-maintenance/main.svg)](https://results.pre-commit.ci/latest/github/ComPWA/repo-maintenance/main)
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/ComPWA/policy/main.svg)](https://results.pre-commit.ci/latest/github/ComPWA/policy/main)
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)

This repository is to standardize the developer environment of Python packages by the
[ComPWA organization](https://github.com/ComPWA). The maintenance is performed through
[pre-commit](https://pre-commit.com).

See also the [develop](https://compwa-org.readthedocs.io/en/stable/develop.html) page.
This repository sets the policies for developer environment in repositories if the [ComPWA organization](https://github.com/ComPWA) (See our [Help developing](https://compwa-org.readthedocs.io/en/stable/develop.html) page). The policies are automatically enforced through [pre-commit](https://pre-commit.com).

## Usage

Add a `.pre-commit-config.yaml` file to your repository with the following content:

```yaml
repos:
- repo: https://github.com/ComPWA/repo-maintenance
- repo: https://github.com/ComPWA/policy
rev: ""
hooks:
- id: check-dev-files
Expand All @@ -34,7 +30,7 @@ repos:
then run
```shell
pre-commit autoupdate --repo=https://github.com/ComPWA/repo-maintenance
pre-commit autoupdate --repo=https://github.com/ComPWA/policy
```

This example lists [all available hooks](./.pre-commit-hooks.yaml) (listed here as `id`s) ― you can remove some of them.
6 changes: 3 additions & 3 deletions docs/check-dev-files.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The `check-dev-files` hook can also be used as a **cookie cutter** for new repos

```yaml
repos:
- repo: https://github.com/ComPWA/repo-maintenance
- repo: https://github.com/ComPWA/policy
rev: ""
hooks:
- id: check-dev-files
Expand All @@ -17,7 +17,7 @@ repos:
and running
```shell
pre-commit autoupdate --repo=https://github.com/ComPWA/repo-maintenance
pre-commit autoupdate --repo=https://github.com/ComPWA/policy
pre-commit run check-dev-files -a
```

Expand All @@ -28,7 +28,7 @@ For more implementation details of this hook, check the {mod}`.check_dev_files`
The `check-dev-files` hook can be configured with by adding any of the following flags to the [`args`](https://pre-commit.com/#config-args) key in your `.pre-commit-config.yaml` file.

```{argparse}
:module: repoma.check_dev_files
:module: compwa_policy.check_dev_files
:func: _create_argparse
:prog: check-dev-files
```
15 changes: 8 additions & 7 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
from sphinx_api_relink.helpers import get_package_version

ORGANIZATION = "ComPWA"
REPO_NAME = "repo-maintenance"
PACKAGE_NAME = "repoma"
REPO_NAME = "policy"
REPO_TITLE = "ComPWA repository policy"
PACKAGE_NAME = "compwa_policy"

api_github_repo = f"{ORGANIZATION}/{REPO_NAME}"
api_target_substitutions: dict[str, str | tuple[str, str]] = {
Expand Down Expand Up @@ -54,15 +55,15 @@
html_static_path = ["_static"]
html_theme = "sphinx_book_theme"
html_theme_options = {
"logo": {"text": REPO_NAME},
"logo": {"text": "ComPWA policy"},
"repository_url": f"https://github.com/{ORGANIZATION}/{REPO_NAME}",
"repository_branch": "main",
"path_to_docs": "docs",
"use_repository_button": True,
"show_navbar_depth": 2,
"show_toc_level": 2,
}
html_title = REPO_NAME
html_title = REPO_TITLE
intersphinx_mapping = {
"attrs": ("https://www.attrs.org/en/stable", None),
"nbformat": ("https://nbformat.readthedocs.io/en/stable", None),
Expand All @@ -81,6 +82,6 @@
]
nitpicky = True
primary_domain = "py"
project = REPO_NAME
release = get_package_version(REPO_NAME)
version = get_package_version(REPO_NAME)
project = PACKAGE_NAME
release = get_package_version(PACKAGE_NAME)
version = get_package_version(PACKAGE_NAME)
16 changes: 8 additions & 8 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# ComPWA repo maintenance!
# ComPWA repository policy

:::{title} Welcome
:::

This package standardizes and synchronizes the developer environment of repositories by the [ComPWA organization](https://github.com/ComPWA). The maintenance is performed through [pre-commit](https://pre-commit.com) with the use of a number of pre-commit hooks as defined by [`.pre-commit-hooks.yaml`](../.pre-commit-hooks.yaml). The [`check-dev-files`](./check-dev-files.md) in particular can be used as a **cookie cutter** for new repositories.
This repository sets policies for [repositories of the ComPWA organization](https://github.com/orgs/ComPWA/repositories). The policies are enforced through [pre-commit](https://pre-commit.com) with the use of a number of pre-commit hooks as defined by [`.pre-commit-hooks.yaml`](../.pre-commit-hooks.yaml). The [`check-dev-files`](./check-dev-files.md) in particular can be used as a **cookie cutter** for new repositories.

## Usage

Add a [`.pre-commit-config.yaml`](https://pre-commit.com/index.html#adding-pre-commit-plugins-to-your-project) file to your repository and list which hooks you want to use:

```yaml
repos:
- repo: https://github.com/ComPWA/repo-maintenance
- repo: https://github.com/ComPWA/policy
rev: ""
hooks:
- id: check-dev-files
Expand All @@ -28,11 +28,11 @@ and install and activate [`pre-commit`](https://pre-commit.com/#install) as foll

```shell
pip install pre-commit
pre-commit autoupdate --repo=https://github.com/ComPWA/repo-maintenance
pre-commit autoupdate --repo=https://github.com/ComPWA/policy
pre-commit install
```

The `repo-maintenance` repository provides the following hooks:
The **ComPWA/policy** repository provides the following hooks:

- [`check-dev-files`](./check-dev-files.md)
- {mod}`colab-toc-visible <.colab_toc_visible>`
Expand All @@ -44,8 +44,8 @@ The `repo-maintenance` repository provides the following hooks:
```{toctree}
:hidden:
check-dev-files
API <api/repoma>
Changelog <https://github.com/ComPWA/repoma/releases>
Upcoming features <https://github.com/ComPWA/repoma/milestones?direction=asc&sort=title&state=open>
API <api/compwa_policy>
Changelog <https://github.com/ComPWA/policy/releases>
Upcoming features <https://github.com/ComPWA/policy/milestones?direction=asc&sort=title&state=open>
Help developing <https://compwa-org.rtfd.io/en/stable/develop.html>
```
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: repo-maintenance
name: compwa-policy
channels:
- defaults
dependencies:
Expand Down
42 changes: 21 additions & 21 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ description = "Pre-commit hooks that ensure that ComPWA repositories have a simi
dynamic = ["version"]
license = {text = "BSD 3-Clause License"}
maintainers = [{email = "compwa-admin@ep1.rub.de"}]
name = "repo-maintenance"
name = "compwa-policy"
requires-python = ">=3.7"

[project.optional-dependencies]
dev = [
"compwa-policy[doc]",
"compwa-policy[sty]",
"compwa-policy[test]",
"labels",
"repo-maintenance[doc]",
"repo-maintenance[sty]",
"repo-maintenance[test]",
"sphinx-autobuild",
"tox >=1.9", # for skip_install, use_develop
]
Expand All @@ -63,8 +63,8 @@ format = [
"black",
]
lint = [
"compwa-policy[mypy]",
"radon",
"repo-maintenance[mypy]",
"ruff",
]
mypy = [
Expand All @@ -74,10 +74,10 @@ mypy = [
"types-toml",
]
sty = [
"compwa-policy[format]",
"compwa-policy[lint]",
"compwa-policy[test]", # for pytest type hints
"pre-commit >=1.4.0",
"repo-maintenance[format]",
"repo-maintenance[lint]",
"repo-maintenance[test]", # for pytest type hints
]
test = [
"pytest",
Expand All @@ -90,25 +90,25 @@ content-type = "text/markdown"
file = "README.md"

[project.scripts]
check-dev-files = "repoma.check_dev_files:main"
colab-toc-visible = "repoma.colab_toc_visible:main"
fix-nbformat-version = "repoma.fix_nbformat_version:main"
format-setup-cfg = "repoma.format_setup_cfg:main"
pin-nb-requirements = "repoma.pin_nb_requirements:main"
repoma-self-check = "repoma.self_check:main"
set-nb-cells = "repoma.set_nb_cells:main"
check-dev-files = "compwa_policy.check_dev_files:main"
colab-toc-visible = "compwa_policy.colab_toc_visible:main"
fix-nbformat-version = "compwa_policy.fix_nbformat_version:main"
format-setup-cfg = "compwa_policy.format_setup_cfg:main"
pin-nb-requirements = "compwa_policy.pin_nb_requirements:main"
self-check = "compwa_policy.self_check:main"
set-nb-cells = "compwa_policy.set_nb_cells:main"

[project.urls]
Source = "https://github.com/ComPWA/repo-maintenance"
Tracker = "https://github.com/ComPWA/repo-maintenance/issues"
Source = "https://github.com/ComPWA/policy"
Tracker = "https://github.com/ComPWA/policy/issues"

[tool.setuptools]
include-package-data = false
license-files = ["LICENSE"]
package-dir = {"" = "src"}

[tool.setuptools.package-data]
repoma = [
compwa_policy = [
".github/*",
".github/**/*",
".template/*",
Expand All @@ -121,7 +121,7 @@ namespaces = false
where = ["src"]

[tool.setuptools_scm]
write_to = "src/repoma/version.py"
write_to = "src/compwa_policy/version.py"

[tool.black]
exclude = '''
Expand Down Expand Up @@ -155,7 +155,7 @@ source = ["src"]
[tool.mypy]
disallow_incomplete_defs = true
disallow_untyped_defs = true
exclude = '.*/repoma/__init__\.py'
exclude = '.*/compwa_policy/__init__\.py'
files = ["**/*.py"]
show_error_codes = true
warn_unused_configs = true
Expand Down Expand Up @@ -294,7 +294,7 @@ target-version = "py37"
task-tags = ["cspell"]

[tool.ruff.isort]
known-first-party = ["repoma"]
known-first-party = ["compwa_policy"]

[tool.ruff.per-file-ignores]
"docs/*" = [
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@
"mypy",
"pytest",
"PYTHONHASHSEED",
"repoma",
"toctree",
"Zenodo"
],
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
from argparse import ArgumentParser
from typing import TYPE_CHECKING, Any, Sequence

from repoma.check_dev_files.deprecated import remove_deprecated_tools
from repoma.utilities.executor import Executor
from compwa_policy.check_dev_files.deprecated import remove_deprecated_tools
from compwa_policy.utilities.executor import Executor

from . import (
black,
Expand Down Expand Up @@ -39,7 +39,7 @@
)

if TYPE_CHECKING:
from repoma.utilities.project_info import PythonVersion
from compwa_policy.utilities.project_info import PythonVersion


def main(argv: Sequence[str] | None = None) -> int:
Expand Down
Loading

0 comments on commit edf22f6

Please sign in to comment.