Skip to content
Merged
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
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Release
uses: patrick-kidger/action_update_python_project@v7
uses: patrick-kidger/action_update_python_project@v8
with:
python-version: "3.11"
test-script: |
cp -r ${{ github.workspace }}/tests ./tests
cp ${{ github.workspace }}/pyproject.toml ./pyproject.toml
uv sync --extra dev --no-install-project --inexact
uv sync --extra tests --no-install-project --inexact
uv run --no-sync pytest
pypi-token: ${{ secrets.pypi_token }}
github-user: patrick-kidger
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
run-test:
strategy:
matrix:
python-version: [ "3.11" ]
python-version: [ "3.11", "3.13" ]
os: [ ubuntu-latest ]
fail-fast: false
runs-on: ${{ matrix.os }}
Expand All @@ -23,11 +23,12 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install '.[dev]'
python -m pip install '.[dev,tests]'

- name: Checks with pre-commit
uses: pre-commit/[email protected]
run: |
pre-commit run --all-files

- name: Test with pytest
run: |
python -m pytest
pytest
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ examples/multipart_serialised.eqx
.python-version
.DS_Store
.venv
uv.lock
7 changes: 4 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,16 @@ repos:
files: ^pyproject\.toml$
additional_dependencies: ["toml-sort==0.23.1"]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.4
rev: v0.13.0
hooks:
- id: ruff-format # formatter
types_or: [python, pyi, jupyter, toml]
- id: ruff # linter
types_or: [python, pyi, jupyter, toml]
args: [--fix]
- repo: https://github.com/RobertCraigie/pyright-python
rev: v1.1.379
rev: v1.1.405
hooks:
- id: pyright
additional_dependencies: [numpy, pytest]
additional_dependencies:
[pytest]
40 changes: 40 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Contributing

Contributions (pull requests) are very welcome! Here's how to get started.

---

**Getting started**

First fork the library on GitHub.

Then clone and install the library:

```bash
git clone https://github.com/your-username-here/tinyio.git
cd tinyio
pip install -e '.[dev]'
pre-commit install # `pre-commit` is installed by `pip` on the previous line
```

---

**If you're making changes to the code:**

Now make your changes. Make sure to include additional tests if necessary.

Next verify the tests all pass:

```bash
pip install -e '.[tests]'
pytest # `pytest` is installed by `pip` on the previous line.
```

Then push your changes back to your fork of the repository:

```bash
git push
```

Finally, open a pull request on GitHub!

7 changes: 6 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,14 @@ urls = {repository = "https://github.com/patrick-kidger/tinyio"}
version = "0.2.0"

[project.optional-dependencies]
dev = ["pre-commit", "pytest"]
dev = ["pre-commit"]
tests = ["pytest"]

[tool.hatch.build]
include = ["tinyio/*"]
reportFunctionMemberAccess = false
reportIncompatibleMethodOverride = true
reportIncompatibleVariableOverride = false

[tool.pyright]
include = ["tinyio", "tests"]
Expand All @@ -48,5 +52,6 @@ select = ["E", "F", "I001", "UP"]

[tool.ruff.lint.isort]
combine-as-imports = true
extra-standard-library = ["typing_extensions"]
lines-after-imports = 2
order-by-type = true
4 changes: 2 additions & 2 deletions tinyio/_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def _step(
for out_i in out:
if isinstance(out_i, Generator):
if out_i not in self._results.keys() and out_i not in waiting_on.keys():
if out_i.gi_frame is None:
if out_i.gi_frame is None: # pyright: ignore[reportAttributeAccessIssue]
todo.coro.throw(_already_finished(out_i))
queue.appendleft(_Todo(out_i, None))
waiting_on[out_i] = []
Expand All @@ -184,7 +184,7 @@ def _step(
elif out_i in waiting_on.keys():
waiting_on[out_i].append(waiting_for)
else:
if out_i.gi_frame is None:
if out_i.gi_frame is None: # pyright: ignore[reportAttributeAccessIssue]
todo.coro.throw(_already_finished(out_i))
queue.appendleft(_Todo(out_i, None))
waiting_on[out_i] = [waiting_for]
Expand Down