Skip to content

Commit

Permalink
Merge pull request #5 from mmcdermott/dev
Browse files Browse the repository at this point in the history
Release Candidate 0.1
  • Loading branch information
mmcdermott authored Oct 14, 2024
2 parents deb7636 + 70b8d46 commit 5fb0481
Show file tree
Hide file tree
Showing 21 changed files with 488 additions and 617 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/code-quality-main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,9 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Install packages
run: |
pip install -e .[dev]
- name: Run pre-commits
uses: pre-commit/[email protected]
4 changes: 4 additions & 0 deletions .github/workflows/code-quality-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Install packages
run: |
pip install -e .[dev]
- name: Find modified files
id: file_changes
uses: trilom/[email protected]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/python-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ jobs:
path: dist/

- name: Sign the dists with Sigstore
uses: sigstore/gh-action-sigstore-python@v2.1.1
uses: sigstore/gh-action-sigstore-python@v3.0.0
with:
inputs: >-
./dist/*.tar.gz
Expand Down
26 changes: 23 additions & 3 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,39 @@ jobs:

- name: Install packages
run: |
pip install -e .[tests,tqdmable,tensorable]
pip install -e .[tests]
#----------------------------------------------
# run test suite
#----------------------------------------------
- name: Run tests
- name: Run non-torch tests
run: |
pytest -v --doctest-modules --cov=src --junitxml=junit.xml -s --ignore=docs
pytest -v --doctest-modules --cov=src --junitxml=junit.xml -s --ignore=docs --ignore=tests/test_torch.py
- name: Upload coverage to Codecov
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}

- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}

- name: Install torch as well
run: |
pip install torch
- name: Run torch tests
run: |
pytest -v --cov=src --junitxml=junit.xml -s tests/test_torch.py
- name: Upload coverage to Codecov
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}

- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@v1
Expand Down
6 changes: 2 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@ classifiers = [
dependencies = ["numpy"]

[project.optional-dependencies]
dev = ["pre-commit"]
tests = ["pytest", "pytest-cov"]
tqdmable = ["tqdm"]
tensorable = ["torch"]
dev = ["pre-commit<4"]
tests = ["pytest", "pytest-cov", "pytest-benchmark"]

[tool.setuptools_scm]

Expand Down
29 changes: 1 addition & 28 deletions src/mixins/__init__.py
Original file line number Diff line number Diff line change
@@ -1,31 +1,4 @@
from .debuggable import DebuggableMixin
from .multiprocessingable import MultiprocessingMixin
from .saveable import SaveableMixin
from .seedable import SeedableMixin
from .swapcacheable import SwapcacheableMixin
from .timeable import TimeableMixin

__all__ = [
"DebuggableMixin",
"MultiprocessingMixin",
"SaveableMixin",
"SeedableMixin",
"SwapcacheableMixin",
"TimeableMixin",
]

# Tensorable and Tqdmable rely on packages that may or may not be installed.

try:
from .tensorable import TensorableMixin # noqa

__all__.append("TensorableMixin")
except ImportError:
pass

try:
from .tqdmable import TQDMableMixin # noqa

__all__.append("TQDMableMixin")
except ImportError:
pass
__all__ = ["SeedableMixin", "TimeableMixin"]
47 changes: 0 additions & 47 deletions src/mixins/debuggable.py

This file was deleted.

32 changes: 0 additions & 32 deletions src/mixins/multiprocessingable.py

This file was deleted.

85 changes: 0 additions & 85 deletions src/mixins/saveable.py

This file was deleted.

Loading

0 comments on commit 5fb0481

Please sign in to comment.