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
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ extend-ignore =
# E203 whitespace before ':' (to be compatible with black)
per-file-ignores =
scripts/create_pickle.py:F403,F405,
graphblas/tests/*.py:T201,
graphblas/tests/*.py:T201,B043,
graphblas/core/ss/matrix.py:SIM113,
graphblas/**/__init__.py:F401,
4 changes: 2 additions & 2 deletions .github/workflows/debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
strategy:
fail-fast: false
matrix:
pyver: [3.10]
pyver: [3.11]
testopts:
- "--blocking"
# - "--non-blocking --record --runslow"
Expand All @@ -26,7 +26,7 @@ jobs:
# - "conda-forge"
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
fetch-depth: 0
persist-credentials: false
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/imports.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
pyver: ${{ steps.pyver.outputs.selected }}
steps:
- name: RNG for os
uses: ddradar/choose-random-action@v3.0.0
uses: ddradar/choose-random-action@v4.1.0
id: os
with:
contents: |
Expand All @@ -26,14 +26,14 @@ jobs:
1
1
- name: RNG for Python version
uses: ddradar/choose-random-action@v3.0.0
uses: ddradar/choose-random-action@v4.1.0
id: pyver
with:
contents: |
3.10
3.11
3.12
3.13
3.14
weights: |
1
1
Expand All @@ -45,14 +45,14 @@ jobs:
# runs-on: ${{ matrix.os }}
# strategy:
# matrix:
# python-version: ["3.10", "3.11", "3.12", "3.13"]
# python-version: ["3.11", "3.12", "3.13", "3.14"]
# os: ["ubuntu-latest", "macos-latest", "windows-latest"]
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
with:
fetch-depth: 0
persist-credentials: false
- uses: actions/setup-python@v5
- uses: actions/setup-python@v6
with:
python-version: ${{ needs.rngs.outputs.pyver }}
# python-version: ${{ matrix.python-version }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ jobs:
name: pre-commit-hooks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
with:
fetch-depth: 0
persist-credentials: false
- uses: actions/setup-python@v5
- uses: actions/setup-python@v6
with:
python-version: "3.10"
python-version: "3.11"
- uses: pre-commit/action@v3.0.1
10 changes: 5 additions & 5 deletions .github/workflows/publish_pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,19 @@ on:
jobs:
build_and_deploy:
runs-on: ubuntu-latest
if: github.repository == 'python-graphblas/python-graphblas'
defaults:
run:
shell: bash -l {0}
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
fetch-depth: 0
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: "3.10"
python-version: "3.11"
- name: Install build dependencies
run: |
python -m pip install --upgrade pip
Expand All @@ -36,7 +35,8 @@ jobs:
- name: Check with twine
run: python -m twine check --strict dist/*
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@v1.12.4
uses: pypa/gh-action-pypi-publish@v1.13.0
if: startsWith(github.ref, 'refs/tags/') && github.repository == 'python-graphblas/python-graphblas'
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
344 changes: 192 additions & 152 deletions .github/workflows/test_and_build.yml

Large diffs are not rendered by default.

99 changes: 65 additions & 34 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,135 +16,166 @@ default_language_version:
python: python3
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
rev: v6.0.0
hooks:
- id: check-added-large-files
- id: check-case-conflict
- id: check-executables-have-shebangs
- id: check-illegal-windows-names
- id: check-merge-conflict
# - id: check-symlinks
- id: check-ast
- id: check-json # No json files yet
- id: check-toml
- id: check-yaml
- id: check-executables-have-shebangs
- id: check-vcs-permalinks
- id: debug-statements
- id: destroyed-symlinks
- id: detect-private-key
- id: debug-statements
- id: forbid-submodules
- id: end-of-file-fixer
exclude_types: [svg]
- id: mixed-line-ending
- id: trailing-whitespace
- id: name-tests-test
args: ["--pytest-test-first"]
- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.23
rev: v0.25
hooks:
- id: validate-pyproject
name: Validate pyproject.toml
# I don't yet trust ruff to do what autoflake does
- repo: https://github.com/PyCQA/autoflake
rev: v2.3.1
rev: v2.3.3
hooks:
- id: autoflake
args: [--in-place]
# We can probably remove `isort` if we come to trust `ruff --fix`,
# but we'll need to figure out the configuration to do this in `ruff`
- repo: https://github.com/pycqa/isort
rev: 6.0.0
rev: 8.0.1
hooks:
- id: isort
# Let's keep `pyupgrade` even though `ruff --fix` probably does most of it
- repo: https://github.com/asottile/pyupgrade
rev: v3.19.1
rev: v3.21.2
hooks:
- id: pyupgrade
args: [--py310-plus]
args: [--py311-plus]
- repo: https://github.com/MarcoGorelli/auto-walrus
rev: 0.3.4
rev: 0.4.1
hooks:
- id: auto-walrus
args: [--line-length, "100"]
- repo: https://github.com/psf/black
rev: 25.1.0
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 26.3.1
hooks:
- id: black
- id: black-jupyter
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.9.6
rev: v0.15.7
hooks:
- id: ruff
- id: ruff-check
args: [--fix-only, --show-fixes]
# Let's keep `flake8` even though `ruff` does much of the same.
# `flake8-bugbear` and `flake8-simplify` have caught things missed by `ruff`.
- repo: https://github.com/PyCQA/flake8
rev: 7.1.2
rev: 7.3.0
hooks:
- id: flake8
args: ["--config=.flake8"]
additional_dependencies:
&flake8_dependencies # These versions need updated manually
- flake8==7.1.2
- flake8-bugbear==24.12.12
- flake8-simplify==0.21.0
- flake8==7.3.0
- flake8-bugbear==25.11.29
- flake8-simplify==0.30.0
- repo: https://github.com/codespell-project/codespell
rev: v2.4.1
rev: v2.4.2
hooks:
- id: codespell
types_or: [python, rst, markdown]
additional_dependencies: [tomli]
types_or: [python, markdown, rst, toml, yaml]
additional_dependencies:
- tomli; python_version<'3.11'
files: ^(graphblas|docs)/
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.9.6
rev: v0.15.7
hooks:
- id: ruff
- id: ruff-check
# - id: ruff-format # Prefer black, but may temporarily uncomment this to see
- repo: https://github.com/sphinx-contrib/sphinx-lint
rev: v1.0.0
rev: v1.0.2
hooks:
- id: sphinx-lint
args: [--enable, all, "--disable=line-too-long,leaked-markup"]
# `pyroma` may help keep our package standards up to date if best practices change.
# This is probably a "low value" check though and safe to remove if we want faster pre-commit.
- repo: https://github.com/regebro/pyroma
rev: "4.2"
rev: "5.0.1"
hooks:
- id: pyroma
args: [-n, "10", .]
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: "v0.10.0.1"
rev: "v0.11.0.1"
hooks:
- id: shellcheck
- repo: https://github.com/rbubley/mirrors-prettier
rev: v3.5.1
rev: v3.8.1
hooks:
- id: prettier
args: [--prose-wrap=preserve]
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.10.0
hooks:
- id: rst-backticks
- id: rst-directive-colons
- id: rst-inline-touching-normal
- id: python-check-blanket-noqa
- id: python-check-blanket-type-ignore
- id: python-no-eval
- id: python-no-log-warn
- id: text-unicode-replacement-char
- repo: https://github.com/ComPWA/taplo-pre-commit
rev: v0.9.3
hooks:
- id: taplo-format
- repo: https://github.com/rhysd/actionlint
rev: v1.7.7
rev: v1.7.11
hooks:
- id: actionlint
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.31.1
rev: 0.37.0
hooks:
- id: check-dependabot
- id: check-github-workflows
- id: check-readthedocs
- repo: https://github.com/adrienverge/yamllint
rev: v1.35.1
rev: v1.38.0
hooks:
- id: yamllint
- repo: https://github.com/woodruffw/zizmor-pre-commit
rev: v1.3.1
hooks:
- id: zizmor
# - repo: https://github.com/woodruffw/zizmor-pre-commit
# rev: v1.14.2
# hooks:
# - id: zizmor
- repo: meta
hooks:
- id: check-hooks-apply
- id: check-useless-excludes
- repo: local
hooks:
- id: disallow-caps
name: Disallow improper capitalization
language: pygrep
entry: PyBind|Numpy\>|Cmake|CCache|Github|PyTest|\<RST\>|PyLint
exclude: (.pre-commit-config.yaml|docs/pages/guides/style\.md)$
- id: disallow-words
name: Disallow certain words
language: pygrep
entry: "[Ff]alsey"
exclude: .pre-commit-config.yaml$
- id: disallow-bad-permalinks
name: Disallow _ in permalinks
language: pygrep
entry: "^permalink:.*_.*"
# Add `--hook-stage manual` to pre-commit command to run (very slow)
# It's probably better (and faster!) to simply run `pylint graphblas/some/file.py`
- id: pylint
Expand All @@ -156,7 +187,7 @@ repos:
args: [graphblas/]
pass_filenames: false
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
rev: v6.0.0
hooks:
- id: no-commit-to-branch # no commit directly to main
#
Expand Down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ For algorithms, see
- **SuiteSparse:GraphBLAS User Guide:** [https://github.com/DrTimothyAldenDavis/GraphBLAS/raw/stable/Doc/GraphBLAS_UserGuide.pdf](https://github.com/DrTimothyAldenDavis/GraphBLAS/raw/stable/Doc/GraphBLAS_UserGuide.pdf)
- **Source:** [https://github.com/python-graphblas/python-graphblas](https://github.com/python-graphblas/python-graphblas)
- **Bug reports:** [https://github.com/python-graphblas/python-graphblas/issues](https://github.com/python-graphblas/python-graphblas/issues)
- **Github discussions:** [https://github.com/python-graphblas/python-graphblas/discussions](https://github.com/python-graphblas/python-graphblas/discussions)
- **GitHub discussions:** [https://github.com/python-graphblas/python-graphblas/discussions](https://github.com/python-graphblas/python-graphblas/discussions)
- **Weekly community call:** [python-graphblas#247](https://github.com/python-graphblas/python-graphblas/issues/247) or [https://scientific-python.org/calendars/](https://scientific-python.org/calendars/)
- **Chat via Discord:** [https://discord.com/invite/vur45CbwMz](https://discord.com/invite/vur45CbwMz) in the [#graphblas channel](https://discord.com/channels/786703927705862175/1024732940233605190)

Expand Down Expand Up @@ -58,8 +58,7 @@ The following are not required by python-graphblas, but may be needed for certai
- `pandas` – required for nicer `__repr__`;
- `matplotlib` – required for basic plotting of graphs;
- `scipy` – used in `io` module to read/write `scipy.sparse` format;
- `networkx` – used in `io` module to interface with `networkx` graphs;
- `fast-matrix-market` - for faster read/write of Matrix Market files with `gb.io.mmread` and `gb.io.mmwrite`.
- `networkx` – used in `io` module to interface with `networkx` graphs.

## Description

Expand Down
2 changes: 1 addition & 1 deletion dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ pyyaml
pandas
# For I/O
awkward
fast_matrix_market
# fast_matrix_market is deprecated (no longer maintained; last supported Python is 3.12)
networkx
scipy
sparse
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# -- Project information -----------------------------------------------------

project = "python-graphblas"
copyright = "2020-2023, Anaconda, Inc. and contributors"
copyright = "2020-2026, Anaconda, Inc. and contributors"
author = "Anaconda, Inc"

# The full version, including alpha/beta/rc tags
Expand Down
2 changes: 1 addition & 1 deletion docs/env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ channels:
- conda-forge
- nodefaults
dependencies:
- python=3.10
- python=3.11
- pip
# python-graphblas dependencies
- donfig
Expand Down
1 change: 0 additions & 1 deletion docs/getting_started/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ to work.
- `matplotlib <https://matplotlib.org>`__ -- required for basic plotting of graphs
- `scipy <https://scipy.org/>`__ -- used in ``io`` module to read/write ``scipy.sparse`` format
- `networkx <https://networkx.org>`__ -- used in ``io`` module to interface with networkx graphs
- `fast-matrix-market <https://github.com/alugowski/fast_matrix_market>`__ -- for faster read/write of Matrix Market files with ``gb.io.mmread`` and ``gb.io.mmwrite``

GraphBLAS Fundamentals
----------------------
Expand Down
2 changes: 0 additions & 2 deletions docs/user_guide/io.rst
Original file line number Diff line number Diff line change
Expand Up @@ -146,5 +146,3 @@ and ``gb.io.mmwrite()`` to write a Matrix to a Matrix Market file.
These names match the equivalent functions in `scipy.sparse <https://docs.scipy.org/doc/scipy/reference/generated/scipy.io.mmread.html>`_.

``scipy`` is required to be installed to read Matrix Market files.
If ``fast_matrix_market`` is installed, it will be used by default for
`much better performance <https://github.com/alugowski/fast_matrix_market>`_.
1 change: 1 addition & 0 deletions graphblas/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ def get_config():
"core",
"dtypes",
"exceptions",
"indexbinary",
"indexunary",
"io",
"monoid",
Expand Down
Loading
Loading