small-python 0.0.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,64 @@
1
+ name: Publish
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v[0-9]+.[0-9]+.[0-9]+"
7
+ - "v[0-9]+.[0-9]+.[0-9]+-*"
8
+
9
+ permissions:
10
+ contents: read
11
+
12
+ jobs:
13
+ build:
14
+ runs-on: ubuntu-latest
15
+ timeout-minutes: 10
16
+ steps:
17
+ - name: Check out repository
18
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
19
+
20
+ - name: Set up uv
21
+ uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
22
+ with:
23
+ enable-cache: true
24
+
25
+ - name: Set up Python
26
+ run: uv python install
27
+
28
+ - name: Check tag matches project version
29
+ run: |
30
+ tag="${GITHUB_REF_NAME#v}"
31
+ version="$(uv version --short)"
32
+ if [ "$tag" != "$version" ]; then
33
+ echo "Tag $GITHUB_REF_NAME does not match pyproject version $version" >&2
34
+ exit 1
35
+ fi
36
+
37
+ - name: Build distributions
38
+ run: uv build
39
+
40
+ - name: Check distributions
41
+ run: uvx twine check --strict dist/*
42
+
43
+ - name: Upload distributions
44
+ uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
45
+ with:
46
+ name: dist
47
+ path: dist/
48
+
49
+ publish:
50
+ needs: build
51
+ runs-on: ubuntu-latest
52
+ timeout-minutes: 10
53
+ environment: pypi
54
+ permissions:
55
+ id-token: write # trusted publishing to PyPI
56
+ steps:
57
+ - name: Download distributions
58
+ uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
59
+ with:
60
+ name: dist
61
+ path: dist/
62
+
63
+ - name: Publish to PyPI
64
+ uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2
@@ -0,0 +1,15 @@
1
+ # Python-generated files
2
+ __pycache__/
3
+ *.py[oc]
4
+ build/
5
+ dist/
6
+ wheels/
7
+ *.egg-info
8
+
9
+ # Virtual environments
10
+ .venv
11
+
12
+ # Local files
13
+ .DS_Store
14
+ .env
15
+ .ruff_cache/
@@ -0,0 +1 @@
1
+ 3.12
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Ju Lin
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,64 @@
1
+ Metadata-Version: 2.5
2
+ Name: small-python
3
+ Version: 0.0.1
4
+ Summary: A placeholder Python package.
5
+ Project-URL: Repository, https://github.com/soasme/small-python
6
+ Author-email: Ju Lin <soasme@gmail.com>
7
+ License-Expression: MIT
8
+ License-File: LICENSE
9
+ Requires-Python: >=3.12
10
+ Description-Content-Type: text/markdown
11
+
12
+ # small-python
13
+
14
+ A placeholder Python package. No functionality yet.
15
+
16
+ Requires Python 3.12 or newer. Manage the project with [uv](https://docs.astral.sh/uv/):
17
+
18
+ ```sh
19
+ uv sync --locked
20
+ uv run python -c "import small_python"
21
+ uv build
22
+ ```
23
+
24
+ ## Publishing
25
+
26
+ The workflow in `.github/workflows/publish.yml` builds and publishes to PyPI when
27
+ a version tag matching `pyproject.toml` is pushed (for example, `v0.0.1`).
28
+
29
+ Before the first release, configure a [PyPI Trusted Publisher](https://docs.pypi.org/trusted-publishers/creating-a-project-through-oidc/)
30
+ with these values:
31
+
32
+ - Project: `small-python`
33
+ - Owner: `soasme`
34
+ - Repository: `small-python`
35
+ - Workflow: `publish.yml`
36
+ - Environment: `pypi`
37
+
38
+ Create the `pypi` environment in the GitHub repository settings as well.
39
+ No PyPI API token is needed.
40
+
41
+ To publish the initial version after the repository is pushed:
42
+
43
+ ```sh
44
+ git tag v0.0.1
45
+ git push origin v0.0.1
46
+ ```
47
+
48
+ For later releases, preview a version bump:
49
+
50
+ ```sh
51
+ uv run python scripts/bumpversion.py patch
52
+ ```
53
+
54
+ Use `major`, `minor`, or `patch`. The script clones `origin` into a temporary
55
+ directory, bumps the version and lockfile, builds and checks the distributions,
56
+ and displays the changes. Add `-y` to commit, tag, and push the release:
57
+
58
+ ```sh
59
+ uv run python scripts/bumpversion.py patch -y
60
+ git pull --ff-only
61
+ ```
62
+
63
+ Releases use the remote `main` branch; push any intended changes before running
64
+ the script. The working checkout is left untouched.
@@ -0,0 +1,53 @@
1
+ # small-python
2
+
3
+ A placeholder Python package. No functionality yet.
4
+
5
+ Requires Python 3.12 or newer. Manage the project with [uv](https://docs.astral.sh/uv/):
6
+
7
+ ```sh
8
+ uv sync --locked
9
+ uv run python -c "import small_python"
10
+ uv build
11
+ ```
12
+
13
+ ## Publishing
14
+
15
+ The workflow in `.github/workflows/publish.yml` builds and publishes to PyPI when
16
+ a version tag matching `pyproject.toml` is pushed (for example, `v0.0.1`).
17
+
18
+ Before the first release, configure a [PyPI Trusted Publisher](https://docs.pypi.org/trusted-publishers/creating-a-project-through-oidc/)
19
+ with these values:
20
+
21
+ - Project: `small-python`
22
+ - Owner: `soasme`
23
+ - Repository: `small-python`
24
+ - Workflow: `publish.yml`
25
+ - Environment: `pypi`
26
+
27
+ Create the `pypi` environment in the GitHub repository settings as well.
28
+ No PyPI API token is needed.
29
+
30
+ To publish the initial version after the repository is pushed:
31
+
32
+ ```sh
33
+ git tag v0.0.1
34
+ git push origin v0.0.1
35
+ ```
36
+
37
+ For later releases, preview a version bump:
38
+
39
+ ```sh
40
+ uv run python scripts/bumpversion.py patch
41
+ ```
42
+
43
+ Use `major`, `minor`, or `patch`. The script clones `origin` into a temporary
44
+ directory, bumps the version and lockfile, builds and checks the distributions,
45
+ and displays the changes. Add `-y` to commit, tag, and push the release:
46
+
47
+ ```sh
48
+ uv run python scripts/bumpversion.py patch -y
49
+ git pull --ff-only
50
+ ```
51
+
52
+ Releases use the remote `main` branch; push any intended changes before running
53
+ the script. The working checkout is left untouched.
@@ -0,0 +1,19 @@
1
+ [project]
2
+ name = "small-python"
3
+ version = "0.0.1"
4
+ description = "A placeholder Python package."
5
+ readme = "README.md"
6
+ authors = [
7
+ { name = "Ju Lin", email = "soasme@gmail.com" }
8
+ ]
9
+ requires-python = ">=3.12"
10
+ license = "MIT"
11
+ license-files = ["LICENSE"]
12
+ dependencies = []
13
+
14
+ [project.urls]
15
+ Repository = "https://github.com/soasme/small-python"
16
+
17
+ [build-system]
18
+ requires = ["hatchling>=1.26"]
19
+ build-backend = "hatchling.build"
@@ -0,0 +1,70 @@
1
+ #!/usr/bin/env python3
2
+ """Preview a release in a temporary clone; use -y to commit, tag, and push it."""
3
+
4
+ from __future__ import annotations
5
+
6
+ import argparse
7
+ import subprocess
8
+ import tempfile
9
+ from pathlib import Path
10
+
11
+ RELEASE_FILES = ("pyproject.toml", "uv.lock")
12
+
13
+
14
+ def run(*args: str, cwd: Path) -> str:
15
+ return subprocess.run(
16
+ args, cwd=cwd, check=True, text=True, capture_output=True
17
+ ).stdout.strip()
18
+
19
+
20
+ def run_checked(*args: str, cwd: Path) -> None:
21
+ subprocess.run(args, cwd=cwd, check=True)
22
+
23
+
24
+ def main() -> None:
25
+ parser = argparse.ArgumentParser(description=__doc__)
26
+ parser.add_argument("part", choices=("major", "minor", "patch"))
27
+ parser.add_argument(
28
+ "-y", "--yes", action="store_true", help="commit, tag, and push the release"
29
+ )
30
+ args = parser.parse_args()
31
+
32
+ root = Path(run("git", "rev-parse", "--show-toplevel", cwd=Path.cwd()))
33
+ origin = run("git", "remote", "get-url", "origin", cwd=root)
34
+ with tempfile.TemporaryDirectory(prefix="small-python-bumpversion-") as directory:
35
+ clone = Path(directory) / "small-python"
36
+ run_checked(
37
+ "git", "clone", "--quiet", "--branch", "main", origin, str(clone), cwd=root
38
+ )
39
+ run_checked("uv", "version", "--bump", args.part, "--no-sync", cwd=clone)
40
+ version = run("uv", "version", "--short", cwd=clone)
41
+ tag = f"v{version}"
42
+ if run("git", "tag", "--list", tag, cwd=clone):
43
+ raise RuntimeError(f"Tag {tag} already exists.")
44
+
45
+ run_checked("uv", "build", cwd=clone)
46
+ distributions = sorted(
47
+ str(path)
48
+ for pattern in ("*.whl", "*.tar.gz")
49
+ for path in (clone / "dist").glob(pattern)
50
+ )
51
+ run_checked("uvx", "twine", "check", "--strict", *distributions, cwd=clone)
52
+ print("Release plan:", flush=True)
53
+ run_checked("git", "diff", "--", *RELEASE_FILES, cwd=clone)
54
+ if args.yes:
55
+ run_checked("git", "add", *RELEASE_FILES, cwd=clone)
56
+ run_checked("git", "commit", "-m", f"chore(release): {version}", cwd=clone)
57
+ run_checked("git", "tag", tag, cwd=clone)
58
+ run_checked(
59
+ "git",
60
+ "push",
61
+ "--atomic",
62
+ "origin",
63
+ "HEAD:main",
64
+ f"refs/tags/{tag}",
65
+ cwd=clone,
66
+ )
67
+
68
+
69
+ if __name__ == "__main__":
70
+ main()
@@ -0,0 +1 @@
1
+ """Placeholder for the small-python package."""
File without changes
@@ -0,0 +1,8 @@
1
+ version = 1
2
+ revision = 3
3
+ requires-python = ">=3.12"
4
+
5
+ [[package]]
6
+ name = "small-python"
7
+ version = "0.0.1"
8
+ source = { editable = "." }