File tree Expand file tree Collapse file tree 4 files changed +89
-1
lines changed Expand file tree Collapse file tree 4 files changed +89
-1
lines changed Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change @@ -31,10 +31,13 @@ Here is an example of how to use the `group` decorator:
3131
3232``` python
3333from click_with_aliasing import group
34+ from .my_command import my_command
3435
3536@group (name = " my_group" , aliases = [' mg' ])
3637def cli ():
3738 """ My Click group """
39+
40+ cli.add_command(my_command)
3841```
3942
4043This 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.
Original file line number Diff line number Diff line change 11[project ]
22name = " click_with_aliasing"
3- version = " 1.0.0 "
3+ version = " 1.0.1 "
44description = " Easily add aliases to your Click groups and commands."
55authors = [
66 { name = " Marcus Fredriksson" , email = " marcus@marcusfredriksson.com" },
@@ -17,6 +17,7 @@ dependencies = ["click>=8.1.8"]
1717keywords = [" click" , " alias" , " group" , " command" ]
1818
1919[project .optional-dependencies ]
20+ build = [" build" , " twine" ]
2021dev = [
2122 " black>=24.10.0" ,
2223 " pytest>=8.3.4" ,
@@ -44,3 +45,4 @@ line_length = 80
4445[project .urls ]
4546Homepage = " https://github.com/marcusfrdk/click-with-aliasing"
4647Issues = " https://github.com/marcusfrdk/click-with-aliasing/issues"
48+ Repository = " https://github.com/marcusfrdk/click-with-aliasing"
You can’t perform that action at this time.
0 commit comments