Skip to content

Commit a0caca9

Browse files
fix docs after project name change (+"_AS")
1 parent 895b400 commit a0caca9

File tree

9 files changed

+37
-48
lines changed

9 files changed

+37
-48
lines changed

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
3737
- name: Run tests (with coverage)
3838
run: |
39-
python -m pytest -q --cov=python_project_template --cov-report=term --cov-report=html
39+
python -m pytest -q --cov=python_project_template_AS --cov-report=term --cov-report=html
4040
4141
- name: Upload HTML coverage
4242
if: always()

README.md

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[![CI](https://github.com/andreascaglioni/python-project-template/actions/workflows/tests.yml/badge.svg)](https://github.com/andreascaglioni/python-project-template/actions/workflows/tests.yml)
22
[![Docs](https://github.com/andreascaglioni/python-project-template/actions/workflows/docs.yml/badge.svg)](https://github.com/andreascaglioni/python-project-template/actions/workflows/docs.yml)
3-
[![codecov](https://codecov.io/gh/andreascaglioni/python-project-template/branch/main/graph/badge.svg)](https://codecov.io/gh/andreascaglioni/python-project-template)
4-
[![PyPI Version](https://img.shields.io/pypi/v/python-project-template.svg)](https://pypi.org/project/python-project-template/)
3+
[![PyPI Version](https://img.shields.io/pypi/v/python-project-template.svg)](https://pypi.org/project/python-project-template-AS/)
4+
[![TestPyPI Version](https://img.shields.io/badge/TestPyPI-latest-informational.svg)](https://test.pypi.org/project/python-project-template-AS/)
55
[![Python](https://img.shields.io/badge/python-3.8%2B-blue.svg)](https://www.python.org/)
66
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
77

@@ -43,14 +43,20 @@ This simple code is used to showcase some good coding practices.
4343

4444
## Installation
4545

46-
Clone the repository, create a virtual environment (recommended), and install dependencies and an editable installation of `python-project-template`:
46+
To install the latest release from TestPyPI, use:
4747

4848
```bash
49-
git clone <https://github.com/andreascaglioni/python-project-template>
50-
cd python-project-template
5149
python3 -m venv .venv
5250
source .venv/bin/activate
53-
python -m pip install --upgrade pip setuptools wheel
51+
python -m pip install --upgrade pip
52+
pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple python-project-template-AS
53+
```
54+
55+
Alternatively, you can clone the repository, create a virtual environment (recommended), and install dependencies and an editable installation of `python-project-template`:
56+
57+
```bash
58+
git clone <https://github.com/andreascaglioni/python-project-template>
59+
cd python-project-template
5460
pip install -e ".[dev]"
5561
```
5662

@@ -59,7 +65,7 @@ pip install -e ".[dev]"
5965
The following is a quick example for the Calculator API.
6066

6167
```python
62-
from python_project_template import default_calculator, Operation
68+
from python_project_template_AS import default_calculator, Operation
6369

6470
# Create a default calculator (pre-populated with common operations)
6571
calc = default_calculator()
@@ -88,20 +94,26 @@ print(calc.apply('inc', 4)) # -> 5
8894

8995
For detailed documentation, please visit our [GitHub Pages](https://andreascaglioni.github.io/your-repo-name/).
9096

97+
To build the documentation locally:
98+
99+
1. Ensure all dependencies for documentation (e.g., Sphinx) generation are installed, for example running ``pip install -e ".[docs]"``.
100+
2. Run the documentation build command (for example, ``make html``).
101+
3. Review the generated HTML in ``docs/_build/html``.
102+
91103
## Running tests
92104

93105
Run the full PyTest test suite with coverage:
94106

95107
```bash
96-
pytest -q --cov=python_project_template --cov-report=term --cov-report=html
108+
pytest -q --cov=python_project_template_AS --cov-report=term --cov-report=html
97109
```
98110

99111
Open `htmlcov/index.html` to view the coverage report.
100112

101113
## Project structure
102114

103115
```
104-
src/python_project_template/ # Core library package
116+
src/python_project_template_AS/ # Core library package
105117
calculator.py # Calculator API
106118
operations.py # Built-in operations
107119
registry.py # Operation registry

docs/api.rst

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,33 +6,33 @@ This section documents the public API exposed by the `python-project-template` p
66
.. autosummary::
77
:toctree: _autosummary
88

9-
python_project_template.calculator
10-
python_project_template.operations
11-
python_project_template.registry
12-
python_project_template.exceptions
13-
python_project_template.utils
9+
python_project_template_AS.calculator
10+
python_project_template_AS.operations
11+
python_project_template_AS.registry
12+
python_project_template_AS.exceptions
13+
python_project_template_AS.utils
1414

1515

1616

17-
.. automodule:: python_project_template.calculator
17+
.. automodule:: python_project_template_AS.calculator
1818
:members:
1919
:undoc-members:
2020
:noindex:
2121
:show-inheritance:
2222

23-
.. automodule:: python_project_template.operations
23+
.. automodule:: python_project_template_AS.operations
2424
:members:
2525
:noindex:
2626
:undoc-members:
2727

28-
.. automodule:: python_project_template.registry
28+
.. automodule:: python_project_template_AS.registry
2929
:members:
3030
:noindex:
3131

32-
.. automodule:: python_project_template.exceptions
32+
.. automodule:: python_project_template_AS.exceptions
3333
:members:
3434
:noindex:
3535

36-
.. automodule:: python_project_template.utils
36+
.. automodule:: python_project_template_AS.utils
3737
:members:
3838
:noindex:

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
sys.path.insert(0, os.path.abspath("../src"))
77

88
# -- Project information -----------------------------------------------------
9-
project = "python-project-template"
9+
project = "python-project-template-AS"
1010
author = "Andrea Scaglioni"
1111
# Keep in sync with pyproject.toml
1212
release = "0.1.0"

docs/structure.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Project Structure
44
The project has the following directory structure:
55
::
66

7-
src/python_project_template/ # Core library package
7+
src/python_project_template_AS/ # Core library package
88
calculator.py # Calculator API
99
operations.py # Built-in operations
1010
registry.py # Operation registry

docs/tests.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ Run the full PyTest test suite with coverage:
1717

1818
.. code-block:: bash
1919
20-
pytest -q --cov=python_project_template --cov-report=term --cov-report=html
20+
pytest -q --cov=python_project_template_AS --cov-report=term --cov-report=html
2121
2222
Open ``htmlcov/index.html`` to view the coverage report.

docs/usage.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ The following is a quick example for the Calculator API. It shows how to:
99

1010
.. code-block:: python
1111
12-
from python_project_template import default_calculator, Operation
12+
from python_project_template_AS import default_calculator, Operation
1313
1414
calc = default_calculator()
1515

src/python_project_template_AS/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""Top-level package for python_project_template.
1+
"""Top-level package for python_project_template_AS.
22
33
This package exposes the core types and a small set of convenience symbols
44
for the mini calculator demo project.

src/python_project_template_AS/calculator.py

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -33,21 +33,10 @@ def __init__(self, registry: Optional[OperationRegistry] = None):
3333
self.registry = registry
3434

3535
def register(self, op: Operation, *, replace: bool = False) -> None:
36-
"""Register an :class:`Operation` with the calculator's registry.
37-
38-
Args:
39-
op: Operation to register.
40-
replace: If True, replace an existing operation with the same name.
41-
"""
4236

4337
self.registry.register(op, replace=replace)
4438

4539
def apply(self, op_name: str, *args: Any) -> Any:
46-
"""Apply a named operation to the provided arguments.
47-
48-
Raises:
49-
OperationError: wraps underlying errors from the operation call.
50-
"""
5140

5241
op = self.registry.get(op_name)
5342
try:
@@ -60,12 +49,6 @@ def apply(self, op_name: str, *args: Any) -> Any:
6049
def compose(
6150
self, ops: Iterable[str], *, left_to_right: bool = True
6251
) -> Callable[[Any], Any]:
63-
"""Compose a sequence of unary operations into a callable.
64-
65-
Only supports unary operations (arity == 1). The returned function
66-
accepts a single value and applies the operations in the requested
67-
order.
68-
"""
6952

7053
op_list: List[Operation] = [self.registry.get(name) for name in ops]
7154
for op in op_list:
@@ -91,12 +74,6 @@ def composed(x):
9174
return composed
9275

9376
def chain(self, sequence: Iterable[Union[str, int]], initial: Any) -> Any:
94-
"""Apply a mixed sequence of operations to an initial value.
95-
96-
The sequence may contain operation names (str) and literal integer values.
97-
Binary operations consume the current value and the next literal.
98-
This helper is intentionally small and tailored for tests/examples.
99-
"""
10077

10178
seq = list(sequence)
10279
cur = initial

0 commit comments

Comments
 (0)