-
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.
feat: simplify how the BedReader and BedWriter work
- Loading branch information
Showing
17 changed files
with
1,009 additions
and
1,071 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
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 |
---|---|---|
@@ -1,39 +1,94 @@ | ||
# Development and Testing | ||
|
||
## Local Installation | ||
## Primary Development Commands | ||
|
||
First install the Python packaging and dependency management tool [`poetry`](https://python-poetry.org/docs/#installation). | ||
You must have Python 3.12 or greater available on your system path, which could be managed by [`pyenv`](https://github.com/pyenv/pyenv) or another package manager. | ||
Finally, install the dependencies of the project with: | ||
To check and resolve linting issues in the codebase, run: | ||
|
||
```console | ||
poetry install | ||
poetry run ruff check --fix | ||
``` | ||
|
||
## Running Tests | ||
To check and resolve formatting issues in the codebase, run: | ||
|
||
To test the codebase, run the following command: | ||
```console | ||
poetry run ruff format | ||
``` | ||
|
||
To check the unit tests in the codebase, run: | ||
|
||
```console | ||
poetry run pytest | ||
``` | ||
|
||
The command will: | ||
To check the typing in the codebase, run: | ||
|
||
- Execute unit tests with [`pytest`](https://docs.pytest.org/) | ||
- Test the language typing with [`mypy`](https://mypy-lang.org/) | ||
- Test for linting and styling errors with [`ruff`](https://docs.astral.sh/ruff/) | ||
- Emit a testing coverage report with [`coverage`](https://coverage.readthedocs.io/) | ||
```console | ||
poetry run mypy | ||
``` | ||
|
||
To format the code in the library, run the following commands: | ||
To generate a code coverage report after testing locally, run: | ||
|
||
```console | ||
poetry run ruff check --select I --fix | ||
poetry run ruff format bedspec tests | ||
poetry run coverage html | ||
``` | ||
|
||
To generate a code coverage report locally, run the following command: | ||
To check the lock file is up to date: | ||
|
||
```console | ||
poetry run coverage html | ||
poetry check --lock | ||
``` | ||
|
||
## Shortcut Task Commands | ||
|
||
To be able to run shortcut task commands, first install the Poetry plugin [`poethepoet`](https://poethepoet.natn.io/index.html): | ||
|
||
```console | ||
poetry self add 'poethepoet[poetry_plugin]' | ||
``` | ||
|
||
> [!NOTE] | ||
> Upon the release of Poetry [v2.0.0](https://github.com/orgs/python-poetry/discussions/9793#discussioncomment-11043205), Poetry will automatically support bootstrap installation of [project-specific plugins](https://github.com/python-poetry/poetry/pull/9547) and installation of the task runner will become automatic for this project. | ||
> The `pyproject.toml` syntax will be: | ||
> | ||
> ```toml | ||
> [tool.poetry] | ||
> requires-poetry = ">=2.0" | ||
> | ||
> [tool.poetry.requires-plugins] | ||
> poethepoet = ">=0.29" | ||
> ``` | ||
###### For Running Individual Checks | ||
```console | ||
poetry task check-lock | ||
poetry task check-format | ||
poetry task check-lint | ||
poetry task check-tests | ||
poetry task check-typing | ||
``` | ||
###### For Running All Checks | ||
|
||
```console | ||
poetry task check-all | ||
``` | ||
|
||
###### For Running Individual Fixes | ||
|
||
```console | ||
poetry task fix-format | ||
poetry task fix-lint | ||
``` | ||
|
||
###### For Running All Fixes | ||
|
||
```console | ||
poetry task fix-all | ||
``` | ||
|
||
###### For Running All Fixes and Checks | ||
|
||
```console | ||
poetry task fix-and-check-all | ||
``` |
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.