proteum 0.0.0__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,108 @@
1
+ name: Release to PyPI
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ push:
6
+ tags:
7
+ - "v*"
8
+
9
+ permissions:
10
+ contents: read
11
+
12
+ concurrency:
13
+ group: release-${{ github.ref }}
14
+ cancel-in-progress: false
15
+
16
+ jobs:
17
+ build:
18
+ name: Build and validate distributions
19
+ runs-on: ubuntu-latest
20
+ timeout-minutes: 10
21
+ steps:
22
+ - name: Check out the source
23
+ uses: actions/checkout@v6
24
+ with:
25
+ persist-credentials: false
26
+
27
+ - name: Set up Python
28
+ uses: actions/setup-python@v6
29
+ with:
30
+ python-version: "3.11"
31
+
32
+ - name: Confirm the tag matches the package version
33
+ if: startsWith(github.ref, 'refs/tags/v')
34
+ run: |
35
+ python - <<'PY'
36
+ import os
37
+ import tomllib
38
+ from pathlib import Path
39
+
40
+ project = tomllib.loads(Path("pyproject.toml").read_text())
41
+ expected_tag = f"v{project['project']['version']}"
42
+ actual_tag = os.environ["GITHUB_REF_NAME"]
43
+ if actual_tag != expected_tag:
44
+ raise SystemExit(
45
+ f"Release tag {actual_tag!r} does not match {expected_tag!r}"
46
+ )
47
+ PY
48
+
49
+ - name: Install build tools
50
+ run: python -m pip install build twine
51
+
52
+ - name: Build distributions
53
+ run: python -m build
54
+
55
+ - name: Validate distribution metadata
56
+ run: python -m twine check dist/*
57
+
58
+ - name: Store distributions
59
+ uses: actions/upload-artifact@v5
60
+ with:
61
+ name: python-package-distributions
62
+ path: dist/
63
+ if-no-files-found: error
64
+ retention-days: 7
65
+
66
+ publish-testpypi:
67
+ name: Publish to TestPyPI
68
+ needs: build
69
+ if: github.event_name == 'workflow_dispatch'
70
+ runs-on: ubuntu-latest
71
+ timeout-minutes: 10
72
+ environment:
73
+ name: testpypi
74
+ url: https://test.pypi.org/project/proteum/
75
+ permissions:
76
+ id-token: write
77
+ steps:
78
+ - name: Download distributions
79
+ uses: actions/download-artifact@v6
80
+ with:
81
+ name: python-package-distributions
82
+ path: dist/
83
+
84
+ - name: Publish distributions
85
+ uses: pypa/gh-action-pypi-publish@release/v1
86
+ with:
87
+ repository-url: https://test.pypi.org/legacy/
88
+
89
+ publish-pypi:
90
+ name: Publish to PyPI
91
+ needs: build
92
+ if: startsWith(github.ref, 'refs/tags/v')
93
+ runs-on: ubuntu-latest
94
+ timeout-minutes: 10
95
+ environment:
96
+ name: pypi
97
+ url: https://pypi.org/project/proteum/
98
+ permissions:
99
+ id-token: write
100
+ steps:
101
+ - name: Download distributions
102
+ uses: actions/download-artifact@v6
103
+ with:
104
+ name: python-package-distributions
105
+ path: dist/
106
+
107
+ - name: Publish distributions
108
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,12 @@
1
+ # Python-generated files
2
+ __pycache__/
3
+ *.py[oc]
4
+ build/
5
+ dist/
6
+ wheels/
7
+ *.egg-info
8
+ .mypy_cache/
9
+ .ruff_cache/
10
+
11
+ # Virtual environments
12
+ .venv
@@ -0,0 +1 @@
1
+ 3.10
proteum-0.0.0/PKG-INFO ADDED
@@ -0,0 +1,36 @@
1
+ Metadata-Version: 2.4
2
+ Name: proteum
3
+ Version: 0.0.0
4
+ Summary: An early-preview Python package with a small installation-check CLI
5
+ Requires-Python: >=3.10
6
+ Description-Content-Type: text/markdown
7
+
8
+ # Proteum
9
+
10
+ Proteum is an early-preview Python package. Version `0.0.0` provides a small
11
+ command-line interface that confirms the package is installed and reports the
12
+ installed version.
13
+
14
+ ## Install
15
+
16
+ ```console
17
+ python -m pip install proteum
18
+ ```
19
+
20
+ ## Use
21
+
22
+ Confirm the installation:
23
+
24
+ ```console
25
+ $ proteum
26
+ Proteum is installed and ready.
27
+ ```
28
+
29
+ Report the version:
30
+
31
+ ```console
32
+ $ proteum --version
33
+ proteum 0.0.0
34
+ ```
35
+
36
+ The public interface will grow in later preview releases.
@@ -0,0 +1,29 @@
1
+ # Proteum
2
+
3
+ Proteum is an early-preview Python package. Version `0.0.0` provides a small
4
+ command-line interface that confirms the package is installed and reports the
5
+ installed version.
6
+
7
+ ## Install
8
+
9
+ ```console
10
+ python -m pip install proteum
11
+ ```
12
+
13
+ ## Use
14
+
15
+ Confirm the installation:
16
+
17
+ ```console
18
+ $ proteum
19
+ Proteum is installed and ready.
20
+ ```
21
+
22
+ Report the version:
23
+
24
+ ```console
25
+ $ proteum --version
26
+ proteum 0.0.0
27
+ ```
28
+
29
+ The public interface will grow in later preview releases.
@@ -0,0 +1,17 @@
1
+ [build-system]
2
+ requires = ["hatchling>=1.26"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "proteum"
7
+ version = "0.0.0"
8
+ description = "An early-preview Python package with a small installation-check CLI"
9
+ readme = "README.md"
10
+ requires-python = ">=3.10"
11
+ dependencies = []
12
+
13
+ [project.scripts]
14
+ proteum = "proteum.cli:main"
15
+
16
+ [tool.hatch.build.targets.wheel]
17
+ packages = ["src/proteum"]
@@ -0,0 +1,3 @@
1
+ """Public package metadata for Proteum."""
2
+
3
+ __version__ = "0.0.0"
@@ -0,0 +1,5 @@
1
+ """Run the Proteum command-line interface with ``python -m proteum``."""
2
+
3
+ from proteum.cli import main
4
+
5
+ raise SystemExit(main())
@@ -0,0 +1,25 @@
1
+ """Command-line interface for Proteum."""
2
+
3
+ from argparse import ArgumentParser
4
+ from collections.abc import Sequence
5
+
6
+ from proteum import __version__
7
+
8
+
9
+ def build_parser() -> ArgumentParser:
10
+ """Build the Proteum command-line argument parser."""
11
+ parser = ArgumentParser(prog="proteum")
12
+ parser.add_argument(
13
+ "--version",
14
+ action="version",
15
+ version=f"%(prog)s {__version__}",
16
+ )
17
+ return parser
18
+
19
+
20
+ def main(argv: Sequence[str] | None = None) -> int:
21
+ """Confirm that Proteum is installed and ready."""
22
+ parser = build_parser()
23
+ parser.parse_args(argv)
24
+ print("Proteum is installed and ready.")
25
+ return 0
@@ -0,0 +1,31 @@
1
+ """Behavior tests for the Proteum command-line interface."""
2
+
3
+ import unittest
4
+ from contextlib import redirect_stdout
5
+ from io import StringIO
6
+
7
+ from proteum.cli import main
8
+
9
+
10
+ class CliTests(unittest.TestCase):
11
+ def test_main_confirms_installation(self) -> None:
12
+ output = StringIO()
13
+
14
+ with redirect_stdout(output):
15
+ exit_code = main([])
16
+
17
+ self.assertEqual(exit_code, 0)
18
+ self.assertEqual(output.getvalue(), "Proteum is installed and ready.\n")
19
+
20
+ def test_version_reports_package_version(self) -> None:
21
+ output = StringIO()
22
+
23
+ with self.assertRaisesRegex(SystemExit, "0"):
24
+ with redirect_stdout(output):
25
+ main(["--version"])
26
+
27
+ self.assertEqual(output.getvalue(), "proteum 0.0.0\n")
28
+
29
+
30
+ if __name__ == "__main__":
31
+ unittest.main()