Skip to content

Commit 4c89c0c

Browse files
committed
Closes #25 , Closes #26
1 parent 438e9f8 commit 4c89c0c

12 files changed

Lines changed: 845 additions & 98 deletions

File tree

.github/workflows/release.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: read
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
16+
with:
17+
persist-credentials: false
18+
- name: Install uv
19+
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
20+
with:
21+
version: "0.11.6"
22+
enable-cache: false
23+
- name: Install Python
24+
run: uv python install
25+
- name: Build package
26+
run: uv build
27+
- name: Upload dist
28+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
29+
with:
30+
name: dist
31+
path: dist/
32+
33+
publish:
34+
needs: build
35+
runs-on: ubuntu-latest
36+
environment:
37+
name: release
38+
url: https://pypi.org/p/glone
39+
permissions:
40+
contents: read
41+
id-token: write
42+
steps:
43+
- name: Download dist
44+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
45+
with:
46+
name: dist
47+
path: dist/
48+
- name: Publish to PyPI
49+
uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0

.gitignore

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1+
# .mypy_cache/: https://mypy.readthedocs.io/en/stable/config_file.html#confval-cache_dir
12
# .ruff_cache/: https://docs.astral.sh/ruff/settings/#cache-dir
2-
# dist/: https://hatch.pypa.io/latest/config/build/#output-directory
3-
# .mypy_cache/: https://github.com/python/mypy/blob/v1.12.0/docs/source/config_file.rst#incremental-mode
43

54
__pycache__/
6-
.hatch/
75
.mypy_cache/
86
.ruff_cache/
7+
.venv/
98
dist/
109

1110
.DS_Store

.vscode/settings.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
{
22
"python.defaultInterpreterPath": "${workspaceFolder}/.hatch/glone/bin/python",
3-
"mypy-type-checker.importStrategy": "fromEnvironment"
3+
"mypy-type-checker.importStrategy": "fromEnvironment",
4+
5+
"files.readonlyInclude": {
6+
"LICENSE": true,
7+
"uv.lock": true
8+
}
49
}

NOTES.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@
5656
- https://www.python-httpx.org/advanced/resource-limits/: `max_keepalive_connections` is 20
5757
- https://github.com/lirantal/gh-cp
5858
- https://docs.github.com/en/rest/repos/contents?apiVersion=2026-03-10#download-a-repository-archive-zip
59+
- https://pydantic.dev/docs/validation/latest/integrations/dev-tools/mypy/
60+
- https://click.palletsprojects.com/en/stable/changes/
61+
- https://github.com/python-trio/trio/releases
62+
- https://pydantic.dev/docs/validation/latest/get-started/changelog/
5963

6064
## Snippets
6165

@@ -828,3 +832,21 @@ def main(token: str) -> None:
828832
click.echo(f"Output folder: {output_folder}")
829833
click.echo("Done!")
830834
```
835+
836+
### `.gitignore` file
837+
838+
```ignore
839+
# .ruff_cache/: https://docs.astral.sh/ruff/settings/#cache-dir
840+
# dist/: https://hatch.pypa.io/latest/config/build/#output-directory
841+
# .mypy_cache/: https://github.com/python/mypy/blob/v1.12.0/docs/source/config_file.rst#incremental-mode
842+
843+
__pycache__/
844+
.hatch/
845+
.mypy_cache/
846+
.ruff_cache/
847+
dist/
848+
849+
.DS_Store
850+
851+
repos.json
852+
```

README.md

Lines changed: 31 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,16 @@ A CLI to back up all your [GitHub](https://github.com/) repositories.
88

99
- [Source code](https://github.com/joaopalmeiro/glone)
1010
- [PyPI package](https://pypi.org/project/glone/)
11-
- [Snyk Advisor](https://snyk.io/advisor/python/glone)
11+
- [ClickPy](https://clickpy.clickhouse.com/dashboard/glone)
12+
- [ecosyte.ms](https://packages.ecosyste.ms/registries/pypi.org/packages/glone)
13+
- [Libraries.io](https://libraries.io/pypi/glone)
14+
- [Open Source Insights](https://deps.dev/pypi/glone)
15+
- [OSV](https://osv.dev/list?q=glone&ecosystem=PyPI)
16+
- [PePy](https://pepy.tech/projects/glone)
17+
- [PyPack Trends](https://pypacktrends.com/?packages=glone&time_range=allTime)
18+
- [PyPI Stats](https://pypistats.org/search/glone)
19+
- [Snyk](https://security.snyk.io/package/pip/glone)
20+
- [Socket](https://socket.dev/pypi/package/glone)
1221

1322
## Usage
1423

@@ -24,58 +33,54 @@ GITHUB_ACCESS_TOKEN="op://Development/glone/GITHUB_ACCESS_TOKEN" op run -- uvx g
2433

2534
## Development
2635

27-
Install [pyenv](https://github.com/pyenv/pyenv), [1Password](https://1password.com/downloads/), and [1Password CLI](https://developer.1password.com/docs/cli/get-started/) (if necessary).
36+
Install [zizmor](https://docs.zizmor.sh/installation/), [pinact](https://github.com/suzuki-shunsuke/pinact/blob/main/INSTALL.md), [1Password](https://1password.com/downloads/), and [1Password CLI](https://developer.1password.com/docs/cli/get-started/) (if necessary).
2837

29-
```bash
30-
pyenv install && pyenv versions
31-
```
38+
Install [uv](https://docs.astral.sh/uv/getting-started/installation/) (if necessary):
3239

3340
```bash
34-
pip install hatch==1.14.0 && hatch --version
41+
curl -LsSf https://astral.sh/uv/0.11.6/install.sh | sh
3542
```
3643

3744
```bash
38-
hatch config set dirs.env.virtual .hatch
45+
uv python install
3946
```
4047

4148
```bash
42-
hatch config show
49+
uv audit --verbose
4350
```
4451

4552
```bash
46-
hatch env create
53+
uv run glone --help
4754
```
4855

4956
```bash
50-
hatch status
57+
GITHUB_ACCESS_TOKEN="op://Development/glone/GITHUB_ACCESS_TOKEN" op run -- uv run glone
5158
```
5259

5360
```bash
54-
hatch env show
61+
uv run mypy
5562
```
5663

5764
```bash
58-
hatch dep show table
65+
uv run ruff format
5966
```
6067

6168
```bash
62-
hatch run pip list
69+
uv run ruff check --fix
6370
```
6471

6572
```bash
66-
hatch run glone --help
73+
uv build
6774
```
6875

69-
```bash
70-
hatch run glone
71-
```
76+
### GitHub Actions
7277

7378
```bash
74-
hatch run lint
79+
zizmor .
7580
```
7681

7782
```bash
78-
hatch run format
83+
pinact run -u --min-age 7
7984
```
8085

8186
### Get a GitHub token
@@ -88,32 +93,26 @@ hatch run format
8893

8994
## Deployment
9095

91-
```bash
92-
hatch version micro
93-
```
96+
- Create the `release` [GitHub Actions environment](https://github.com/joaopalmeiro/glone/settings/environments) (if necessary).
97+
- [Add a trusted publisher to an existing PyPI project](https://docs.pypi.org/trusted-publishers/adding-a-publisher/) or [create a new one with a trusted publisher](https://docs.pypi.org/trusted-publishers/creating-a-project-through-oidc/) (if necessary).
9498

9599
```bash
96-
hatch version minor
100+
uv version --bump patch
97101
```
98102

99103
```bash
100-
hatch version major
104+
uv version --bump minor
101105
```
102106

103107
```bash
104-
hatch build --clean
108+
uv version --bump major
105109
```
106110

107111
```bash
108-
echo "v$(hatch version)" | pbcopy
112+
echo "v$(uv version --short)" | pbcopy
109113
```
110114

111115
- Commit and push changes.
112116
- Create a tag on [GitHub Desktop](https://github.blog/2020-05-12-create-and-push-tags-in-the-latest-github-desktop-2-5-release/).
113-
- Check [GitHub](https://github.com/joaopalmeiro/glone/tags).
114-
115-
```bash
116-
hatch publish
117-
```
118-
117+
- Check GitHub: [Tags](https://github.com/joaopalmeiro/glone/tags) and [Actions](https://github.com/joaopalmeiro/glone/actions).
119118
- Check [PyPI](https://pypi.org/project/glone/).

mypy.ini

Lines changed: 38 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,32 +4,53 @@ plugins = pydantic.mypy
44
files = src/glone
55
python_version = 3.10
66

7-
# `Warning: --strict-concatenate is deprecated; use --extra-checks instead`:
8-
# - https://github.com/python/mypy/issues/16189
9-
follow_imports = normal
7+
allow_redefinition_new = True
8+
check_untyped_defs = True
109
disallow_any_generics = True
10+
disallow_any_unimported = True
11+
disallow_incomplete_defs = True
1112
disallow_subclassing_any = True
12-
disallow_untyped_defs = True
13-
check_untyped_defs = True
13+
disallow_untyped_calls = True
1414
disallow_untyped_decorators = True
15-
warn_redundant_casts = True
16-
warn_unused_ignores = True
15+
disallow_untyped_defs = True
16+
error_summary = True
17+
exclude_gitignore = True
18+
extra_checks = True
19+
follow_imports = normal
20+
local_partial_types = True
21+
no_implicit_reexport = True
22+
pretty = True
23+
show_column_numbers = True
24+
show_error_context = True
25+
strict_bytes = True
26+
strict_equality = True
27+
strict_equality_for_none = True
28+
warn_incomplete_stub = True
1729
warn_no_return = True
30+
warn_redundant_casts = True
1831
warn_return_any = True
1932
warn_unreachable = True
20-
strict_concatenate = True
21-
strict_equality = True
22-
show_error_context = True
23-
show_column_numbers = True
24-
pretty = True
25-
error_summary = True
26-
warn_incomplete_stub = True
27-
local_partial_types = True
33+
warn_unused_ignores = True
34+
35+
enable_error_code =
36+
deprecated,
37+
exhaustive-match,
38+
explicit-override,
39+
ignore-without-code,
40+
mutable-override,
41+
possibly-undefined,
42+
redundant-expr,
43+
redundant-self,
44+
truthy-bool,
45+
truthy-iterable,
46+
unimported-reveal,
47+
unused-awaitable
2848

2949
incremental = True
50+
sqlite_cache = True
3051
# "The warn_unused_configs flag may be useful to debug misspelled section names.":
31-
# - https://github.com/python/mypy/blob/v1.12.0/docs/source/config_file.rst#config-file-format
32-
# - https://github.com/python/mypy/blob/v1.12.0/docs/source/config_file.rst#miscellaneous
52+
# - https://github.com/python/mypy/blob/v1.20.1/docs/source/config_file.rst#config-file-format
53+
# - https://github.com/python/mypy/blob/v1.20.1/docs/source/config_file.rst#miscellaneous
3354
# incremental = False
3455
# warn_unused_configs = True
3556

pyproject.toml

Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
1-
[build-system]
2-
requires = ["hatchling==1.27.0"]
3-
build-backend = "hatchling.build"
4-
51
[project]
62
name = "glone"
7-
dynamic = ["version"]
3+
version = "0.3.0"
84
description = "A CLI to back up all your GitHub repositories."
95
readme = "README.md"
106
requires-python = ">=3.10"
@@ -16,7 +12,6 @@ classifiers = [
1612
"Intended Audience :: Developers",
1713
"Intended Audience :: Information Technology",
1814
"Intended Audience :: Science/Research",
19-
"License :: OSI Approved :: MIT License",
2015
"Natural Language :: English",
2116
"Operating System :: OS Independent",
2217
"Programming Language :: Python",
@@ -26,15 +21,18 @@ classifiers = [
2621
"Programming Language :: Python :: 3.11",
2722
"Programming Language :: Python :: 3.12",
2823
"Programming Language :: Python :: 3.13",
24+
"Programming Language :: Python :: 3.14",
25+
"Programming Language :: Python :: 3.15",
26+
"Programming Language :: Python :: Implementation",
2927
"Programming Language :: Python :: Implementation :: CPython",
3028
"Topic :: Utilities",
3129
]
3230
dependencies = [
33-
"click>=8.1.0",
34-
"httpx>=0.28.0",
31+
"click>=8.4.0",
32+
"httpx2>=2.2.0",
3533
"platformdirs>=4.0.0",
36-
"pydantic>=2.11.0",
37-
"trio>=0.29.0",
34+
"pydantic>=2.13.0",
35+
"trio>=0.30.0",
3836
"gaveta==0.6.0",
3937
]
4038

@@ -45,16 +43,9 @@ Source = "https://github.com/joaopalmeiro/glone"
4543
[project.scripts]
4644
glone = "glone.cli:main"
4745

48-
[tool.hatch.version]
49-
path = "src/glone/__init__.py"
50-
51-
[tool.hatch.envs.default]
52-
detached = false
53-
dependencies = ["ruff==0.6.9", "mypy==1.12.0"]
46+
[dependency-groups]
47+
dev = ["mypy==1.20.1", "ruff==0.15.11"]
5448

55-
[tool.hatch.envs.default.scripts]
56-
lint = ["- ruff check .", "mypy"]
57-
format = ["- ruff check --fix .", "ruff format ."]
58-
59-
[tool.hatch.build]
60-
packages = ["src/glone"]
49+
[build-system]
50+
requires = ["uv_build==0.11.6"]
51+
build-backend = "uv_build"

0 commit comments

Comments
 (0)