From 812b17e91da515f205822c20afabce55a17db59b Mon Sep 17 00:00:00 2001 From: Vlada Dusek Date: Mon, 3 Aug 2026 12:51:00 +0200 Subject: [PATCH] feat: deprecate the apify-shared package --- CONTRIBUTING.md | 3 +++ README.md | 26 +++++++++++++++++++------- pyproject.toml | 4 ++-- renovate.json | 1 + src/apify_shared/__init__.py | 9 +++++++++ tests/unit/test_deprecation.py | 13 +++++++++++++ 6 files changed, 47 insertions(+), 9 deletions(-) create mode 100644 tests/unit/test_deprecation.py diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e8e3a49..3a317f4 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,5 +1,8 @@ # Development +> ⚠️ This package is deprecated and archived - see the [README](README.md). New features and dependency updates are +> not accepted anymore; the guide below is kept only in case the project is revived. + Here you'll find a contributing guide to get started with development. ## Environment diff --git a/README.md b/README.md index c7a57fd..0d3bfae 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,27 @@ # Apify Shared Python -The `apify-shared-python` is a Python library for containing constants and utilities which are used across -our other Python projects like [apify-client-python](https://github.com/apify/apify-client-python) -and [apify-sdk-python](https://github.com/apify/apify-sdk-python). +> ⚠️ **DEPRECATED - this package is no longer maintained.** +> +> The `apify-shared` package is not used by any Apify Python library anymore - its constants and utilities were moved +> into the packages that need them. Already published versions stay installable from PyPI, but there will be no +> further releases, bug fixes, or security updates, and this repository has been archived. -If you want to develop Apify Actors in Python, -check out the [Apify SDK for Python](https://docs.apify.com/sdk/python) instead. +## What to use instead + +- The [Apify SDK for Python](https://docs.apify.com/sdk/python) (the `apify` package) exposes the Actor constants, + such as `ActorEnvVars`, `ApifyEnvVars`, `ActorEventTypes`, and `WebhookEventType`. +- The [Apify API client for Python](https://docs.apify.com/api/client/python) (the `apify-client` package) provides + fully typed models and literals for the API resources it works with. + +The signing helpers (`encode_base62`, `create_hmac_signature`, and `create_storage_content_signature`) have no public +replacement - they are an implementation detail of the packages above. Copy them into your own project if you depend +on them. + +If you want to develop Apify Actors in Python, check out the [Apify SDK for Python](https://docs.apify.com/sdk/python). ## Installation Requires Python 3.10+ -You can install the package from its [PyPI listing](https://pypi.org/project/apify-shared). -To do that, simply run `pip install apify-shared` in your terminal. +The last published version is still available on its [PyPI listing](https://pypi.org/project/apify-shared), so +existing installations keep working. Importing the package emits a `DeprecationWarning`. Do not add it to new projects. diff --git a/pyproject.toml b/pyproject.toml index 0c8e8fd..11e325c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,14 +5,14 @@ build-backend = "uv_build" [project] name = "apify_shared" version = "2.2.2" -description = "Tools and constants shared across Apify projects." +description = "DEPRECATED - Tools and constants shared across Apify projects." authors = [{ name = "Apify Technologies s.r.o.", email = "support@apify.com" }] license = "Apache-2.0" license-files = ["LICENSE"] readme = "README.md" requires-python = ">=3.10" classifiers = [ - "Development Status :: 5 - Production/Stable", + "Development Status :: 7 - Inactive", "Environment :: Console", "Intended Audience :: Developers", "Operating System :: OS Independent", diff --git a/renovate.json b/renovate.json index e69ac44..8d5d4c5 100644 --- a/renovate.json +++ b/renovate.json @@ -1,4 +1,5 @@ { + "enabled": false, "extends": ["config:base", ":semanticCommitTypeAll(chore)"], "ignorePaths": ["docs/**"], "pinVersions": false, diff --git a/src/apify_shared/__init__.py b/src/apify_shared/__init__.py index f4fedc0..899b893 100644 --- a/src/apify_shared/__init__.py +++ b/src/apify_shared/__init__.py @@ -1,3 +1,12 @@ +import warnings from importlib import metadata __version__ = metadata.version('apify-shared') + +warnings.warn( + 'The `apify-shared` package is deprecated and no longer maintained. Its constants and utilities now live in the ' + 'packages that need them: use `apify` (the Apify SDK for Python) or `apify-client` (the Apify API client for ' + 'Python) instead. See https://github.com/apify/apify-shared-python for details.', + DeprecationWarning, + stacklevel=2, +) diff --git a/tests/unit/test_deprecation.py b/tests/unit/test_deprecation.py new file mode 100644 index 0000000..2e15317 --- /dev/null +++ b/tests/unit/test_deprecation.py @@ -0,0 +1,13 @@ +from __future__ import annotations + +import importlib + +import pytest + +import apify_shared + + +def test_import_emits_deprecation_warning() -> None: + """Importing the package warns that it is deprecated and points to the replacements.""" + with pytest.warns(DeprecationWarning, match='`apify-shared` package is deprecated'): + importlib.reload(apify_shared)