Skip to content

Commit

Permalink
add details without hatch
Browse files Browse the repository at this point in the history
  • Loading branch information
drkane committed Jul 12, 2024
1 parent 72d44f0 commit d094f09
Showing 1 changed file with 60 additions and 1 deletion.
61 changes: 60 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ and [XBRL International](https://www.xbrl.org/). This tool is not affiliated wit

The module requires [BeautifulSoup](https://www.crummy.com/software/BeautifulSoup/bs4/doc/) and [lxml](https://lxml.de/) to parse the documents.

If you're using Python 3.13 you may need to ensure that the `libxml2-dev` and `libxslt-dev` packages have been installed.

[word2number](https://github.com/akshaynagpal/w2n) is used to process the
numeric items with the `numsenwords` format.

Expand Down Expand Up @@ -60,7 +62,7 @@ You can also use as a python module (see [the documentation](https://ixbrl-parse

## Development

The module is setup for development using [hatch](https://hatch.pypa.io/latest/).
The module is setup for development using [hatch](https://hatch.pypa.io/latest/). It should be possible to run tests and linting without needed hatch, however.

### Run tests

Expand All @@ -70,6 +72,13 @@ Tests can be run with `pytest`:
hatch run test
```

Without hatch, you'll need to run:

```bash
pip install -e .[test]
python -m pytest tests
```

### Test coverage

Run tests then report on coverage
Expand All @@ -78,18 +87,43 @@ Run tests then report on coverage
hatch run cov
```

Without hatch, you'll need to run:

```bash
pip install -e .[test]
coverage run -m pytest tests
coverage report
```

Run tests then run a server showing where coverage is missing

```bash
hatch run cov-html
```

Without hatch, you'll need to run:

```bash
pip install -e .[test]
coverage run -m pytest tests
coverage report
coverage html
python -m http.server -d htmlcov
```

### Run typing checks

```bash
hatch run lint:typing
```

Without hatch, you'll need to run:

```bash
pip install -e .[lint]
mypy --install-types --non-interactive src/ixbrlparse tests
```

### Linting

Ruff should be run before committing any changes.
Expand All @@ -100,18 +134,43 @@ To check for any changes needed:
hatch run lint:style
```

Without hatch, you'll need to run:

```bash
pip install -e .[lint]
ruff check .
ruff format --check --diff .
```

To run any autoformatting possible:

```sh
hatch run lint:fmt
```

Without hatch, you'll need to run:

```bash
pip install -e .[lint]
ruff format .
ruff check --fix .
```

### Run all checks at once

```sh
hatch run lint:all
```

Without hatch, you'll need to run:

```bash
pip install -e .[lint]
ruff check .
ruff format --check --diff .
mypy --install-types --non-interactive src/ixbrlparse tests
```

## Publish to pypi

```bash
Expand Down

0 comments on commit d094f09

Please sign in to comment.