Skip to main content

Backward compatibility shims and deprecation wrappers

Project description

scitex-compat

SciTeX

Backward compatibility shims and deprecation wrappers for the SciTeX ecosystem.

Full Documentation · uv pip install scitex-compat[all]

pypi python docs

tests install-check cov


Problem and Solution

# Problem Solution
1 Renaming a public API silently breaks users — there's no stdlib way to say "this still works but is deprecated" @deprecated decorator — emits DeprecationWarning with replacement hint, keeps the old name working one release
2 Migrating legacy notify() calls — old scripts reference functions whose home moved Compat shimsnotify, notify_async still callable, forward to the new home, warn once

Installation

pip install scitex-compat

Architecture

scitex-compat/
├── src/scitex_compat/
│   ├── __init__.py              # deprecated, notify, notify_async
│   ├── _deprecated.py           # @deprecated decorator (warns once,
│   │                            #   forwards to replacement, removal_version)
│   └── _shims/
│       ├── _notify.py           # legacy notify() -> scitex.notify
│       └── _notify_async.py     # legacy notify_async() -> scitex.notify
└── tests/

Quick Start

from scitex_compat import deprecated

@deprecated("new_function_name", removal_version="3.0")
def old_function():
    pass

1 Interfaces

Python API
from scitex_compat import deprecated, notify, notify_async

@deprecated("new_func", removal_version="2.0")
def old_func(*args, **kwargs):
    ...

# Compat shims (forward to scitex.notify if installed)
notify("hello")
await notify_async("hello")

Demo

sequenceDiagram
    participant U as user code
    participant O as old_func (deprecated)
    participant N as new_func
    participant W as warnings
    U->>O: old_func(x=1)
    O->>W: DeprecationWarning("use new_func; removal_version=2.0")
    O->>N: new_func(x=1)
    N-->>U: result
    Note over U,N: One release later, old_func is removed.

Part of SciTeX

scitex-compat is part of SciTeX. Install via the umbrella with pip install scitex[compat] to use as scitex.compat (Python) or scitex compat ... (CLI).

Four Freedoms for Research

  1. The freedom to run your research anywhere — your machine, your terms.
  2. The freedom to study how every step works — from raw data to final manuscript.
  3. The freedom to redistribute your workflows, not just your papers.
  4. The freedom to modify any module and share improvements with the community.

AGPL-3.0 — because we believe research infrastructure deserves the same freedoms as the software it runs on.

License

AGPL-3.0


SciTeX

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

scitex_compat-0.1.8.tar.gz (8.8 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

scitex_compat-0.1.8-py3-none-any.whl (8.5 MB view details)

Uploaded Python 3

File details

Details for the file scitex_compat-0.1.8.tar.gz.

File metadata

  • Download URL: scitex_compat-0.1.8.tar.gz
  • Upload date:
  • Size: 8.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for scitex_compat-0.1.8.tar.gz
Algorithm Hash digest
SHA256 b0a8c2316d42b5a6e0d399499ad98be4cc48c5777d724fd641451bf06c5c3008
MD5 daad598db624bf43a9121a5a71724ed0
BLAKE2b-256 ea90ebb970c7dab42dc39297c86b6a6b15d099e0eacc5dd58c376fa73c47bb22

See more details on using hashes here.

Provenance

The following attestation bundles were made for scitex_compat-0.1.8.tar.gz:

Publisher: pypi-publish-and-github-release-on-tag.yml on ywatanabe1989/scitex-compat

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file scitex_compat-0.1.8-py3-none-any.whl.

File metadata

  • Download URL: scitex_compat-0.1.8-py3-none-any.whl
  • Upload date:
  • Size: 8.5 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for scitex_compat-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 92b9ebd13d0cad4d279c9a650a8d1e3cc02ef707f959c79ae631fd0fd15cf9ea
MD5 a524cf401e1dde3acab076a45037f9e1
BLAKE2b-256 937f2bb03bbb631a5ccb98f2eeba5d80ab5972d8c2e85af1e6213d4679c84c9d

See more details on using hashes here.

Provenance

The following attestation bundles were made for scitex_compat-0.1.8-py3-none-any.whl:

Publisher: pypi-publish-and-github-release-on-tag.yml on ywatanabe1989/scitex-compat

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page