Skip to content

Commit 9a46914

Browse files
committed
Added Github workflows, updated README and added repository urland bumped version to 1.0.1
1 parent 7ef5d5c commit 9a46914

File tree

4 files changed

+89
-1
lines changed

4 files changed

+89
-1
lines changed

.github/workflows/publish.yml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Publish to PyPI
2+
on:
3+
push:
4+
tags:
5+
- "*.*.*"
6+
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
- name: Set up Python
13+
uses: actions/setup-python@v5
14+
with:
15+
python-version: "3.11"
16+
17+
- name: Install dependencies
18+
run: |
19+
python -m pip install --upgrade pip
20+
python -m pip install .[build]
21+
22+
- name: Build package
23+
run: python -m build
24+
25+
- name: Test publish package
26+
uses: pypa/gh-action-pypi-publish@release/v1
27+
with:
28+
user: __token__
29+
password: ${{ secrets.TESTPYPI_API_TOKEN }}
30+
repository-url: https://test.pypi.org/legacy/
31+
32+
- name: Publish package
33+
uses: pypa/gh-action-pypi-publish@release/v1
34+
with:
35+
user: __token__
36+
password: ${{ secrets.PYPI_API_TOKEN }}
37+
38+
- name: Create GitHub Release
39+
env:
40+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41+
run: |
42+
gh release create ${{ github.ref_name }} ./dist/* --generate-notes

.github/workflows/test.yml

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Run Tests
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
workflow_call:
9+
workflow_dispatch:
10+
11+
jobs:
12+
testing:
13+
runs-on: ubuntu-latest
14+
strategy:
15+
matrix:
16+
python-version: ["3.11", "3.12", "3.13"]
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- name: Set up Python ${{ matrix.python-version }}
22+
uses: actions/setup-python@v5
23+
with:
24+
python-version: ${{ matrix.python-version }}
25+
26+
- name: Cache pip
27+
uses: actions/cache@v3
28+
with:
29+
path: ~/.cache/pip
30+
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
31+
restore-keys: |
32+
${{ runner.os }}-pip-
33+
34+
- name: Install dependencies
35+
run: |
36+
python -m pip install --upgrade pip
37+
python -m pip install .[dev]
38+
39+
- name: Run Pytest
40+
run: |
41+
pytest --verbose

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,13 @@ Here is an example of how to use the `group` decorator:
3131

3232
```python
3333
from click_with_aliasing import group
34+
from .my_command import my_command
3435

3536
@group(name="my_group", aliases=['mg'])
3637
def cli():
3738
""" My Click group """
39+
40+
cli.add_command(my_command)
3841
```
3942

4043
This group works exactly like a normal `click.group`, but while using the CLI, you can use either `my_group` or `mg` to call the group.

pyproject.toml

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "click_with_aliasing"
3-
version = "1.0.0"
3+
version = "1.0.1"
44
description = "Easily add aliases to your Click groups and commands."
55
authors = [
66
{ name = "Marcus Fredriksson", email = "[email protected]" },
@@ -17,6 +17,7 @@ dependencies = ["click>=8.1.8"]
1717
keywords = ["click", "alias", "group", "command"]
1818

1919
[project.optional-dependencies]
20+
build = ["build", "twine"]
2021
dev = [
2122
"black>=24.10.0",
2223
"pytest>=8.3.4",
@@ -44,3 +45,4 @@ line_length = 80
4445
[project.urls]
4546
Homepage = "https://github.com/marcusfrdk/click-with-aliasing"
4647
Issues = "https://github.com/marcusfrdk/click-with-aliasing/issues"
48+
Repository = "https://github.com/marcusfrdk/click-with-aliasing"

0 commit comments

Comments
 (0)