Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop Python 3.8 and add Python 3.13 support #246

Merged
merged 6 commits into from
Nov 20, 2024
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
29 changes: 14 additions & 15 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
version: 2.1

orbs:
win: circleci/[email protected]
win: circleci/[email protected]
codecov: codecov/codecov@3

jobs:
test-linux:
Expand All @@ -12,7 +13,7 @@ jobs:
type: string

docker:
- image: cimg/python:<< parameters.python-version >>
- image: python:<< parameters.python-version >>

steps:
- checkout
Expand Down Expand Up @@ -45,22 +46,18 @@ jobs:
command: |
. env/bin/activate
coverage run -m unittest discover
coverage xml

- run: &run-codecov
name: Run codecov
command: |
. env/bin/activate
codecov
- codecov/upload: &upload-python-code-coverage
file: coverage.xml

test-osx:
parameters:
python-version:
type: string
xcode:
type: string
default: "14.3.0"

resource_class: macos.m1.medium.gen1
default: "16.0.0"

macos:
xcode: << parameters.xcode >>
Expand All @@ -74,6 +71,7 @@ jobs:
- run:
name: Install pyenv
command: |
brew update
brew install pyenv

- run:
Expand Down Expand Up @@ -105,8 +103,6 @@ jobs:

- run: *run-tests

- run: *run-codecov

test-win:
parameters:
python-version:
Expand Down Expand Up @@ -149,7 +145,7 @@ jobs:

test-doctest:
docker:
- image: cimg/python:3.9
- image: python:3.12

steps:
- checkout
Expand Down Expand Up @@ -189,7 +185,7 @@ jobs:

deploy:
docker:
- image: cimg/python:3.9
- image: python:3.12

steps:
- checkout
Expand All @@ -207,6 +203,7 @@ jobs:
name: Build sdist and bdist
command: |
. env/bin/activate
pip install setuptools wheel
python setup.py sdist bdist_wheel

- run:
Expand All @@ -221,7 +218,7 @@ workflows:
- test-linux:
matrix:
parameters:
python-version: &python-versions ["3.8", "3.9", "3.10", "3.11", "3.12"]
python-version: &python-versions ["3.9", "3.10", "3.11", "3.12", "3.13"]
dependency-versions: ["dimod==0.10.8 networkx==2.4 oldest-supported-numpy", # oldest supported
"dimod networkx numpy", # latest
]
Expand All @@ -231,6 +228,8 @@ workflows:
dependency-versions: "dimod==0.10.8 networkx==2.4 oldest-supported-numpy"
- python-version: "3.12"
dependency-versions: "dimod==0.10.8 networkx==2.4 oldest-supported-numpy"
- python-version: "3.13"
dependency-versions: "dimod==0.10.8 networkx==2.4 oldest-supported-numpy"
- test-osx:
matrix:
parameters:
Expand Down
8 changes: 4 additions & 4 deletions dwave_networkx/algorithms/clique.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@

@binary_quadratic_model_sampler(1)
def maximum_clique(G, sampler=None, lagrange=2.0, **sampler_args):
"""
Returns an approximate maximum clique.
r"""Returns an approximate maximum clique.

A clique in an undirected graph, G = (V, E), is a subset of the vertex set
:math:`C \subseteq V` such that for every two vertices in C there exists an edge
connecting the two. This is equivalent to saying that the subgraph
Expand Down Expand Up @@ -92,8 +92,8 @@ def maximum_clique(G, sampler=None, lagrange=2.0, **sampler_args):

@binary_quadratic_model_sampler(1)
def clique_number(G, sampler=None, lagrange=2.0, **sampler_args):
"""
Returns the number of vertices in the maximum clique of a graph.
r"""Returns the number of vertices in the maximum clique of a graph.

A maximum clique is a clique of the largest possible size in a given graph.
The clique number math:`\omega(G)` of a graph G is the number of
vertices in a maximum clique in G. The intersection number of
Expand Down
2 changes: 1 addition & 1 deletion dwave_networkx/generators/chimera.py
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,7 @@ def mapping(q):


def chimera_sublattice_mappings(source, target, offset_list=None):
"""Yields mappings from a Chimera graph into a larger Chimera graph.
r"""Yields mappings from a Chimera graph into a larger Chimera graph.

A sublattice mapping is a function from the nodes of a
``chimera_graph(m_s, n_s, t)`` to the nodes of a ``chimera_graph(m_t, n_t, t)``
Expand Down
2 changes: 1 addition & 1 deletion dwave_networkx/generators/pegasus.py
Original file line number Diff line number Diff line change
Expand Up @@ -1092,7 +1092,7 @@ def mapping(q):


def pegasus_sublattice_mappings(source, target, offset_list=None):
"""Yields mappings from a Chimera or Pegasus graph into a Pegasus graph.
r"""Yields mappings from a Chimera or Pegasus graph into a Pegasus graph.

A sublattice mapping is a function from the nodes of a ``pegasus_graph(m_s)``
or ``chimera_graph(m_c, n_c, 4)`` to the nodes of a ``pegasus_graph(m_t)`` with
Expand Down
2 changes: 1 addition & 1 deletion dwave_networkx/generators/zephyr.py
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ def mapping(q):


def zephyr_sublattice_mappings(source, target, offset_list=None):
"""Yields mappings from a Chimera or Zephyr graph into a Zephyr graph.
r"""Yields mappings from a Chimera or Zephyr graph into a Zephyr graph.

A sublattice mapping is a function from nodes of

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
networkx==3.0
dimod==0.12.0
dimod==0.12.17

oldest-supported-numpy
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,17 @@
'numpy>=1.17.3',
]

python_requires = ">=3.8"
python_requires = ">=3.9"

classifiers = [
'License :: OSI Approved :: Apache Software License',
'Operating System :: OS Independent',
'Programming Language :: Python :: 3 :: Only',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: 3.13',
]

setup(
Expand Down
2 changes: 0 additions & 2 deletions tests/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
coverage
codecov

parameterized==0.7.4