-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: overall tidy up of README, docstrings + Sphinx docs
- Loading branch information
Showing
9 changed files
with
205 additions
and
206 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,13 +6,14 @@ Contributors and contributions are welcome. Please read these guidelines first. | |
|
||
The project homepage is on [GitHub](https://github.com/sr-murthy/fsrapiclient). | ||
|
||
Contributors can open pull requests from a fork targeting the parent `main`[branch](https://github.com/sr-murthy/fsrapiclient/tree/main). Butit may be a good first step to create an[issue](https://github.com/sr-murthy/fsrapiclient/issues) or open a [discussion topic](https://github.com/sr-murthy/fsrapiclient/discussions). | ||
Contributors can open pull requests from a fork targeting the parent [main branch](https://github.com/sr-murthy/fsrapiclient/tree/main). But it may be a good first step to create an [issue](https://github.com/sr-murthy/fsrapiclient/issues) or open a | ||
[discussion topic](https://github.com/sr-murthy/fsrapiclient/discussions). | ||
|
||
A simple Git workflow, using a feature and/or fix branch created off the`main` branch of your fork, is recommended. | ||
A simple Git workflow, using a feature and/or fix branch created off the `main` branch of your fork, is recommended. | ||
|
||
## Repo | ||
|
||
If you wish to contribute please first ensure you have [SSH access toGitHub](https://docs.github.com/en/authentication/connecting-to-github-with-ssh). This basically involves creating a project-specific SSH keypair - if you don't already have one - and adding it to GitHub. If you have done this successfully then this verification step should work: | ||
If you wish to contribute please first ensure you have [SSH access to GitHub](https://docs.github.com/en/authentication/connecting-to-github-with-ssh). This basically involves creating a project-specific SSH keypair - if you don’t already have one - and adding it to GitHub. If you have done this successfully then this verification step should work: | ||
|
||
``` shell | ||
ssh -vT [email protected] | ||
|
@@ -41,13 +42,12 @@ git clone git+ssh://[email protected]/<fork user>/fsrapiclient | |
|
||
You can create additional remotes for the parent project to enable easier syncing, or you can simply create PRs directly against the parent project. | ||
|
||
## Dependencies & PDM | ||
## Dependencies & PDM `cubes` | ||
|
||
The package has only [`requests`](https://requests.readthedocs.io/en/latest/) as a (production) dependency - this and its sub-dependencies are automatically installed on installing the package. | ||
The package only depends on the [requests](https://requests.readthedocs.io/en/latest/) library. | ||
|
||
Development dependencies are specified in the `[tool.pdm.dev-dependencies]` section of the [project | ||
TOML](https://github.com/sr-murthy/fsrapiclient/blob/main/pyproject.toml), but they are not mandatory. Of these, the most important are probably the `'test'` dependencies, including [pytest](https://docs.pytest.org/en/8.0.x/) and | ||
[pytest-cov](https://pytest-cov.readthedocs.io/): | ||
TOML](https://github.com/sr-murthy/fsrapiclient/blob/main/pyproject.toml), but they are not mandatory. Of these, the most important are probably the `'test'` dependencies, including [pytest](https://docs.pytest.org/en/8.0.x/) and [pytest-cov](https://pytest-cov.readthedocs.io/): | ||
|
||
``` toml | ||
test = [ | ||
|
@@ -60,9 +60,8 @@ test = [ | |
|
||
[PDM](https://pdm-project.org/latest) is used (by myself, currently, the sole maintainer) to manage all dependencies and publish packages to PyPI. It is also used to automate certain tasks, such as running tests, as described in the section. | ||
|
||
There are no root-level `requirements*.txt` files - but only a single (default, version-controlled, cross-platform) [pdm.lock](https://github.com/sr-murthy/fsrapiclient/blob/main/pdm.lock) lockfile, which defines metadata for all TOML-defined development | ||
dependencies, including the currently empty set of production dependencies, and their sub-dependencies etc. This can be used to | ||
install all development dependencies, including the project itself, in editable mode where available: | ||
There are no root-level `requirements*.txt` files - but only a single (default, version-controlled, cross-platform) | ||
[pdm.lock](https://github.com/sr-murthy/fsrapiclient/blob/main/pdm.lock) lockfile, which defines metadata for all TOML-defined development dependencies, including the currently empty set of production dependencies, and their sub-dependencies etc. This can be used to install all development dependencies, including the project itself, in editable mode where available: | ||
|
||
``` shell | ||
pdm install -v --dev | ||
|
@@ -71,7 +70,7 @@ pdm install -v --dev | |
> [!NOTE] | ||
> It is important to note that `pdm install` uses either the default lockfile (`pdm.lock`), or one specified with `-L <lockfile>`. Multiple lockfiles can be generated and maintained. Refer to the [PDM install documentation](https://pdm-project.org/latest/reference/cli/#install) for more information. | ||
If you don't wish to install any editable dependencies, including the project itself, you can use: | ||
If you don’t wish to install any editable dependencies, including the project itself, you can use: | ||
|
||
``` shell | ||
pdm install -v --dev --no-editable --no-self | ||
|
@@ -97,8 +96,8 @@ For more information on PDM lockfiles and installing requirements see the [PDM d | |
|
||
Tests are defined in the `tests` folder, and should be run with [pytest](https://pytest-cov.readthedocs.io/en/latest/). | ||
|
||
For convenience different types of test targets are defined in the [Makefile](https://github.com/sr-murthy/fsrapiclient/blob/main/Makefile): `lint` for Ruff linting, `doctests` for running [doctests](https://docs.python.org/3/library/doctest.html) and `unittests` for running unittests and measuring coverage, using `pytest` | ||
and the `pytest-cov` plugin: | ||
For convenience different types of test targets are defined in the[Makefile](https://github.com/sr-murthy/fsrapiclient/blob/main/Makefile): lint` for Ruff linting, `doctests` for running [doctests](https://docs.python.org/3/library/doctest.html) and | ||
`unittests` for running unittests and measuring coverage, using `pytest` and the `pytest-cov` plugin: | ||
|
||
``` shell | ||
make lint | ||
|
@@ -115,25 +114,22 @@ Unit tests can be run all at once using `make unittests` or individually using ` | |
python -m pytest -sv tests/units/test_api.py::TestFsrApiClient | ||
``` | ||
|
||
> [!NOTE] | ||
> The `-s` option in the `pytest` command is to allow interactive environments to be entered on errors, e.g. debugger breakpoints. The default behaviour of [capturing console input/output](https://docs.pytest.org/en/stable/how-to/capture-stdout-stderr.html#default-stdout-stderr-stdin-capturing-behaviour) would otherwise prevent debuggers from being triggered. | ||
The doctests serve as acceptance tests, and are best run after the unit tests. They can be run all at once using `make doctests`, or individually by library using `python -m doctest`, e.g. running all the doctests in `fsrapiclient.api`: | ||
|
||
``` shell | ||
python -m doctest -v src/fsrapiclient/api.py | ||
``` | ||
|
||
## Documentation | ||
## Documentation `book` | ||
|
||
Detailed documentation can be found [here](https://fsrapiclient.readthedocs.io). | ||
|
||
## CI | ||
## CI `circle-play` | ||
|
||
The CI pipelines are defined in the [CI YML](https://github.com/sr-murthy/fsrapiclient/blob/main/.github/workflows/ci.yml) | ||
and the [CodeQL Analysis YML](https://github.com/sr-murthy/fsrapiclient/blob/main/.github/workflows/codeql-analysis.yml). Currently, pipelines for all branches include a tests stage that includes Ruff linting, unit tests, Python doctests, and in that order. | ||
|
||
## Versioning and Releases | ||
## Versioning and Releases `upload` | ||
|
||
The [PyPI package](https://pypi.org/project/fsrapiclient/) is currently at version `0.2.1`. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.