articlepub 0.1.1__tar.gz → 0.1.2__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.
Files changed (44) hide show
  1. {articlepub-0.1.1 → articlepub-0.1.2}/.github/workflows/release.yml +3 -3
  2. {articlepub-0.1.1 → articlepub-0.1.2}/PKG-INFO +11 -4
  3. {articlepub-0.1.1 → articlepub-0.1.2}/README.md +10 -3
  4. {articlepub-0.1.1 → articlepub-0.1.2}/pyproject.toml +1 -1
  5. articlepub-0.1.2/src/articlepub/__init__.py +1 -0
  6. {articlepub-0.1.1 → articlepub-0.1.2}/src/articlepub/cli.py +6 -0
  7. {articlepub-0.1.1 → articlepub-0.1.2}/tests/test_cli.py +17 -0
  8. {articlepub-0.1.1 → articlepub-0.1.2}/uv.lock +1 -1
  9. articlepub-0.1.1/src/articlepub/__init__.py +0 -1
  10. {articlepub-0.1.1 → articlepub-0.1.2}/.gitignore +0 -0
  11. {articlepub-0.1.1 → articlepub-0.1.2}/AGENTS.md +0 -0
  12. {articlepub-0.1.1 → articlepub-0.1.2}/src/articlepub/__main__.py +0 -0
  13. {articlepub-0.1.1 → articlepub-0.1.2}/src/articlepub/cli_support.py +0 -0
  14. {articlepub-0.1.1 → articlepub-0.1.2}/src/articlepub/cli_ui.py +0 -0
  15. {articlepub-0.1.1 → articlepub-0.1.2}/src/articlepub/constants.py +0 -0
  16. {articlepub-0.1.1 → articlepub-0.1.2}/src/articlepub/diagnostics.py +0 -0
  17. {articlepub-0.1.1 → articlepub-0.1.2}/src/articlepub/epub.py +0 -0
  18. {articlepub-0.1.1 → articlepub-0.1.2}/src/articlepub/extract.py +0 -0
  19. {articlepub-0.1.1 → articlepub-0.1.2}/src/articlepub/fetch.py +0 -0
  20. {articlepub-0.1.1 → articlepub-0.1.2}/src/articlepub/llm/__init__.py +0 -0
  21. {articlepub-0.1.1 → articlepub-0.1.2}/src/articlepub/llm/anthropic.py +0 -0
  22. {articlepub-0.1.1 → articlepub-0.1.2}/src/articlepub/llm/base.py +0 -0
  23. {articlepub-0.1.1 → articlepub-0.1.2}/src/articlepub/llm/types.py +0 -0
  24. {articlepub-0.1.1 → articlepub-0.1.2}/src/articlepub/models.py +0 -0
  25. {articlepub-0.1.1 → articlepub-0.1.2}/src/articlepub/pipeline.py +0 -0
  26. {articlepub-0.1.1 → articlepub-0.1.2}/src/articlepub/prompts.py +0 -0
  27. {articlepub-0.1.1 → articlepub-0.1.2}/src/articlepub/raw_store.py +0 -0
  28. {articlepub-0.1.1 → articlepub-0.1.2}/src/articlepub/redaction.py +0 -0
  29. {articlepub-0.1.1 → articlepub-0.1.2}/src/articlepub/sanitize.py +0 -0
  30. {articlepub-0.1.1 → articlepub-0.1.2}/src/articlepub/stats.py +0 -0
  31. {articlepub-0.1.1 → articlepub-0.1.2}/src/articlepub/text.py +0 -0
  32. {articlepub-0.1.1 → articlepub-0.1.2}/src/articlepub/tui.py +0 -0
  33. {articlepub-0.1.1 → articlepub-0.1.2}/src/articlepub/upload.py +0 -0
  34. {articlepub-0.1.1 → articlepub-0.1.2}/tests/fixtures/blog.html +0 -0
  35. {articlepub-0.1.1 → articlepub-0.1.2}/tests/test_anthropic.py +0 -0
  36. {articlepub-0.1.1 → articlepub-0.1.2}/tests/test_cli_support.py +0 -0
  37. {articlepub-0.1.1 → articlepub-0.1.2}/tests/test_cli_ui.py +0 -0
  38. {articlepub-0.1.1 → articlepub-0.1.2}/tests/test_diagnostics.py +0 -0
  39. {articlepub-0.1.1 → articlepub-0.1.2}/tests/test_epub.py +0 -0
  40. {articlepub-0.1.1 → articlepub-0.1.2}/tests/test_extract.py +0 -0
  41. {articlepub-0.1.1 → articlepub-0.1.2}/tests/test_pipeline.py +0 -0
  42. {articlepub-0.1.1 → articlepub-0.1.2}/tests/test_redaction.py +0 -0
  43. {articlepub-0.1.1 → articlepub-0.1.2}/tests/test_stats.py +0 -0
  44. {articlepub-0.1.1 → articlepub-0.1.2}/tests/test_upload.py +0 -0
@@ -7,6 +7,7 @@ on:
7
7
 
8
8
  permissions:
9
9
  contents: write
10
+ id-token: write
10
11
 
11
12
  concurrency:
12
13
  group: release-${{ github.ref }}
@@ -16,6 +17,7 @@ jobs:
16
17
  release:
17
18
  name: Build, publish, and release
18
19
  runs-on: ubuntu-latest
20
+ environment: release
19
21
 
20
22
  steps:
21
23
  - name: Check out repository
@@ -72,9 +74,7 @@ jobs:
72
74
  run: uvx --from "dist/articlepub-${{ steps.version.outputs.version }}-py3-none-any.whl" articlepub --help
73
75
 
74
76
  - name: Publish to PyPI
75
- env:
76
- UV_PUBLISH_TOKEN: ${{ secrets.ARTICLEPUB_PYPI_UPLOAD_TOKEN }}
77
- run: uv publish dist/* --check-url https://pypi.org/simple/articlepub/
77
+ run: uv publish dist/* --trusted-publishing always --check-url https://pypi.org/simple/articlepub/
78
78
 
79
79
  - name: Create GitHub release
80
80
  env:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: articlepub
3
- Version: 0.1.1
3
+ Version: 0.1.2
4
4
  Summary: Turn article URLs into Kindle-friendly EPUBs and optionally upload them to Calibre-Web.
5
5
  Author: Farhad
6
6
  Requires-Python: >=3.11
@@ -158,6 +158,13 @@ If you do not want to use an LLM, add `--provider none`.
158
158
 
159
159
  Run `uvx articlepub --help` or `uvx articlepub add --help` for the full CLI reference.
160
160
 
161
+ Check the installed version:
162
+
163
+ ```bash
164
+ uvx articlepub --version
165
+ uvx articlepub version
166
+ ```
167
+
161
168
  ## Local Development
162
169
 
163
170
  From a checkout of this repository:
@@ -188,9 +195,9 @@ Before tagging, update the version in both places:
188
195
  Then commit, tag, and push:
189
196
 
190
197
  ```bash
191
- git tag v0.1.1
198
+ git tag v0.1.2
192
199
  git push origin main
193
- git push origin v0.1.1
200
+ git push origin v0.1.2
194
201
  ```
195
202
 
196
- The GitHub Action will run tests, build the wheel and source distribution, publish to PyPI using `secrets.ARTICLEPUB_PYPI_UPLOAD_TOKEN`, and create a GitHub Release with generated release notes.
203
+ The GitHub Action will run tests, build the wheel and source distribution, publish to PyPI with Trusted Publishing, and create a GitHub Release with generated release notes. The PyPI trusted publisher should point at the `release` GitHub Actions environment.
@@ -150,6 +150,13 @@ If you do not want to use an LLM, add `--provider none`.
150
150
 
151
151
  Run `uvx articlepub --help` or `uvx articlepub add --help` for the full CLI reference.
152
152
 
153
+ Check the installed version:
154
+
155
+ ```bash
156
+ uvx articlepub --version
157
+ uvx articlepub version
158
+ ```
159
+
153
160
  ## Local Development
154
161
 
155
162
  From a checkout of this repository:
@@ -180,9 +187,9 @@ Before tagging, update the version in both places:
180
187
  Then commit, tag, and push:
181
188
 
182
189
  ```bash
183
- git tag v0.1.1
190
+ git tag v0.1.2
184
191
  git push origin main
185
- git push origin v0.1.1
192
+ git push origin v0.1.2
186
193
  ```
187
194
 
188
- The GitHub Action will run tests, build the wheel and source distribution, publish to PyPI using `secrets.ARTICLEPUB_PYPI_UPLOAD_TOKEN`, and create a GitHub Release with generated release notes.
195
+ The GitHub Action will run tests, build the wheel and source distribution, publish to PyPI with Trusted Publishing, and create a GitHub Release with generated release notes. The PyPI trusted publisher should point at the `release` GitHub Actions environment.
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "articlepub"
7
- version = "0.1.1"
7
+ version = "0.1.2"
8
8
  description = "Turn article URLs into Kindle-friendly EPUBs and optionally upload them to Calibre-Web."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.11"
@@ -0,0 +1 @@
1
+ __version__ = "0.1.2"
@@ -3,6 +3,7 @@ from __future__ import annotations
3
3
  import argparse
4
4
  from pathlib import Path
5
5
 
6
+ from . import __version__
6
7
  from .cli_support import make_provider
7
8
  from .cli_ui import TerminalUI
8
9
  from .constants import DEFAULT_OUTPUT_DIR
@@ -30,6 +31,9 @@ def main(argv: list[str] | None = None) -> int:
30
31
  return _upload(args, ui)
31
32
  if args.command == "tui":
32
33
  return run_tui(ui)
34
+ if args.command == "version":
35
+ print(__version__)
36
+ return 0
33
37
  parser.print_help()
34
38
  return 2
35
39
  except Exception as exc:
@@ -194,6 +198,7 @@ def _calibre_config(args: argparse.Namespace) -> CalibreConfig:
194
198
 
195
199
  def _parser() -> argparse.ArgumentParser:
196
200
  parser = argparse.ArgumentParser(prog="articlepub")
201
+ parser.add_argument("--version", action="version", version=__version__)
197
202
  sub = parser.add_subparsers(dest="command")
198
203
 
199
204
  add = sub.add_parser("add", help="Convert a URL to EPUB")
@@ -209,6 +214,7 @@ def _parser() -> argparse.ArgumentParser:
209
214
  _add_calibre_args(upload, require_url=True)
210
215
 
211
216
  sub.add_parser("tui", help="Run the interactive terminal UI")
217
+ sub.add_parser("version", help="Print the ArticlePub version")
212
218
  return parser
213
219
 
214
220
 
@@ -5,6 +5,7 @@ from tempfile import TemporaryDirectory
5
5
  from unittest import TestCase
6
6
  from unittest.mock import patch
7
7
 
8
+ from articlepub import __version__
8
9
  from articlepub.cli import main
9
10
  from articlepub.upload import UploadResult
10
11
 
@@ -13,6 +14,22 @@ FIXTURE = Path(__file__).parent / "fixtures" / "blog.html"
13
14
 
14
15
 
15
16
  class CliTest(TestCase):
17
+ def test_global_version_flag_prints_version(self) -> None:
18
+ stdout = io.StringIO()
19
+ with redirect_stdout(stdout), self.assertRaises(SystemExit) as exit_context:
20
+ main(["--version"])
21
+
22
+ self.assertEqual(exit_context.exception.code, 0)
23
+ self.assertEqual(stdout.getvalue(), f"{__version__}\n")
24
+
25
+ def test_version_command_prints_version(self) -> None:
26
+ stdout = io.StringIO()
27
+ with redirect_stdout(stdout):
28
+ code = main(["version"])
29
+
30
+ self.assertEqual(code, 0)
31
+ self.assertEqual(stdout.getvalue(), f"{__version__}\n")
32
+
16
33
  def test_add_local_file_without_provider(self) -> None:
17
34
  with TemporaryDirectory() as tmp:
18
35
  stdout = io.StringIO()
@@ -4,5 +4,5 @@ requires-python = ">=3.11"
4
4
 
5
5
  [[package]]
6
6
  name = "articlepub"
7
- version = "0.1.1"
7
+ version = "0.1.2"
8
8
  source = { editable = "." }
@@ -1 +0,0 @@
1
- __version__ = "0.1.1"
File without changes
File without changes