From d417365f57656a5c4fe88d3fca994ec5806f3e91 Mon Sep 17 00:00:00 2001 From: Zhiwei Liang Date: Wed, 9 Sep 2026 17:20:45 -0400 Subject: [PATCH] Refactor dev dependencies lists and remove tox --- .github/workflows/ci.yml | 4 ++-- AGENTS.md | 3 +-- README.rst | 11 ++++------- pyproject.toml | 29 +++++++++++++++++------------ tox.ini | 17 ----------------- 5 files changed, 24 insertions(+), 40 deletions(-) delete mode 100644 tox.ini diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d65acf9e6..fecd97885 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -67,5 +67,5 @@ jobs: python-version: ${{ matrix.python-version }} - name: Run tests run: | - pip install ".[test]" - tox + pip install ".[unit-test]" + make test-unit diff --git a/AGENTS.md b/AGENTS.md index 8cc3170c5..20f924d80 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -3,8 +3,7 @@ ## Source of Truth - This is the official synchronous Python SDK for the Linode API. Supported - Python versions come from [pyproject.toml](pyproject.toml) (`>=3.10`); do not - infer support from the older environment names still present in [tox.ini](tox.ini). + Python versions come from [pyproject.toml](pyproject.toml) (`>=3.10`). - Make changes only in canonical source trees such as `linode_api4/`, `test/`, `docs/`, `examples/`, and `.github/`. Do not edit generated copies or output in `build/`, `dist/`, `docs/build/`, `docs/_build/`, or `linode_api4.egg-info/`. diff --git a/README.rst b/README.rst index 5615bb488..3f7f00a30 100644 --- a/README.rst +++ b/README.rst @@ -102,14 +102,13 @@ Tests ----- Tests live in the ``test`` directory. When invoking tests, make sure you are -in the root directory of this project. To run the full suite across all -supported python versions, use tox_: +in the root directory of this project. Install unit-test dependencies and run +the mocked unit suite with: .. code-block:: shell - tox - -Running tox also runs pylint and coverage reports. + python3 -m pip install -e ".[unit-test]" + make test-unit The test suite uses fixtures stored as JSON in ``test/fixtures``. These files contain sanitized JSON responses from the API - the file name is the URL called @@ -131,8 +130,6 @@ from the api base url that should be returned, for example:: linode = self.client.linode.instance_create('g6-standard-2', 'us-east') self.assertEqual(linode.id, 123) # passes -.. _tox: http://tox.readthedocs.io - Integration Tests ----------------- diff --git a/pyproject.toml b/pyproject.toml index 3b3d982b7..2e0e1ed41 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -35,32 +35,37 @@ dependencies = ["requests", "polling", "deprecated"] dynamic = ["version"] [project.optional-dependencies] -test = ["tox>=4.4.0"] - -dev = [ - "tox>=4.4.0", - "mock>=5.0.0", +test-shared = [ "pytest>=7.3.1", "httpretty>=1.1.4", + "pytest-rerunfailures", +] +unit-test = [ + "linode_api4[test-shared]", + "mock>=5.0.0", +] +int-test = [ + "linode_api4[test-shared]", +] +lint = [ "black>=23.1.0", "isort>=5.12.0", "autoflake>=2.0.1", "pylint", "twine>=4.0.2", "build>=0.10.0", - "Sphinx>=6.0.0", - "sphinx-autobuild>=2021.3.14", - "sphinxcontrib-fulltoc>=1.2.0", - "build>=0.10.0", - "twine>=4.0.2", - "pytest-rerunfailures", ] - doc = [ "Sphinx>=6.0.0", "sphinx-autobuild>=2021.3.14", "sphinxcontrib-fulltoc>=1.2.0", ] +dev = [ + "linode_api4[unit-test]", + "linode_api4[int-test]", + "linode_api4[lint]", + "linode_api4[doc]", +] [project.urls] Homepage = "https://github.com/linode/linode_api4-python" diff --git a/tox.ini b/tox.ini deleted file mode 100644 index 266c26717..000000000 --- a/tox.ini +++ /dev/null @@ -1,17 +0,0 @@ -[tox] -envlist = py38,py39,py310,py311,py312 -skip_missing_interpreters = true - -[testenv] -deps = - pytest - coverage - mock - pylint - httpretty - pytest-rerunfailures -commands = - python -m pip install . - coverage run --source linode_api4 -m pytest test/unit - coverage report - pylint linode_api4