Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 23 additions & 8 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,36 +12,51 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install virtualenv from poetry
uses: 20c/workflows/poetry@v1
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install dependencies
run: uv sync --all-extras
- name: Run linters
run: |
poetry run black --check .
uv run ruff check .
uv run ruff format --check .

test:
needs: linting
strategy:
fail-fast: false
matrix:
os: [ "ubuntu-latest", "macos-latest" ]
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ]
python-version: [ "3.9", "3.10", "3.11", "3.12" ]
exclude:
- os: "macos-latest"
runs-on: ${{ matrix.os }}
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Install virtualenv from poetry
uses: 20c/workflows/poetry@v1
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: uv sync --all-extras
- name: Configure git
run: |
git config --global user.email "ci@20c.com"
git config --global user.name "CI Runner"
- name: Run tests
run: |
poetry run tox
poetry run coverage report
uv run pytest --cov=src --cov-report=xml --cov-report=term-missing
# upload coverage stats
- name: Upload coverage
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
43 changes: 14 additions & 29 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,33 +9,18 @@ repos:
hooks:
- id: check-yaml
- id: trailing-whitespace
repos:
- repo: local
hooks:
- id: system
name: isort
entry: poetry run isort .
language: system
pass_filenames: false
- repo: local
hooks:
- id: pyupgrade
name: pyupgrade
entry: poetry run pyupgrade --py38-plus
language: python
types: [python]
pass_filenames: true
- repo: local
hooks:
- id: system
name: Black
entry: poetry run black .
language: system
pass_filenames: false
- repo: local
- id: end-of-file-fixer
- id: check-added-large-files
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.4
hooks:
- id: system
name: flake8
entry: poetry run flake8 .
language: system
pass_filenames: false
- id: ruff
args: [--fix]
- id: ruff-format
# Temporarily disabled until type annotations are added
# - repo: https://github.com/pre-commit/mirrors-mypy
# rev: v1.8.0
# hooks:
# - id: mypy
# additional_dependencies: [types-PyYAML, pydantic>=2.3.0]
# args: [--ignore-missing-imports]
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,4 @@
## 0.2.0
### Changed
- pypi plugin: config `repository` changed to `pypi_repository` (#2)
- pypi plugin: config `target` changed to `repository` (#2)
- pypi plugin: config `target` changed to `repository` (#2)
17 changes: 13 additions & 4 deletions CHANGELOG.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
Unreleased:
added: []
fixed: []
changed: []
added:
- py.typed marker file for type checking support
fixed:
- replaced deprecated pkg_resources with importlib.metadata
changed:
- migrated from Poetry to modern pyproject.toml with hatchling build backend
- migrated from black/isort/flake8/pyupgrade to ruff for linting and formatting
- updated CI workflows to use uv instead of poetry/tox
- updated pre-commit hooks to use ruff and mypy
- upgraded all dependencies to latest versions
deprecated: []
removed: []
removed:
- python 3.8 support (EOL)
- poetry.lock (replaced with uv.lock)
security: []
1.2.0:
added:
Expand Down
2 changes: 1 addition & 1 deletion Ctl/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.2.0
1.2.0
1 change: 0 additions & 1 deletion Ctl/requirements-test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,3 @@ pytest>=6,<7
twine>=2,<3
pipenv-setup>=2,<4
pyyaml>=4,<6

2 changes: 0 additions & 2 deletions docs/config_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,3 @@ pip install tmpl jinja2
| ctx.user_home | path to user home directory |
| input.plugin | input parameters for the plugin that's being executed |
| plugin.[plugin_name] | variables exposed by a plugins `expose_vars` function |


1 change: 0 additions & 1 deletion docs/events.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,3 @@ event_handler = Events()
event_handler.on("my_event", lambda *a, **kw: do_something(*a, **kw))
event.handler.trigger("my_event", "some arg", test="some kwarg")
```

4 changes: 2 additions & 2 deletions docs/git.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ ctl git list_change_requests --checkout-path $REPO_PATH
ctl git rename_change_request prep-release main "Updated PR title" --checkout-path $REPO_PATH

# merge release
# ctl git merge_release <source> <target>
# ctl git merge_release <source> <target>
ctl git merge_release prep-release main --checkout-path $REPO_PATH
```

Expand All @@ -29,4 +29,4 @@ ctl git merge_release prep-release main --checkout-path $REPO_PATH
- api
- read_api
- read_repository
- write_repository
- write_repository
8 changes: 4 additions & 4 deletions docs/plugin_permissions.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ This allows for very granular namespaced based permissions
| `ctl.my_plugin` | `ctl.other_plugin.do_something` | no |
| `ctl.my_plugin.do_this` | `ctl.other_plugin.do_something` | no |

## Control permission requirements
## Control permission requirements

By default permission requirement for any plugin operation is `r` (unless
By default permission requirement for any plugin operation is `r` (unless
specifically overwritten in the `expose` decorator that's exposing the operation)

You can specify different permission requirements in the config
Expand Down Expand Up @@ -60,7 +60,7 @@ You can specify different permission requirements in the config

## Development

### Expose plugin operations
### Expose plugin operations

You can use the `expose` dectorator from `ctl.auth` to expose methods on a plugin as an operation to be available on the ctl cli.

Expand All @@ -71,7 +71,7 @@ from ctl.auth import expose

class VersionPlugion(ExecutablePlugin):
...

@expose("ctl.{plugin_name}.tag")
def tag(self, version, repo, **kwargs):
...
Expand Down
1 change: 0 additions & 1 deletion docs/plugins/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,3 @@ ctl changelog release 1.0.0
#### release

{pymdgen-cmd:ctl --home=docs changelog release --help}

2 changes: 1 addition & 1 deletion docs/plugins/copy.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ You can use the `ignore` config to ignore certain file types or paths

## Example: process files based on pattern

You can use the `process` config to process files after they have been copied.
You can use the `process` config to process files after they have been copied.

We can defer to other plugins for such actions.

Expand Down
2 changes: 1 addition & 1 deletion docs/plugins/venv.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Venv Plugin

Manages a python virtualenv
Manages a python virtualenv

## Requirements

Expand Down
17 changes: 17 additions & 0 deletions docs/plugins/version.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,15 @@ If you're using the version plugin for the first time on a repo and a `Ctl/VERSI
ctl version tag 1.0.0 --init
```

You may also choose to add a prefix to the tag

```sh
# update Ctl/VERSION to 1.1.0
# tag v1.1.0
# push tag
ctl version tag 1.0.0 prefix v
```

You may also chose to bump a semantic version

```sh
Expand All @@ -41,6 +50,14 @@ You may also chose to bump a semantic version
ctl version bump minor
```

You may also choose to bump but not tag in git

```sh
# update Ctl/VERSION to 1.1.0
# skip creating git tag
ctl version bump --no-git-tag
```

### Use existing repository checkout

Instead of configuring and specifying a git type plugin to use
Expand Down
2 changes: 1 addition & 1 deletion examples/plugins/changelog/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@

## 1.0.0
### added
- initial release
- initial release
2 changes: 2 additions & 0 deletions mise.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[tools]
gh = "latest"
Loading