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

Ramp up deprecation of retworkx package and remove tests #1004

Merged
merged 1 commit into from
Oct 15, 2023
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
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
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
Empty file.
Empty file.
102 changes: 0 additions & 102 deletions tests/retworkx_backwards_compat/digraph/test_adj.py

This file was deleted.

Loading