Skip to content

Commit

Permalink
Merge branch 'main' into add-two-color
Browse files Browse the repository at this point in the history
  • Loading branch information
mtreinish authored Oct 16, 2023
2 parents 0b94c19 + 2a6f718 commit 58debe3
Show file tree
Hide file tree
Showing 133 changed files with 89 additions and 21,633 deletions.
41 changes: 0 additions & 41 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,47 +110,6 @@ jobs:
run: python -m pip install --upgrade tox
- name: 'Run rustworkx stub tests'
run: tox -estubs
tests_retworkx_compat:
if: github.repository_owner == 'Qiskit'
needs: [build_lint]
name: python${{ matrix.python-version }}-${{ matrix.platform.python-architecture }} ${{ matrix.platform.os }} ${{ matrix.msrv }}
runs-on: ${{ matrix.platform.os }}
strategy:
matrix:
rust: [stable]
python-version: ["3.10"]
platform: [
{ os: "macOS-latest", python-architecture: "x64", rust-target: "x86_64-apple-darwin" },
{ os: "ubuntu-latest", python-architecture: "x64", rust-target: "x86_64-unknown-linux-gnu" },
{ os: "windows-latest", python-architecture: "x64", rust-target: "x86_64-pc-windows-msvc" },
]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.platform.python-architecture }}
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
targets: ${{ matrix.platform.rust-target }}
- name: 'Install binary dependencies'
run: sudo apt-get install -y graphviz
if: runner.os == 'Linux'
- name: 'Build rustworkx and test dependencies'
run: |
pip install -c constraints.txt -U '.[mpl,graphviz]' fixtures testtools>=2.5.0 networkx>=2.5 stestr>=4.1
- name: 'Build retworkx'
env:
RUSTWORKX_PKG_NAME: "retworkx"
run: |
pip install -c constraints.txt -U .
- name: 'Run retworkx tests'
run: |
cd tests
stestr run -t ./retworkx_backwards_compat
coverage:
if: github.repository_owner == 'Qiskit'
needs: [tests]
Expand Down
84 changes: 40 additions & 44 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ fixedbitset = "0.4.2"
hashbrown = { version = ">=0.13, <0.15", features = ["rayon"] }
indexmap = { version = ">=1.9, <3", features = ["rayon"] }
num-traits = "0.2"
numpy = "0.19.0"
numpy = "0.20.0"
petgraph = "0.6.4"
rand = "0.8"
rand_pcg = "0.3"
Expand Down Expand Up @@ -60,7 +60,7 @@ serde_json = "1.0"
rustworkx-core = { path = "rustworkx-core", version = "=0.14.0" }

[dependencies.pyo3]
version = "0.19.2"
version = "0.20.0"
features = ["extension-module", "hashbrown", "num-bigint", "num-complex", "indexmap"]

[dependencies.ndarray]
Expand Down
8 changes: 2 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,7 @@
[![Zenodo](https://img.shields.io/badge/Zenodo-10.5281%2Fzenodo.5879859-blue)](https://doi.org/10.5281/zenodo.5879859)

- You can see the full rendered docs at:
<https://qiskit.org/ecosystem/rustworkx/dev>

|:warning:| The retworkx project has been renamed to **rustworkx**. The use of the
retworkx package will still work for the time being but starting in the 1.0.0
release retworkx will no longer be supported
<https://qiskit.org/ecosystem/rustworkx/>

rustworkx is a general purpose graph library for Python written in Rust to
take advantage of the performance and safety that Rust provides. It is
Expand All @@ -27,7 +23,7 @@ any Python application.

Rustworkx was originally called retworkx and was created initially to be
a replacement for [qiskit](https://qiskit.org/)'s previous (and current)
networkx usage (hence the original name). The project was originally started
NetworkX usage (hence the original name). The project was originally started
to build a faster directed graph to use as the underlying data structure for
the DAG at the center of
[qiskit-terra](https://github.com/Qiskit/qiskit-terra/)'s transpiler. However,
Expand Down
12 changes: 6 additions & 6 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@
rustworkx Documentation
#######################

.. note::

The project has been renamed to **rustworkx**. You can still use the legacy
retworkx name for now but starting in the 1.0.0 release the retworkx name
will no longer be supported.

rustworkx is a Python package for working with graphs and complex networks. It
enables the creation, interaction with, and study of graphs and networks.

Expand Down Expand Up @@ -57,6 +51,12 @@ https://docs.rs/rustworkx-core/0.13.0/rustworkx_core/
Project history
---------------

.. note::

The project has been renamed to **rustworkx**. You can still use the legacy
retworkx name for now but starting in the 1.0.0 release the retworkx name
will no longer be supported.

rustworkx was originally called retworkx and was created to be a high
performance replacement for the Qiskit project's internal usage of the
`NetworkX <https://networkx.org/>`__ library (which is where the name came
Expand Down
2 changes: 1 addition & 1 deletion docs/source/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ limitations in available testing resources and platform availability, not all
platforms can be supported. Platform support for rustworkx is broken into 4
tiers with different levels of support for each tier. For platforms outside
these, rustworkx is probably still installable, but it’s not tested and you will
need a Rust compiler and have to build retworkx (and likely Numpy too) from
need a Rust compiler and have to build rustworkx (and likely Numpy too) from
source.

.. list-table:: Platform Support
Expand Down
7 changes: 7 additions & 0 deletions releasenotes/notes/retworkx-deprecation-848bc6b41f2368cf.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
deprecations:
- |
The legacy ``retworkx`` package that operates as a backwards compatibility
alias for ``rustworkx`` has been marked as deprecated. If you're using
the ``retworkx`` package it will now emit a ``DeprecationWarning`` on
import.
7 changes: 7 additions & 0 deletions retworkx/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,18 @@


import sys
import warnings

from rustworkx import * # noqa

from . import namespace

warnings.warn(
"The retworkx package is deprecated and has been renamed to rustworkx. Rustworkx is a "
"drop-in replacement and can be used by replacing `import retworkx` with import `rustworkx`. ",
DeprecationWarning,
stacklevel=2,
)

sys.modules["retworkx.generators"] = generators # noqa
new_meta_path_finder = namespace.RetworkxImport("retworkx", "rustworkx")
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ def readme():
if PKG_NAME == "retworkx":
README = retworkx_readme_compat + README
PKG_PACKAGES = ["retworkx"]
# TODO: For final retworkx release change this to < 1.
PKG_INSTALL_REQUIRES.append(f"rustworkx=={PKG_VERSION}")
RUST_EXTENSIONS = []

Expand Down
Loading

0 comments on commit 58debe3

Please sign in to comment.