Skip to content

Commit 1ff0855

Browse files
refactor: rename package to python-cli-template
1 parent 26ff4e7 commit 1ff0855

File tree

7 files changed

+47
-53
lines changed

7 files changed

+47
-53
lines changed

.github/CONTRIBUTING.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ Pull requests are welcome! By participating in this project, you agree to abide
44

55
## Fork
66

7-
[Fork](https://github.com/remarkablemark/python_cli_template/fork) and then clone the repository:
7+
[Fork](https://github.com/remarkablemark/python-cli-template/fork) and then clone the repository:
88

99
```sh
1010
# replace <USER> with your username
11-
git clone git@github.com:<USER>/python_cli_template.git
11+
git clone git@github.com:<USER>/python-cli-template.git
1212
```
1313

1414
```sh
15-
cd python_cli_template
15+
cd python-cli-template
1616
```
1717

1818
## Install
@@ -62,13 +62,13 @@ Write a commit message that follows the [Conventional Commits](https://www.conve
6262
- **ci**: Updates configuration files and scripts for continuous integration
6363
- **docs**: Documentation only changes
6464

65-
Push to your fork and create a [pull request](https://github.com/remarkablemark/python_cli_template/compare/).
65+
Push to your fork and create a [pull request](https://github.com/remarkablemark/python-cli-template/compare/).
6666

6767
At this point, wait for us to review your pull request. We'll try to review pull requests within 1-3 business days. We may suggest changes, improvements, and/or alternatives.
6868

6969
Things that will improve the chance that your pull request will be accepted:
7070

71-
- [ ] Write tests that pass [CI](https://github.com/remarkablemark/python_cli_template/actions/workflows/test.yml).
71+
- [ ] Write tests that pass [CI](https://github.com/remarkablemark/python-cli-template/actions/workflows/test.yml).
7272
- [ ] Write solid documentation.
7373
- [ ] Write a good [commit message](https://github.com/angular/angular/blob/main/CONTRIBUTING.md#commit).
7474

@@ -111,7 +111,7 @@ pipx install . --force
111111
Test the command:
112112

113113
```sh
114-
python_cli_template --help
114+
python-cli-template --help
115115
```
116116

117117
## Lint
@@ -169,13 +169,13 @@ twine upload --repository testpypi dist/*
169169
Install the package:
170170

171171
```sh
172-
pip install --index-url https://test.pypi.org/simple/ --no-deps python_cli_template
172+
pip install --index-url https://test.pypi.org/simple/ --no-deps python-cli-template
173173
```
174174

175175
Bundle the package with [PyInstaller](https://pyinstaller.org/):
176176

177177
```sh
178-
pyinstaller src/python_cli_template/cli.py --name python_cli_template
178+
pyinstaller src/python-cli-template/cli.py --name python-cli-template
179179
```
180180

181181
## Docs

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
uses: actions/setup-python@v6
1616
with:
1717
cache: pip
18-
python-version: 3
18+
python-version-file: pyproject.toml
1919

2020
- name: Install dependencies
2121
run: pip install -e .[docs]

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
uses: actions/setup-python@v6
1616
with:
1717
cache: pip
18-
python-version: 3
18+
python-version-file: pyproject.toml
1919

2020
- name: Install dependencies
2121
run: pip install -e .[lint]

.github/workflows/release.yml

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
id-token: write
3232
environment:
3333
name: pypi
34-
url: https://pypi.org/p/python_cli_template
34+
url: https://pypi.org/p/python-cli-template
3535

3636
steps:
3737
- name: Checkout repository
@@ -40,15 +40,15 @@ jobs:
4040
- name: Use Python
4141
uses: actions/setup-python@v6
4242
with:
43-
python-version: 3
43+
python-version-file: pyproject.toml
4444

4545
- name: Install build
4646
run: python -m pip install build
4747

4848
- name: Build package
4949
run: python -m build
5050

51-
- name: Publish package to PyPI
51+
- name: Publish to PyPI
5252
uses: pypa/gh-action-pypi-publish@release/v1
5353
with:
5454
password: ${{ secrets.PYPI_API_TOKEN }}
@@ -70,33 +70,27 @@ jobs:
7070
- name: Use Python
7171
uses: actions/setup-python@v6
7272
with:
73-
python-version: 3
73+
python-version-file: pyproject.toml
7474

7575
- name: Install dependencies
7676
run: pip install -e '.[build]'
7777

7878
- name: Build executable
79-
run: pyinstaller src/python_cli_template/cli.py --name python_cli_template --onefile --clean
79+
run: pyinstaller src/python_cli_template/cli.py --name python-cli-template --onefile --clean
8080

8181
- name: Compress executable
82-
if: matrix.os != 'windows-latest'
83-
working-directory: dist
84-
run: zip archive.zip python_cli_template
85-
86-
- name: Compress executable
87-
if: matrix.os == 'windows-latest'
88-
working-directory: dist
89-
run: Compress-Archive -Path python_cli_template.exe -Destination archive.zip
82+
shell: bash
83+
run: |
84+
if [[ $RUNNER_OS == 'Windows' ]]; then
85+
7z a -r archive.zip dist
86+
else
87+
zip -r archive.zip dist
88+
fi
9089
9190
- name: Upload Release Artifact
9291
shell: bash
93-
working-directory: dist
9492
run: |
95-
os=${{ matrix.os }}
96-
filename=${os%-*}.zip
97-
if [[ $filename == 'ubuntu'* ]]; then
98-
filename=linux.zip
99-
fi
93+
filename=$(echo $RUNNER_OS | tr '[:upper:]' '[:lower:]').zip
10094
mv archive.zip $filename
10195
gh release upload ${{ needs.release.outputs.tag_name }} $filename
10296
env:

.github/workflows/test.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
uses: actions/setup-python@v6
1616
with:
1717
cache: pip
18-
python-version: 3
18+
python-version-file: pyproject.toml
1919

2020
- name: Install dependencies
2121
run: pip install -e .[test]
@@ -41,7 +41,7 @@ jobs:
4141
uses: actions/setup-python@v6
4242
with:
4343
cache: pip
44-
python-version: 3
44+
python-version-file: pyproject.toml
4545

4646
- name: Install package
4747
run: pipx install .
@@ -50,19 +50,19 @@ jobs:
5050
run: |
5151
version=$(grep version src/python_cli_template/__init__.py | cut -d'"' -f 2)
5252
set -e
53-
[[ $(python_cli_template --version) == $version ]]
54-
[[ $(python_cli_template -v) == $version ]]
53+
[[ $(python-cli-template --version) == $version ]]
54+
[[ $(python-cli-template -v) == $version ]]
5555
5656
- name: Get help
57-
run: python_cli_template --help
57+
run: python-cli-template --help
5858

5959
integration:
6060
runs-on: ubuntu-latest
6161
strategy:
6262
matrix:
6363
command:
64-
- python_cli_template
65-
- python_cli_template --name test
64+
- python-cli-template
65+
- python-cli-template --name test
6666
steps:
6767
- name: Checkout repository
6868
uses: actions/checkout@v6
@@ -71,7 +71,7 @@ jobs:
7171
uses: actions/setup-python@v6
7272
with:
7373
cache: pip
74-
python-version: 3
74+
python-version-file: pyproject.toml
7575

7676
- name: Install package
7777
run: pipx install .

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# python_cli_template
1+
# python-cli-template
22

3-
[![PyPI version](https://img.shields.io/pypi/v/python_cli_template)](https://pypi.org/project/python_cli_template/)
4-
[![codecov](https://codecov.io/gh/remarkablemark/python_cli_template/graph/badge.svg?token=l6pg0nf9aJ)](https://codecov.io/gh/remarkablemark/python_cli_template)
5-
[![lint](https://github.com/remarkablemark/python_cli_template/actions/workflows/lint.yml/badge.svg)](https://github.com/remarkablemark/python_cli_template/actions/workflows/lint.yml)
3+
[![PyPI version](https://img.shields.io/pypi/v/python-cli-template)](https://pypi.org/project/python-cli-template/)
4+
[![codecov](https://codecov.io/gh/remarkablemark/python-cli-template/graph/badge.svg?token=l6pg0nf9aJ)](https://codecov.io/gh/remarkablemark/python-cli-template)
5+
[![lint](https://github.com/remarkablemark/python-cli-template/actions/workflows/lint.yml/badge.svg)](https://github.com/remarkablemark/python-cli-template/actions/workflows/lint.yml)
66

77
🐍 Python CLI Template
88

@@ -11,7 +11,7 @@
1111
Greet a name:
1212

1313
```sh
14-
pipx run python_cli_template --name world
14+
pipx run python-cli-template --name world
1515
```
1616

1717
## Prerequisites
@@ -24,29 +24,29 @@ pipx run python_cli_template --name world
2424
Install the CLI:
2525

2626
```sh
27-
pipx install python_cli_template
27+
pipx install python-cli-template
2828
```
2929

3030
### `--name`
3131

3232
**Optional**: Name to greet. Defaults to `World`.
3333

3434
```sh
35-
python_cli_template --name Alex
35+
python-cli-template --name Alex
3636
```
3737

3838
### `--version`
3939

4040
Show the program's version number and exit:
4141

4242
```sh
43-
python_cli_template --version # python_cli_template -v
43+
python-cli-template --version # python-cli-template -v
4444
```
4545

4646
Show the help message and exit:
4747

4848
```sh
49-
python_cli_template --help # python_cli_template -h
49+
python-cli-template --help # python-cli-template -h
5050
```
5151

5252
## Script
@@ -66,7 +66,7 @@ source .venv/bin/activate
6666
Install the package:
6767

6868
```sh
69-
pip install python_cli_template
69+
pip install python-cli-template
7070
```
7171

7272
Greet a name:
@@ -86,4 +86,4 @@ python script.py
8686

8787
## License
8888

89-
[MIT](https://github.com/remarkablemark/python_cli_template/blob/master/LICENSE)
89+
[MIT](https://github.com/remarkablemark/python-cli-template/blob/master/LICENSE)

pyproject.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[project]
2-
name = "python_cli_template"
2+
name = "python-cli-template"
33
version = "0.0.0"
44
authors = [
55
{ name="Mark", email="mark@remarkablemark.org" },
@@ -16,10 +16,10 @@ license-files = ["LICEN[CS]E*"]
1616
dependencies = []
1717

1818
[project.scripts]
19-
python_cli_template = "python_cli_template.cli:main"
19+
python-cli-template = "python_cli_template.cli:main"
2020

2121
[project.entry-points."pipx.run"]
22-
python_cli_template = "python_cli_template.cli:main"
22+
python-cli-template = "python_cli_template.cli:main"
2323

2424
[project.optional-dependencies]
2525
build = [
@@ -42,8 +42,8 @@ test = [
4242
]
4343

4444
[project.urls]
45-
Homepage = "https://github.com/remarkablemark/python_cli_template"
46-
Issues = "https://github.com/remarkablemark/python_cli_template/issues"
45+
Homepage = "https://github.com/remarkablemark/python-cli-template"
46+
Issues = "https://github.com/remarkablemark/python-cli-template/issues"
4747

4848
[tool.black]
4949
fast = true

0 commit comments

Comments
 (0)