Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install .
python -m pip install ruff
- name: Lint
run: python -m ruff check .
- name: Test with python unittest
run: python -m unittest
run: python -m pip --disable-pip-version-check install nox
- name: Lint & Test
run: nox
6 changes: 2 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ name: Upload Python Package

on:
release:
types: [ published ]
types: [published]

permissions:
contents: read
Expand All @@ -25,9 +25,7 @@ jobs:
with:
python-version: '3.9'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
run: python -m pip --disable-pip-version-check install build
- name: Build package
run: python -m build
- name: Publish package
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.nox/
.tox/
.ruff_cache/
.coverage
.coverage.*
.cache
Expand Down
17 changes: 13 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,18 +195,27 @@ with \
```

## Documentation

The full documentation is available in the `docs` folder with a readable version on [Read the Docs](https://trsfile.readthedocs.io/).

## Contributing

### Testing
The library supports Python `unittest` module and the tests can be executed with the following command:
```
python -m unittest
Anyone is free to open a pull request.

### Testing / Developing

The library has tests and a linter has been set up for it. Both can be run with the following command:

```sh
nox
```

Install the `nox` executable (in a virtual environment) using `python -m pip install -r ./requirements.txt`.

### Creating Releases

We use Github Actions to publish packages to PYPy. Read the [Github docs on how to create a new release](https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository) and trigger the publishing workflow:

## License

[BSD 3-Clause Clear License](https://choosealicense.com/licenses/bsd-3-clause-clear/)
11 changes: 11 additions & 0 deletions noxfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import nox
import nox.project


@nox.session(reuse_venv=True)
def lint(session: nox.Session) -> None:
requirements = nox.project.load_toml("pyproject.toml")["project"]["optional-dependencies"]["DEV"]
session.install(*requirements)
session.install("-e", ".")
session.run("ruff", "check")
session.run("python", "-m", "unittest", "discover")
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,12 @@ dependencies = [

[project.optional-dependencies]
DEV = [
"m2r2",
"numpy",
"ruff",
"sphinx",
"sphinx-autobuild",
"sphinx_rtd_theme",
"m2r2"
]

[project.urls]
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nox
Loading