reep 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.
- reep-0.0.1/.gitignore +24 -0
- reep-0.0.1/CHANGELOG.md +17 -0
- reep-0.0.1/CITATION.cff +17 -0
- reep-0.0.1/LICENSE +21 -0
- reep-0.0.1/PKG-INFO +72 -0
- reep-0.0.1/README.md +45 -0
- reep-0.0.1/pyproject.toml +137 -0
- reep-0.0.1/src/reep/__init__.py +16 -0
- reep-0.0.1/src/reep/__main__.py +5 -0
- reep-0.0.1/src/reep/cli.py +33 -0
- reep-0.0.1/src/reep/errors.py +10 -0
- reep-0.0.1/src/reep/py.typed +0 -0
- reep-0.0.1/tests/test_package.py +56 -0
reep-0.0.1/.gitignore
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*.egg-info/
|
|
5
|
+
|
|
6
|
+
# Environments
|
|
7
|
+
.venv/
|
|
8
|
+
|
|
9
|
+
# Build output
|
|
10
|
+
build/
|
|
11
|
+
dist/
|
|
12
|
+
|
|
13
|
+
# Tool caches and reports
|
|
14
|
+
.coverage
|
|
15
|
+
.coverage.*
|
|
16
|
+
coverage.xml
|
|
17
|
+
htmlcov/
|
|
18
|
+
.mypy_cache/
|
|
19
|
+
.pytest_cache/
|
|
20
|
+
.ruff_cache/
|
|
21
|
+
|
|
22
|
+
# Local catalogue files used during development
|
|
23
|
+
*.duckdb
|
|
24
|
+
*.duckdb.wal
|
reep-0.0.1/CHANGELOG.md
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project are documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this
|
|
6
|
+
project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
## [0.0.1] - 2026-10-12
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- Package name reservation. The `reep` command prints where to get the register today.
|
|
15
|
+
|
|
16
|
+
[Unreleased]: https://github.com/withqwerty/reep-python/compare/v0.0.1...HEAD
|
|
17
|
+
[0.0.1]: https://github.com/withqwerty/reep-python/releases/tag/v0.0.1
|
reep-0.0.1/CITATION.cff
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
cff-version: 1.2.0
|
|
2
|
+
message: "If you use this software, please cite it using these metadata."
|
|
3
|
+
title: "reep: Python SDK and CLI for the Reep football entity register"
|
|
4
|
+
type: software
|
|
5
|
+
authors:
|
|
6
|
+
- name: "Withqwerty Ltd"
|
|
7
|
+
email: getintouch@withqwerty.com
|
|
8
|
+
website: "https://reep.football"
|
|
9
|
+
repository-code: "https://github.com/withqwerty/reep-python"
|
|
10
|
+
url: "https://reep.football"
|
|
11
|
+
license: MIT
|
|
12
|
+
version: 0.0.1
|
|
13
|
+
keywords:
|
|
14
|
+
- football
|
|
15
|
+
- soccer
|
|
16
|
+
- entity resolution
|
|
17
|
+
- sports data
|
reep-0.0.1/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Withqwerty Ltd
|
|
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.
|
reep-0.0.1/PKG-INFO
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: reep
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary: Python SDK and CLI for the Reep football entity register (in development)
|
|
5
|
+
Project-URL: Homepage, https://reep.football
|
|
6
|
+
Project-URL: Source, https://github.com/withqwerty/reep-python
|
|
7
|
+
Project-URL: Issues, https://github.com/withqwerty/reep-python/issues
|
|
8
|
+
Project-URL: Changelog, https://github.com/withqwerty/reep-python/blob/main/CHANGELOG.md
|
|
9
|
+
Author-email: Withqwerty Ltd <getintouch@withqwerty.com>
|
|
10
|
+
License-Expression: MIT
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Keywords: crosswalk,entity-resolution,football,reep,soccer,sports-data
|
|
13
|
+
Classifier: Development Status :: 1 - Planning
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Intended Audience :: Science/Research
|
|
16
|
+
Classifier: Operating System :: OS Independent
|
|
17
|
+
Classifier: Programming Language :: Python :: 3
|
|
18
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
23
|
+
Classifier: Topic :: Scientific/Engineering :: Information Analysis
|
|
24
|
+
Classifier: Typing :: Typed
|
|
25
|
+
Requires-Python: >=3.11
|
|
26
|
+
Description-Content-Type: text/markdown
|
|
27
|
+
|
|
28
|
+
# reep
|
|
29
|
+
|
|
30
|
+
[](https://github.com/withqwerty/reep-python/actions/workflows/ci.yml)
|
|
31
|
+
[](https://pypi.org/project/reep/)
|
|
32
|
+
[](https://pypi.org/project/reep/)
|
|
33
|
+
[](LICENSE)
|
|
34
|
+
|
|
35
|
+
Python SDK and command-line tool for the [Reep Register](https://reep.football), the
|
|
36
|
+
open crosswalk of football provider IDs.
|
|
37
|
+
|
|
38
|
+
**Status: in development.** Version 0.0.1 reserves the package name and has no SDK
|
|
39
|
+
functions yet. The first working release is 0.1.0. The [development plan](docs/plan.md)
|
|
40
|
+
describes what it will do and in which order.
|
|
41
|
+
|
|
42
|
+
## Use the register today
|
|
43
|
+
|
|
44
|
+
- Download the complete release (CSV and DuckDB, CC0): <https://reep.football/downloads>
|
|
45
|
+
- Hosted lookups with an API key: <https://reep.football/api>
|
|
46
|
+
|
|
47
|
+
## What 0.1.0 will do
|
|
48
|
+
|
|
49
|
+
- Download and verify a dated release, and keep it current from the release changelogs.
|
|
50
|
+
- Resolve a provider ID, given as the full `(provider, namespace, external_id)` triple,
|
|
51
|
+
to its Reep ID, and follow merge redirects.
|
|
52
|
+
- Translate an ID from one provider to another.
|
|
53
|
+
- Give AI agents a stable interface: JSON output with a fixed envelope, documented exit
|
|
54
|
+
codes, and an MCP server.
|
|
55
|
+
|
|
56
|
+
Later releases add a guarded sync of Reep IDs into your own Postgres, MySQL or SQL Server
|
|
57
|
+
tables, with a report of the rows it could not resolve.
|
|
58
|
+
|
|
59
|
+
## Reporting a wrong ID
|
|
60
|
+
|
|
61
|
+
Data corrections (a wrong ID, a bad merge, a missing entity) go to
|
|
62
|
+
<https://reep.football/submit>. Issues in this repository are for the SDK and CLI code.
|
|
63
|
+
|
|
64
|
+
## Contributing
|
|
65
|
+
|
|
66
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md). This project follows the
|
|
67
|
+
[Contributor Covenant](CODE_OF_CONDUCT.md).
|
|
68
|
+
|
|
69
|
+
## Licences
|
|
70
|
+
|
|
71
|
+
The code in this repository is [MIT-licensed](LICENSE). The Reep Register data is
|
|
72
|
+
CC0-1.0.
|
reep-0.0.1/README.md
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# reep
|
|
2
|
+
|
|
3
|
+
[](https://github.com/withqwerty/reep-python/actions/workflows/ci.yml)
|
|
4
|
+
[](https://pypi.org/project/reep/)
|
|
5
|
+
[](https://pypi.org/project/reep/)
|
|
6
|
+
[](LICENSE)
|
|
7
|
+
|
|
8
|
+
Python SDK and command-line tool for the [Reep Register](https://reep.football), the
|
|
9
|
+
open crosswalk of football provider IDs.
|
|
10
|
+
|
|
11
|
+
**Status: in development.** Version 0.0.1 reserves the package name and has no SDK
|
|
12
|
+
functions yet. The first working release is 0.1.0. The [development plan](docs/plan.md)
|
|
13
|
+
describes what it will do and in which order.
|
|
14
|
+
|
|
15
|
+
## Use the register today
|
|
16
|
+
|
|
17
|
+
- Download the complete release (CSV and DuckDB, CC0): <https://reep.football/downloads>
|
|
18
|
+
- Hosted lookups with an API key: <https://reep.football/api>
|
|
19
|
+
|
|
20
|
+
## What 0.1.0 will do
|
|
21
|
+
|
|
22
|
+
- Download and verify a dated release, and keep it current from the release changelogs.
|
|
23
|
+
- Resolve a provider ID, given as the full `(provider, namespace, external_id)` triple,
|
|
24
|
+
to its Reep ID, and follow merge redirects.
|
|
25
|
+
- Translate an ID from one provider to another.
|
|
26
|
+
- Give AI agents a stable interface: JSON output with a fixed envelope, documented exit
|
|
27
|
+
codes, and an MCP server.
|
|
28
|
+
|
|
29
|
+
Later releases add a guarded sync of Reep IDs into your own Postgres, MySQL or SQL Server
|
|
30
|
+
tables, with a report of the rows it could not resolve.
|
|
31
|
+
|
|
32
|
+
## Reporting a wrong ID
|
|
33
|
+
|
|
34
|
+
Data corrections (a wrong ID, a bad merge, a missing entity) go to
|
|
35
|
+
<https://reep.football/submit>. Issues in this repository are for the SDK and CLI code.
|
|
36
|
+
|
|
37
|
+
## Contributing
|
|
38
|
+
|
|
39
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md). This project follows the
|
|
40
|
+
[Contributor Covenant](CODE_OF_CONDUCT.md).
|
|
41
|
+
|
|
42
|
+
## Licences
|
|
43
|
+
|
|
44
|
+
The code in this repository is [MIT-licensed](LICENSE). The Reep Register data is
|
|
45
|
+
CC0-1.0.
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling>=1.27"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "reep"
|
|
7
|
+
version = "0.0.1"
|
|
8
|
+
description = "Python SDK and CLI for the Reep football entity register (in development)"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = "MIT"
|
|
11
|
+
license-files = ["LICENSE"]
|
|
12
|
+
requires-python = ">=3.11"
|
|
13
|
+
authors = [{ name = "Withqwerty Ltd", email = "getintouch@withqwerty.com" }]
|
|
14
|
+
keywords = ["football", "soccer", "entity-resolution", "crosswalk", "sports-data", "reep"]
|
|
15
|
+
classifiers = [
|
|
16
|
+
"Development Status :: 1 - Planning",
|
|
17
|
+
"Intended Audience :: Developers",
|
|
18
|
+
"Intended Audience :: Science/Research",
|
|
19
|
+
"Operating System :: OS Independent",
|
|
20
|
+
"Programming Language :: Python :: 3",
|
|
21
|
+
"Programming Language :: Python :: 3 :: Only",
|
|
22
|
+
"Programming Language :: Python :: 3.11",
|
|
23
|
+
"Programming Language :: Python :: 3.12",
|
|
24
|
+
"Programming Language :: Python :: 3.13",
|
|
25
|
+
"Programming Language :: Python :: 3.14",
|
|
26
|
+
"Topic :: Scientific/Engineering :: Information Analysis",
|
|
27
|
+
"Typing :: Typed",
|
|
28
|
+
]
|
|
29
|
+
dependencies = []
|
|
30
|
+
|
|
31
|
+
[project.urls]
|
|
32
|
+
Homepage = "https://reep.football"
|
|
33
|
+
Source = "https://github.com/withqwerty/reep-python"
|
|
34
|
+
Issues = "https://github.com/withqwerty/reep-python/issues"
|
|
35
|
+
Changelog = "https://github.com/withqwerty/reep-python/blob/main/CHANGELOG.md"
|
|
36
|
+
|
|
37
|
+
[project.scripts]
|
|
38
|
+
reep = "reep.cli:main"
|
|
39
|
+
|
|
40
|
+
[dependency-groups]
|
|
41
|
+
dev = [
|
|
42
|
+
{ include-group = "lint" },
|
|
43
|
+
{ include-group = "test" },
|
|
44
|
+
{ include-group = "typecheck" },
|
|
45
|
+
"pre-commit>=4.3",
|
|
46
|
+
]
|
|
47
|
+
lint = ["ruff>=0.17"]
|
|
48
|
+
test = ["pytest>=9", "pytest-cov>=7"]
|
|
49
|
+
typecheck = ["mypy>=2", { include-group = "test" }]
|
|
50
|
+
|
|
51
|
+
[tool.uv]
|
|
52
|
+
required-version = ">=0.12"
|
|
53
|
+
|
|
54
|
+
[tool.hatch.build.targets.sdist]
|
|
55
|
+
include = ["/src", "/tests", "/CHANGELOG.md", "/CITATION.cff", "/README.md", "/LICENSE"]
|
|
56
|
+
|
|
57
|
+
[tool.hatch.build.targets.wheel]
|
|
58
|
+
packages = ["src/reep"]
|
|
59
|
+
|
|
60
|
+
# --- ruff -------------------------------------------------------------------
|
|
61
|
+
|
|
62
|
+
[tool.ruff]
|
|
63
|
+
line-length = 88
|
|
64
|
+
src = ["src", "tests"]
|
|
65
|
+
|
|
66
|
+
[tool.ruff.format]
|
|
67
|
+
# The plan's API sketch uses aligned annotation comments.
|
|
68
|
+
exclude = ["docs/plan.md"]
|
|
69
|
+
|
|
70
|
+
[tool.ruff.lint]
|
|
71
|
+
select = [
|
|
72
|
+
"E", "W", # pycodestyle
|
|
73
|
+
"F", # pyflakes
|
|
74
|
+
"I", # isort
|
|
75
|
+
"UP", # pyupgrade
|
|
76
|
+
"B", # flake8-bugbear
|
|
77
|
+
"C4", # flake8-comprehensions
|
|
78
|
+
"SIM", # flake8-simplify
|
|
79
|
+
"RET", # flake8-return
|
|
80
|
+
"PTH", # flake8-use-pathlib
|
|
81
|
+
"TC", # flake8-type-checking
|
|
82
|
+
"PT", # flake8-pytest-style
|
|
83
|
+
"S", # flake8-bandit
|
|
84
|
+
"T20", # flake8-print: library code does not print
|
|
85
|
+
"N", # pep8-naming
|
|
86
|
+
"D", # pydocstyle
|
|
87
|
+
"RUF", # ruff-specific rules
|
|
88
|
+
]
|
|
89
|
+
|
|
90
|
+
[tool.ruff.lint.pydocstyle]
|
|
91
|
+
convention = "google"
|
|
92
|
+
|
|
93
|
+
[tool.ruff.lint.per-file-ignores]
|
|
94
|
+
"tests/**" = ["D", "S101"]
|
|
95
|
+
"src/reep/cli.py" = ["T201"]
|
|
96
|
+
|
|
97
|
+
# --- mypy -------------------------------------------------------------------
|
|
98
|
+
|
|
99
|
+
[tool.mypy]
|
|
100
|
+
strict = true
|
|
101
|
+
warn_unreachable = true
|
|
102
|
+
enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"]
|
|
103
|
+
files = ["src", "tests"]
|
|
104
|
+
|
|
105
|
+
# Lets editors that use Pyright or Pylance find the project environment.
|
|
106
|
+
[tool.pyright]
|
|
107
|
+
venvPath = "."
|
|
108
|
+
venv = ".venv"
|
|
109
|
+
|
|
110
|
+
# --- pytest and coverage ----------------------------------------------------
|
|
111
|
+
|
|
112
|
+
[tool.pytest.ini_options]
|
|
113
|
+
minversion = "9.0"
|
|
114
|
+
testpaths = ["tests"]
|
|
115
|
+
addopts = ["-ra", "--strict-markers", "--strict-config", "-m", "not network"]
|
|
116
|
+
markers = [
|
|
117
|
+
"network: calls the live Reep release or API (deselected by default; run with -m network)",
|
|
118
|
+
]
|
|
119
|
+
xfail_strict = true
|
|
120
|
+
filterwarnings = ["error"]
|
|
121
|
+
|
|
122
|
+
[tool.coverage.run]
|
|
123
|
+
branch = true
|
|
124
|
+
source = ["reep"]
|
|
125
|
+
|
|
126
|
+
[tool.coverage.paths]
|
|
127
|
+
source = ["src/reep", "*/site-packages/reep"]
|
|
128
|
+
|
|
129
|
+
[tool.coverage.report]
|
|
130
|
+
fail_under = 90
|
|
131
|
+
show_missing = true
|
|
132
|
+
skip_covered = true
|
|
133
|
+
exclude_also = [
|
|
134
|
+
"if TYPE_CHECKING:",
|
|
135
|
+
"raise NotImplementedError",
|
|
136
|
+
'if __name__ == "__main__":',
|
|
137
|
+
]
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"""Python SDK for the Reep football entity register.
|
|
2
|
+
|
|
3
|
+
The SDK is in development. Version 0.0.1 reserves the package name; see
|
|
4
|
+
https://reep.football for the register itself.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
import logging
|
|
8
|
+
from importlib.metadata import version
|
|
9
|
+
|
|
10
|
+
from reep.errors import ReepError
|
|
11
|
+
|
|
12
|
+
__all__ = ["ReepError", "__version__"]
|
|
13
|
+
|
|
14
|
+
__version__ = version("reep")
|
|
15
|
+
|
|
16
|
+
logging.getLogger(__name__).addHandler(logging.NullHandler())
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"""Command-line entry point for the ``reep`` command."""
|
|
2
|
+
|
|
3
|
+
import argparse
|
|
4
|
+
from collections.abc import Sequence
|
|
5
|
+
|
|
6
|
+
from reep import __version__
|
|
7
|
+
|
|
8
|
+
MESSAGE = f"""reep {__version__}: the v1 SDK and CLI are in development.
|
|
9
|
+
|
|
10
|
+
Use the register today:
|
|
11
|
+
download https://reep.football/downloads
|
|
12
|
+
API https://reep.football/api
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def main(argv: Sequence[str] | None = None) -> int:
|
|
17
|
+
"""Run the ``reep`` command.
|
|
18
|
+
|
|
19
|
+
Args:
|
|
20
|
+
argv: Command-line arguments without the program name. ``None`` reads
|
|
21
|
+
them from ``sys.argv``.
|
|
22
|
+
|
|
23
|
+
Returns:
|
|
24
|
+
The process exit code.
|
|
25
|
+
"""
|
|
26
|
+
parser = argparse.ArgumentParser(
|
|
27
|
+
prog="reep",
|
|
28
|
+
description="Python SDK and CLI for the Reep football entity register.",
|
|
29
|
+
)
|
|
30
|
+
parser.add_argument("--version", action="version", version=f"reep {__version__}")
|
|
31
|
+
parser.parse_args(argv)
|
|
32
|
+
print(MESSAGE, end="")
|
|
33
|
+
return 0
|
|
File without changes
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import re
|
|
2
|
+
import runpy
|
|
3
|
+
from importlib.metadata import version
|
|
4
|
+
from importlib.resources import files
|
|
5
|
+
from pathlib import Path
|
|
6
|
+
|
|
7
|
+
import pytest
|
|
8
|
+
|
|
9
|
+
import reep
|
|
10
|
+
from reep.cli import main
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def test_version_matches_distribution_metadata() -> None:
|
|
14
|
+
assert reep.__version__ == version("reep")
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def test_citation_version_matches_package_version() -> None:
|
|
18
|
+
citation = Path(__file__).parents[1] / "CITATION.cff"
|
|
19
|
+
match = re.search(r"^version:\s*(\S+)\s*$", citation.read_text(), re.MULTILINE)
|
|
20
|
+
assert match is not None
|
|
21
|
+
assert match.group(1) == reep.__version__
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def test_package_ships_type_information() -> None:
|
|
25
|
+
assert files("reep").joinpath("py.typed").is_file()
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def test_public_api_is_declared() -> None:
|
|
29
|
+
assert set(reep.__all__) == {"ReepError", "__version__"}
|
|
30
|
+
assert issubclass(reep.ReepError, Exception)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def test_cli_prints_where_to_get_the_register(
|
|
34
|
+
capsys: pytest.CaptureFixture[str],
|
|
35
|
+
) -> None:
|
|
36
|
+
assert main([]) == 0
|
|
37
|
+
out = capsys.readouterr().out
|
|
38
|
+
assert f"reep {reep.__version__}" in out
|
|
39
|
+
assert "https://reep.football/downloads" in out
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def test_cli_version_flag(capsys: pytest.CaptureFixture[str]) -> None:
|
|
43
|
+
with pytest.raises(SystemExit) as exc:
|
|
44
|
+
main(["--version"])
|
|
45
|
+
assert exc.value.code == 0
|
|
46
|
+
assert capsys.readouterr().out.strip() == f"reep {reep.__version__}"
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def test_python_dash_m_runs_the_cli(
|
|
50
|
+
capsys: pytest.CaptureFixture[str], monkeypatch: pytest.MonkeyPatch
|
|
51
|
+
) -> None:
|
|
52
|
+
monkeypatch.setattr("sys.argv", ["reep"])
|
|
53
|
+
with pytest.raises(SystemExit) as exc:
|
|
54
|
+
runpy.run_module("reep", run_name="__main__")
|
|
55
|
+
assert exc.value.code == 0
|
|
56
|
+
assert "reep.football" in capsys.readouterr().out
|