diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fda1443..3f5ebf6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,14 +8,14 @@ on: jobs: lint-pydocstyle: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Setup Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: - python-version: 3.8 + python-version: "3.10.15" - name: Check compliance with Python docstring conventions run: | @@ -23,14 +23,14 @@ jobs: ./run-tests.sh --check-pydocstyle lint-flake8: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Setup Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: - python-version: 3.8 + python-version: "3.10.15" - name: Check compliance with pep8, pyflakes and circular complexity run: | @@ -38,14 +38,14 @@ jobs: ./run-tests.sh --check-flake8 lint-check-manifest: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Setup Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: - python-version: 3.8 + python-version: "3.10.15" - name: Check Python manifest completeness run: | @@ -53,16 +53,16 @@ jobs: ./run-tests.sh --check-manifest python-unit-tests: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest strategy: matrix: - python-version: [2.7, 3.8] + python-version: ["3.10.15"] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} @@ -75,20 +75,20 @@ jobs: run: ./run-tests.sh --check-pytest-unit - name: Codecov Coverage - if: matrix.python-version == 3.8 - uses: codecov/codecov-action@v1 + if: ${{ matrix.python-version == '3.10.15' }} + uses: codecov/codecov-action@v5 with: files: coverage.xml python-e2e-vcr-tests: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + - name: Set up Python + uses: actions/setup-python@v5 with: - python-version: 3.8 + python-version: "3.10.15" - name: Install Python dependencies run: | @@ -97,6 +97,6 @@ jobs: - name: Run pytest env: - TESTS_SERVER_HOST: 'https://localhost' - TEST_E2E_TOKEN: 'token' + TESTS_SERVER_HOST: "https://localhost" + TEST_E2E_TOKEN: "token" run: ./run-tests.sh --check-pytest-e2e-vcr diff --git a/.github/workflows/pypi-publish.yml b/.github/workflows/pypi-publish.yml index f5be698..e96596d 100644 --- a/.github/workflows/pypi-publish.yml +++ b/.github/workflows/pypi-publish.yml @@ -7,7 +7,7 @@ on: jobs: Publish: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - name: Checkout @@ -16,7 +16,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v2 with: - python-version: 3.9 + python-version: 3.10 - name: Install dependencies run: pip install setuptools wheel diff --git a/cap_client/api/base.py b/cap_client/api/base.py index f04e21a..1dcba67 100644 --- a/cap_client/api/base.py +++ b/cap_client/api/base.py @@ -28,7 +28,7 @@ import requests import urllib3 from click import UsageError -from future.moves.urllib.parse import urljoin +from urllib.parse import urljoin from cap_client.errors import BadStatusCode diff --git a/run-tests.sh b/run-tests.sh index 72b43d0..d2200b1 100755 --- a/run-tests.sh +++ b/run-tests.sh @@ -46,7 +46,7 @@ check_manifest () { } check_pytest_unit () { - python setup.py test + pytest tests/unit --cov=cap_client --cov-report=xml } check_pytest_e2e () { diff --git a/setup.py b/setup.py index d34c638..c513b54 100644 --- a/setup.py +++ b/setup.py @@ -32,22 +32,22 @@ history = open('CHANGES.rst').read() tests_require = [ - 'check-manifest>=0.25', - 'coverage>=4.0', - 'mock>=2.0.0', - 'pydocstyle>=1.0.0', + 'check-manifest>=0.51', + 'coverage>=7.13.5', + 'mock>=5.2.0', + 'pydocstyle>=6.3.0', 'pytest-cache>=1.0', - 'pytest-cov>=1.8.0', - 'flake8', - 'pytest>=2.8.0', - 'responses>=0.10.6', - 'pytest-vcr', + 'pytest-cov>=7.0.0', + 'flake8>=7.3.0', + 'pytest>=9.0.2', + 'responses>=0.26.0', + 'pytest-vcr>=1.0.2', ] extras_require = { 'docs': [ - 'Sphinx>=1.4.4', - 'sphinx-rtd-theme>=0.1.9', + 'Sphinx>=7.2.0', + 'sphinx-rtd-theme>=2.0.0', ], 'tests': tests_require, } @@ -58,16 +58,12 @@ continue extras_require['all'].extend(reqs) -setup_requires = [ - 'pytest-runner>=2.7', -] - install_requires = [ - 'click>=6.7', - 'click-help-colors>=0.8', - 'requests>=2.18.4', - 'colorama>=0.4.3', - 'future>=0.16.0', + 'click>=8.3.1', + 'click-help-colors>=0.9.4', + 'requests>=2.32.5', + 'colorama>=0.4.6', + 'future>=1.0.0', ] packages = find_packages() @@ -94,8 +90,6 @@ }, install_requires=install_requires, extras_require=extras_require, - setup_requires=setup_requires, - tests_require=tests_require, classifiers=[ 'Environment :: Web Environment', 'Intended Audience :: Developers', diff --git a/tests/unit/test_files_cli.py b/tests/unit/test_files_cli.py index ed17c23..0100986 100644 --- a/tests/unit/test_files_cli.py +++ b/tests/unit/test_files_cli.py @@ -317,7 +317,7 @@ def test_files_upload_file(runner): res = runner.run("files upload -p some-pid dir/file.txt") - assert responses.calls[1].request.body.name == 'dir/file.txt' + assert responses.calls[1].request.body == b'Hello world' assert res.exit_code == 0 assert res.stripped_output == 'File uploaded successfully.'