diff --git a/.codecov.yml b/.codecov.yml index 1720ac027..7a57a7568 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -1,3 +1,12 @@ +coverage: + status: + project: + default: + informational: true + patch: + default: + informational: true + changes: false comment: off ignore: - graphblas/viz.py diff --git a/.github/workflows/imports.yml b/.github/workflows/imports.yml index 753ce5162..18be6256a 100644 --- a/.github/workflows/imports.yml +++ b/.github/workflows/imports.yml @@ -33,17 +33,19 @@ jobs: 3.9 3.10 3.11 + 3.12 weights: | 1 1 1 + 1 test_imports: needs: rngs runs-on: ${{ needs.rngs.outputs.os }} # runs-on: ${{ matrix.os }} # strategy: # matrix: - # python-version: ["3.9", "3.10", "3.11"] + # python-version: ["3.9", "3.10", "3.11", "3.12"] # os: ["ubuntu-latest", "macos-latest", "windows-latest"] steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/test_and_build.yml b/.github/workflows/test_and_build.yml index e3930a853..b1ca58616 100644 --- a/.github/workflows/test_and_build.yml +++ b/.github/workflows/test_and_build.yml @@ -112,10 +112,12 @@ jobs: 3.9 3.10 3.11 + 3.12 weights: | 1 1 1 + 1 - name: RNG for source of python-suitesparse-graphblas uses: ddradar/choose-random-action@v2.0.2 id: sourcetype @@ -178,11 +180,16 @@ jobs: spver=$(python -c 'import random ; print(random.choice(["=1.8", "=1.9", "=1.10", "=1.11", ""]))') pdver=$(python -c 'import random ; print(random.choice(["=1.3", "=1.4", "=1.5", "=2.0", "=2.1", ""]))') akver=$(python -c 'import random ; print(random.choice(["=1.9", "=1.10", "=2.0", "=2.1", "=2.2", "=2.3", "=2.4", ""]))') - else # Python 3.11 + elif [[ ${{ startsWith(steps.pyver.outputs.selected, '3.11') }} == true ]]; then npver=$(python -c 'import random ; print(random.choice(["=1.23", "=1.24", "=1.25", "=1.26", ""]))') spver=$(python -c 'import random ; print(random.choice(["=1.9", "=1.10", "=1.11", ""]))') pdver=$(python -c 'import random ; print(random.choice(["=1.5", "=2.0", "=2.1", ""]))') akver=$(python -c 'import random ; print(random.choice(["=1.10", "=2.0", "=2.1", "=2.2", "=2.3", "=2.4", ""]))') + else # Python 3.12 + npver=$(python -c 'import random ; print(random.choice(["=1.26", ""]))') + spver=$(python -c 'import random ; print(random.choice(["=1.11", ""]))') + pdver=$(python -c 'import random ; print(random.choice(["=2.1", ""]))') + akver=$(python -c 'import random ; print(random.choice(["=2.4", ""]))') fi if [[ ${{ steps.sourcetype.outputs.selected }} == "source" || ${{ steps.sourcetype.outputs.selected }} == "upstream" ]]; then # TODO: there are currently issues with some numpy versions when @@ -195,16 +202,23 @@ jobs: # That is, we don't need to support versions of it that are two years old. # But, it's still useful for us to test with different versions! psg="" - if [[ ${{ steps.sourcetype.outputs.selected}} == "conda-forge" ]] ; then - psgver=$(python -c 'import random ; print(random.choice(["=7.4.0", "=7.4.1", "=7.4.2", "=7.4.3.0", "=7.4.3.1", "=7.4.3.2", "=8.0.2.1", ""]))') + if [[ ${{ steps.sourcetype.outputs.selected}} == "upstream" ]] ; then + psgver="" + elif [[ ${{ startsWith(steps.pyver.outputs.selected, '3.12') }} == true ]] ; then + if [[ ${{ steps.sourcetype.outputs.selected}} == "conda-forge" ]] ; then + psgver=$(python -c 'import random ; print(random.choice(["=8.2.0.1", ""]))') + psg=python-suitesparse-graphblas${psgver} + else + psgver=$(python -c 'import random ; print(random.choice(["==8.2.0.1", ""]))') + fi + elif [[ ${{ steps.sourcetype.outputs.selected}} == "conda-forge" ]] ; then + psgver=$(python -c 'import random ; print(random.choice(["=7.4.0", "=7.4.1", "=7.4.2", "=7.4.3.0", "=7.4.3.1", "=7.4.3.2", "=8.0.2.1", "=8.2.0.1", ""]))') psg=python-suitesparse-graphblas${psgver} elif [[ ${{ steps.sourcetype.outputs.selected}} == "wheel" ]] ; then - psgver=$(python -c 'import random ; print(random.choice(["==7.4.3.2", "==8.0.2.1", ""]))') + psgver=$(python -c 'import random ; print(random.choice(["==7.4.3.2", "==8.0.2.1", "==8.2.0.1", ""]))') elif [[ ${{ steps.sourcetype.outputs.selected}} == "source" ]] ; then # These should be exact versions - psgver=$(python -c 'import random ; print(random.choice(["==7.4.0.0", "==7.4.1.0", "==7.4.2.0", "==7.4.3.0", "==7.4.3.1", "==7.4.3.2", "==8.0.2.1", ""]))') - else - psgver="" + psgver=$(python -c 'import random ; print(random.choice(["==7.4.0.0", "==7.4.1.0", "==7.4.2.0", "==7.4.3.0", "==7.4.3.1", "==7.4.3.2", "==8.0.2.1", "==8.2.0.1", ""]))') fi if [[ ${npver} == "=1.26" ]] ; then numbaver="" @@ -258,10 +272,15 @@ jobs: numba=numba${numbaver} sparse=sparse${sparsever} fi + if [[ ${{ startsWith(steps.pyver.outputs.selected, '3.12') }} == true ]]; then + coveralls="" + else + coveralls="coveralls=3.3.1" + fi echo "versions: np${npver} sp${spver} pd${pdver} ak${akver} nx${nxver} numba${numbaver} yaml${yamlver} sparse${sparsever} psg${psgver}" set -x # echo on - $(command -v mamba || command -v conda) install packaging pytest coverage coveralls=3.3.1 pytest-randomly cffi donfig tomli c-compiler make \ + $(command -v mamba || command -v conda) install packaging pytest coverage ${coveralls} pytest-randomly cffi donfig tomli c-compiler make \ pyyaml${yamlver} ${sparse} pandas${pdver} scipy${spver} numpy${npver} ${awkward} \ networkx${nxver} ${numba} ${fmm} ${psg} \ ${{ matrix.slowtask == 'pytest_bizarro' && 'black' || '' }} \ @@ -397,11 +416,15 @@ jobs: if: matrix.slowtask == 'pytest_bizarro' run: | # This step uses `black` + if [[ ${{ startsWith(steps.pyver.outputs.selected, '3.12') }} == true ]]; then + pip install black # Latest version of black on conda-forge does not have builds for Python 3.12 + fi coverage run -a -m graphblas.core.automethods coverage run -a -m graphblas.core.infixmethods git diff --exit-code - name: Coverage1 id: coverageAttempt1 + if: startsWith(steps.pyver.outputs.selected, '3.12') != true continue-on-error: true env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 565e1dc0d..ee6600327 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -16,7 +16,7 @@ default_language_version: python: python3 repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v4.5.0 hooks: - id: check-added-large-files - id: check-case-conflict @@ -51,7 +51,7 @@ repos: - id: isort # Let's keep `pyupgrade` even though `ruff --fix` probably does most of it - repo: https://github.com/asottile/pyupgrade - rev: v3.14.0 + rev: v3.15.0 hooks: - id: pyupgrade args: [--py39-plus] @@ -126,7 +126,7 @@ repos: args: [graphblas/] pass_filenames: false - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v4.5.0 hooks: - id: no-commit-to-branch # no commit directly to main # diff --git a/environment.yml b/environment.yml index 4455f4ac6..1863d4006 100644 --- a/environment.yml +++ b/environment.yml @@ -69,6 +69,7 @@ dependencies: # - flake8-simplify # - gcc # - gh + # - git # - graph-tool # - xorg-libxcursor # for graph-tool # - grayskull diff --git a/pyproject.toml b/pyproject.toml index ff970cc0f..9579b1c16 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -47,6 +47,7 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3 :: Only", "Intended Audience :: Developers", "Intended Audience :: Other Audience", @@ -62,7 +63,7 @@ dependencies = [ "pyyaml >=5.4", # These won't be installed by default after 2024.3.0 # Use e.g. "python-graphblas[suitesparse]" or "python-graphblas[default]" instead - "suitesparse-graphblas >=7.4.0.0, <7.5", + "suitesparse-graphblas >=7.4.0.0, <9", "numba >=0.55; python_version<'3.12'", # make optional where numba is not supported ] @@ -74,7 +75,7 @@ changelog = "https://github.com/python-graphblas/python-graphblas/releases" [project.optional-dependencies] suitesparse = [ - "suitesparse-graphblas >=7.4.0.0, <7.5", + "suitesparse-graphblas >=7.4.0.0, <9", ] networkx = [ "networkx >=2.8", @@ -156,7 +157,7 @@ dirty_template = "{tag}+{ccount}.g{sha}.dirty" [tool.black] line-length = 100 -target-version = ["py39", "py310", "py311"] +target-version = ["py39", "py310", "py311", "py312"] [tool.isort] sections = ["FUTURE", "STDLIB", "THIRDPARTY", "FIRSTPARTY", "LOCALFOLDER"] @@ -207,6 +208,9 @@ filterwarnings = [ # pypy gives this warning "ignore:can't resolve package from __spec__ or __package__:ImportWarning:", + + # Python 3.12 introduced this deprecation, which is triggered by pandas 2.1.1 + "ignore:datetime.datetime.utcfromtimestamp:DeprecationWarning:dateutil", ] [tool.coverage.run] diff --git a/scripts/check_versions.sh b/scripts/check_versions.sh index 9051ebe6e..c373692ed 100755 --- a/scripts/check_versions.sh +++ b/scripts/check_versions.sh @@ -9,7 +9,7 @@ conda search 'numpy[channel=conda-forge]>=1.26.0' conda search 'pandas[channel=conda-forge]>=2.1.1' conda search 'scipy[channel=conda-forge]>=1.11.3' conda search 'networkx[channel=conda-forge]>=3.1' -conda search 'awkward[channel=conda-forge]>=2.4.4' +conda search 'awkward[channel=conda-forge]>=2.4.5' conda search 'sparse[channel=conda-forge]>=0.14.0' conda search 'fast_matrix_market[channel=conda-forge]>=1.7.3' conda search 'numba[channel=conda-forge]>=0.57.1'