diff --git a/.codeclimate.yml b/.codeclimate.yml deleted file mode 100644 index 4d91d7f8..00000000 --- a/.codeclimate.yml +++ /dev/null @@ -1,17 +0,0 @@ ---- -engines: - duplication: - enabled: true - config: - languages: - - python - fixme: - enabled: true - pep8: - enabled: true - radon: - enabled: true -ratings: - paths: - - "**.py" -exclude_paths: [] diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fd042284..04373c7c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,198 +12,166 @@ jobs: runs-on: ubuntu-18.04 strategy: matrix: - python-version: [2.7, 3.4, 3.5, 3.6, 3.7, 3.8] + python-version: [2.7, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9, '3.10', 3.11] framework: - - FLASK_VERSION=0.10.1 Werkzeug\>=0.7,\<1.0 - - FLASK_VERSION=0.11.1 Werkzeug\>=0.7,\<1.0 - - FLASK_VERSION=0.12.4 Werkzeug\>=0.7,\<1.0 - - FLASK_VERSION=1.0.2 - - TWISTED_VERSION=15.5.0 treq==15.1.0 zope.interface==4.1.3 - - TWISTED_VERSION=16.1.0 treq==16.12.0 zope.interface==4.1.3 - - TWISTED_VERSION=16.2.0 treq==16.12.0 zope.interface==4.1.3 - - TWISTED_VERSION=16.3.0 treq==16.12.0 zope.interface==4.2.0 - - TWISTED_VERSION=16.4.0 treq==16.12.0 zope.interface==4.5.0 - - TWISTED_VERSION=16.5.0 treq==16.12.0 zope.interface==4.5.0 - - TWISTED_VERSION=16.6.0 treq==16.12.0 zope.interface==4.5.0 - - TWISTED_VERSION=17.1.0 treq==16.12.0 zope.interface==4.5.0 + - FLASK_VERSION=0.12.5 Werkzeug\>=0.7,\<1.0 + - FLASK_VERSION=1.1.4 + - FLASK_VERSION=2.2.3 - DJANGO_VERSION=1.11.29 - - DJANGO_VERSION=2.0.13 - - DJANGO_VERSION=2.1.15 - - DJANGO_VERSION=2.2.26 - - DJANGO_VERSION=3.0.14 - - DJANGO_VERSION=3.1.14 - - DJANGO_VERSION=3.2.11 - - DJANGO_VERSION=4.0.1 - - PYRAMID_VERSION=1.9.2 - - PYRAMID_VERSION=1.10.4 - - STARLETTE_VERSION=0.12.12 httpx==0.18.1 python-multipart==0.0.5 + - DJANGO_VERSION=2.2.28 + - DJANGO_VERSION=3.2.18 + - DJANGO_VERSION=4.0.10 + - DJANGO_VERSION=4.1.7 + - TWISTED_VERSION=17.1.0 treq==16.12.0 zope.interface==4.5.0 + - TWISTED_VERSION=20.3.0 + - TWISTED_VERSION=21.7.0 + - TWISTED_VERSION=22.10.0 + - PYRAMID_VERSION=1.10.8 - STARLETTE_VERSION=0.12.13 httpx==0.18.1 python-multipart==0.0.5 - STARLETTE_VERSION=0.14.2 httpx==0.18.1 python-multipart==0.0.5 - FASTAPI_VERSION=0.40.0 httpx==0.18.1 python-multipart==0.0.5 - FASTAPI_VERSION=0.50.0 httpx==0.18.1 python-multipart==0.0.5 - FASTAPI_VERSION=0.63.0 httpx==0.18.1 python-multipart==0.0.5 exclude: - - python-version: 2.7 - framework: DJANGO_VERSION=2.0.13 - - python-version: 2.7 - framework: DJANGO_VERSION=2.1.15 - - python-version: 2.7 - framework: DJANGO_VERSION=2.2.26 - - python-version: 2.7 - framework: DJANGO_VERSION=3.0.14 - - python-version: 2.7 - framework: DJANGO_VERSION=3.1.14 - - python-version: 2.7 - framework: DJANGO_VERSION=3.2.11 - - python-version: 2.7 - framework: DJANGO_VERSION=4.0.1 - - python-version: 3.4 - framework: DJANGO_VERSION=2.1.15 - - python-version: 3.4 - framework: DJANGO_VERSION=2.2.26 - - python-version: 3.4 - framework: DJANGO_VERSION=3.0.14 - - python-version: 3.4 - framework: DJANGO_VERSION=3.1.14 - - python-version: 3.4 - framework: DJANGO_VERSION=3.2.11 - - python-version: 3.4 - framework: DJANGO_VERSION=4.0.1 - - python-version: 3.5 - framework: DJANGO_VERSION=3.0.14 - - python-version: 3.5 - framework: DJANGO_VERSION=3.1.14 - - python-version: 3.5 - framework: DJANGO_VERSION=3.2.11 - - python-version: 3.5 - framework: DJANGO_VERSION=4.0.1 - - python-version: 3.6 - framework: DJANGO_VERSION=4.0.1 - - python-version: 3.7 - framework: DJANGO_VERSION=4.0.1 - - python-version: 3.8 - framework: DJANGO_VERSION=1.11.29 - - python-version: 3.8 - framework: DJANGO_VERSION=2.0.13 - - python-version: 3.8 - framework: DJANGO_VERSION=2.1.15 - - # twisted/treq setup.py allows: - # Twisted < 18.7.0 on python < 3.7 - # Twisted >= 18.7.0 on python >= 3.7 - # So we put twisted < 18.x in the matrix - # and disallow python 3.7 and 3.8 here. - - python-version: 3.7 - framework: TWISTED_VERSION=15.5.0 treq==15.1.0 zope.interface==4.1.3 - - python-version: 3.7 - framework: TWISTED_VERSION=16.1.0 treq==16.12.0 zope.interface==4.1.3 - - python-version: 3.7 - framework: TWISTED_VERSION=16.2.0 treq==16.12.0 zope.interface==4.1.3 - - python-version: 3.7 - framework: TWISTED_VERSION=16.3.0 treq==16.12.0 zope.interface==4.2.0 - - python-version: 3.7 - framework: TWISTED_VERSION=16.4.0 treq==17.8.0 zope.interface==4.2.0 - - python-version: 3.7 - framework: TWISTED_VERSION=16.5.0 treq==17.8.0 zope.interface==4.2.0 - - python-version: 3.7 - framework: TWISTED_VERSION=16.6.0 treq==17.8.0 zope.interface==4.3.0 - - python-version: 3.7 - framework: TWISTED_VERSION=17.1.0 treq==20.4.1 zope.interface==4.3.0 - - python-version: 3.8 - framework: TWISTED_VERSION=15.5.0 treq==15.1.0 zope.interface==4.1.3 - - python-version: 3.8 - framework: TWISTED_VERSION=16.1.0 treq==16.12.0 zope.interface==4.1.3 - - python-version: 3.8 - framework: TWISTED_VERSION=16.2.0 treq==16.12.0 zope.interface==4.1.3 - - python-version: 3.8 - framework: TWISTED_VERSION=16.3.0 treq==16.12.0 zope.interface==4.2.0 - - python-version: 3.8 - framework: TWISTED_VERSION=16.4.0 treq==17.8.0 zope.interface==4.2.0 - - python-version: 3.8 - framework: TWISTED_VERSION=16.5.0 treq==17.8.0 zope.interface==4.3.0 - - python-version: 3.8 - framework: TWISTED_VERSION=16.6.0 treq==17.8.0 zope.interface==4.3.0 - - python-version: 3.8 - framework: TWISTED_VERSION=17.1.0 treq==20.4.1 zope.interface==4.3.0 - - - python-version: 2.7 - framework: STARLETTE_VERSION=0.12.12 httpx==0.18.1 python-multipart==0.0.5 - - python-version: 2.7 - framework: STARLETTE_VERSION=0.12.13 httpx==0.18.1 python-multipart==0.0.5 - - python-version: 2.7 - framework: STARLETTE_VERSION=0.14.2 httpx==0.18.1 python-multipart==0.0.5 - - python-version: 3.4 - framework: STARLETTE_VERSION=0.12.12 httpx==0.18.1 python-multipart==0.0.5 - - python-version: 3.4 - framework: STARLETTE_VERSION=0.12.13 httpx==0.18.1 python-multipart==0.0.5 - - python-version: 3.4 - framework: STARLETTE_VERSION=0.14.2 httpx==0.18.1 python-multipart==0.0.5 - - python-version: 3.5 - framework: STARLETTE_VERSION=0.12.12 httpx==0.18.1 python-multipart==0.0.5 - - python-version: 3.5 - framework: STARLETTE_VERSION=0.12.13 httpx==0.18.1 python-multipart==0.0.5 - - python-version: 3.5 - framework: STARLETTE_VERSION=0.14.2 httpx==0.18.1 python-multipart==0.0.5 + # Test frameworks on the python versions they support, according to pypi registry + # Flask + - framework: FLASK_VERSION=1.1.4 + python-version: 3.4 + - framework: FLASK_VERSION=2.2.3 + python-version: 2.7 + - framework: FLASK_VERSION=2.2.3 + python-version: 3.4 + - framework: FLASK_VERSION=2.2.3 + python-version: 3.5 + - framework: FLASK_VERSION=2.2.3 + python-version: 3.6 + + # Django + - framework: DJANGO_VERSION=1.11.29 + python-version: 3.8 + - framework: DJANGO_VERSION=1.11.29 + python-version: 3.9 + - framework: DJANGO_VERSION=1.11.29 + python-version: '3.10' + - framework: DJANGO_VERSION=1.11.29 + python-version: 3.11 + - framework: DJANGO_VERSION=2.2.28 + python-version: 2.7 + - framework: DJANGO_VERSION=2.2.28 + python-version: 3.4 + - framework: DJANGO_VERSION=3.2.18 + python-version: 2.7 + - framework: DJANGO_VERSION=3.2.18 + python-version: 3.4 + - framework: DJANGO_VERSION=3.2.18 + python-version: 3.5 + - framework: DJANGO_VERSION=4.0.10 + python-version: 2.7 + - framework: DJANGO_VERSION=4.0.10 + python-version: 3.4 + - framework: DJANGO_VERSION=4.0.10 + python-version: 3.5 + - framework: DJANGO_VERSION=4.0.10 + python-version: 3.6 + - framework: DJANGO_VERSION=4.0.10 + python-version: 3.7 + - framework: DJANGO_VERSION=4.1.7 + python-version: 2.7 + - framework: DJANGO_VERSION=4.1.7 + python-version: 3.4 + - framework: DJANGO_VERSION=4.1.7 + python-version: 3.5 + - framework: DJANGO_VERSION=4.1.7 + python-version: 3.6 + - framework: DJANGO_VERSION=4.1.7 + python-version: 3.7 + + # Twisted + - framework: TWISTED_VERSION=17.1.0 treq==16.12.0 zope.interface==4.5.0 + python-version: 3.4 + - framework: TWISTED_VERSION=17.1.0 treq==16.12.0 zope.interface==4.5.0 + python-version: 3.5 + - framework: TWISTED_VERSION=17.1.0 treq==16.12.0 zope.interface==4.5.0 + python-version: 3.6 + - framework: TWISTED_VERSION=17.1.0 treq==16.12.0 zope.interface==4.5.0 + python-version: 3.7 + - framework: TWISTED_VERSION=17.1.0 treq==16.12.0 zope.interface==4.5.0 + python-version: 3.8 + - framework: TWISTED_VERSION=17.1.0 treq==16.12.0 zope.interface==4.5.0 + python-version: 3.9 + - framework: TWISTED_VERSION=17.1.0 treq==16.12.0 zope.interface==4.5.0 + python-version: '3.10' + - framework: TWISTED_VERSION=17.1.0 treq==16.12.0 zope.interface==4.5.0 + python-version: 3.11 + - framework: TWISTED_VERSION=20.3.0 + python-version: 2.7 + - framework: TWISTED_VERSION=20.3.0 + python-version: 3.4 + - framework: TWISTED_VERSION=20.3.0 + python-version: 3.11 + - framework: TWISTED_VERSION=21.7.0 + python-version: 2.7 + - framework: TWISTED_VERSION=21.7.0 + python-version: 3.4 + - framework: TWISTED_VERSION=21.7.0 + python-version: 3.5 + - framework: TWISTED_VERSION=22.10.0 + python-version: 2.7 + - framework: TWISTED_VERSION=22.10.0 + python-version: 3.4 + - framework: TWISTED_VERSION=22.10.0 + python-version: 3.5 + - framework: TWISTED_VERSION=22.10.0 + python-version: 3.6 + + + # Starlette + - framework: STARLETTE_VERSION=0.12.13 httpx==0.18.1 python-multipart==0.0.5 + python-version: 2.7 + - framework: STARLETTE_VERSION=0.12.13 httpx==0.18.1 python-multipart==0.0.5 + python-version: 3.4 + - framework: STARLETTE_VERSION=0.12.13 httpx==0.18.1 python-multipart==0.0.5 + python-version: 3.5 + - framework: STARLETTE_VERSION=0.14.2 httpx==0.18.1 python-multipart==0.0.5 + python-version: 2.7 + - framework: STARLETTE_VERSION=0.14.2 httpx==0.18.1 python-multipart==0.0.5 + python-version: 3.4 + - framework: STARLETTE_VERSION=0.14.2 httpx==0.18.1 python-multipart==0.0.5 + python-version: 3.5 + + # Fastapi + - framework: FASTAPI_VERSION=0.40.0 httpx==0.18.1 python-multipart==0.0.5 + python-version: 2.7 + - framework: FASTAPI_VERSION=0.40.0 httpx==0.18.1 python-multipart==0.0.5 + python-version: 3.4 + - framework: FASTAPI_VERSION=0.40.0 httpx==0.18.1 python-multipart==0.0.5 + python-version: 3.5 + - framework: FASTAPI_VERSION=0.50.0 httpx==0.18.1 python-multipart==0.0.5 + python-version: 2.7 + - framework: FASTAPI_VERSION=0.50.0 httpx==0.18.1 python-multipart==0.0.5 + python-version: 3.4 + - framework: FASTAPI_VERSION=0.50.0 httpx==0.18.1 python-multipart==0.0.5 + python-version: 3.5 + + - framework: FASTAPI_VERSION=0.63.0 httpx==0.18.1 python-multipart==0.0.5 + python-version: 2.7 + - framework: FASTAPI_VERSION=0.63.0 httpx==0.18.1 python-multipart==0.0.5 + python-version: 3.4 + - framework: FASTAPI_VERSION=0.63.0 httpx==0.18.1 python-multipart==0.0.5 + python-version: 3.5 - - python-version: 2.7 - framework: FASTAPI_VERSION=0.40.0 httpx==0.18.1 python-multipart==0.0.5 - - python-version: 2.7 - framework: FASTAPI_VERSION=0.50.0 httpx==0.18.1 python-multipart==0.0.5 - - python-version: 2.7 - framework: FASTAPI_VERSION=0.63.0 httpx==0.18.1 python-multipart==0.0.5 - - python-version: 3.4 - framework: FASTAPI_VERSION=0.40.0 httpx==0.18.1 python-multipart==0.0.5 - - python-version: 3.4 - framework: FASTAPI_VERSION=0.50.0 httpx==0.18.1 python-multipart==0.0.5 - - python-version: 3.4 - framework: FASTAPI_VERSION=0.63.0 httpx==0.18.1 python-multipart==0.0.5 - - python-version: 3.5 - framework: FASTAPI_VERSION=0.40.0 httpx==0.18.1 python-multipart==0.0.5 - - python-version: 3.5 - framework: FASTAPI_VERSION=0.50.0 httpx==0.18.1 python-multipart==0.0.5 - - python-version: 3.5 - framework: FASTAPI_VERSION=0.63.0 httpx==0.18.1 python-multipart==0.0.5 - include: - - python-version: 2.7 - framework: FLASK_VERSION=0.9 - - python-version: 3.4 - framework: DJANGO_VERSION=1.7.11 - - python-version: 3.4 - framework: DJANGO_VERSION=1.8.19 - - python-version: 3.4 - framework: DJANGO_VERSION=1.9.13 - - python-version: 3.4 - framework: DJANGO_VERSION=1.10.8 - - python-version: 3.5 - framework: DJANGO_VERSION=1.8.19 - - python-version: 3.5 - framework: DJANGO_VERSION=1.9.13 - - python-version: 3.5 - framework: DJANGO_VERSION=1.10.8 - - python-version: 3.7 - framework: TWISTED_VERSION=18.9.0 treq==20.4.1 zope.interface==4.5.0 - - python-version: 3.7 - framework: TWISTED_VERSION=19.10.0 treq==20.4.1 zope.interface==4.6.0 - - python-version: 3.7 - framework: TWISTED_VERSION=20.3.0 treq==20.4.1 zope.interface==4.7.0 - - python-version: 3.8 - framework: TWISTED_VERSION=18.9.0 treq==20.4.1 zope.interface==4.5.0 - - python-version: 3.8 - framework: TWISTED_VERSION=19.10.0 treq==20.4.1 zope.interface==4.6.0 - - python-version: 3.8 - framework: TWISTED_VERSION=20.3.0 treq==20.4.1 zope.interface==4.7.0 steps: - uses: actions/checkout@v2 with: submodules: recursive - name: Setup Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: pip install setuptools==39.2.0 --force-reinstall + #- name: Install setuptools for 2.7,3.4 + # run: pip install setuptools==39.2.0 --force-reinstall - name: Install Python 2 dependencies if: ${{ contains(matrix.python-version, '2.7') }} @@ -215,17 +183,17 @@ jobs: - name: Install Python 3.4 dependencies if: ${{ contains(matrix.python-version, '3.4') }} # certifi uses the 'typing' from Python 3.5 module starting in 2022.5.18 - run: pip install certifi==2021.10.8 "typing-extensions<4" incremental==21.3.0 + run: pip install six==1.16.0 certifi==2021.10.8 requests==2.21.0 "typing-extensions<4" incremental==21.3.0 blinker==1.4 WebOb==1.8.7 - name: Install Python 3.5 dependencies if: ${{ contains(matrix.python-version, '3.5') }} # typing-extensions dropped support for Python 3.5 in version 4 - run: pip install "typing-extensions<4" + run: pip install six==1.16.0 "typing-extensions<4" requests==2.24.0 blinker==1.5 WebOb==1.8.7 - name: Install Python 3.6 dependencies if: ${{ contains(matrix.python-version, '3.6') }} # typing-extensions dropped support for Python 3.6 in version 4.2 - run: pip install "typing-extensions<4.2" + run: pip install six==1.16.0 "typing-extensions<4.2" requests==2.27.0 - name: Set the framework run: echo ${{ matrix.framework }} >> $GITHUB_ENV diff --git a/UPGRADE_FROM_RATCHET.md b/UPGRADE_FROM_RATCHET.md deleted file mode 100644 index 8db9af63..00000000 --- a/UPGRADE_FROM_RATCHET.md +++ /dev/null @@ -1,31 +0,0 @@ -# Upgrading from pyratchet - -Execute: - - $ pip uninstall ratchet - -Then: - - $ pip install rollbar - -## Generic Python or a non-Django/non-Pyramid framework - -Change your initialization call from `ratchet.init(...)` to `rollbar.init(...)`. - -Search your app for all references to `ratchet` and replace them with `rollbar`. - -## Pyratchet running with Django - -In your `settings.py`: -- change `'ratchet.contrib.django.middleware.RatchetNotifierMiddleware'` to `'rollbar.contrib.django.middleware.RollbarNotifierMiddleware'` -- rename your `RATCHET` configuration dict to `ROLLBAR` - -Search your app for all references to `ratchet` and replace them with `rollbar`. - -## Pyratchet running with Pyramid - -In your `ini` file: -- change the include `ratchet.contrib.pyramid` to `rollbar.contrib.pyramid` -- rename your `ratchet.*` configuration variables to `rollbar.*` - -Search your app for all references to `ratchet` and replace them with `rollbar`. \ No newline at end of file diff --git a/default.nix b/default.nix deleted file mode 100644 index 253f06dc..00000000 --- a/default.nix +++ /dev/null @@ -1,19 +0,0 @@ -{ - pkgs ? import {}, - python ? pkgs.python36, -}: - -with pkgs; -with python.pkgs; - -buildPythonPackage rec { - name = "pyrollbar"; - src = builtins.filterSource (path: type: - type != "unknown" && - baseNameOf path != ".git" && - baseNameOf path != "result" && - !(pkgs.lib.hasSuffix ".nix" path) - ) ./.; - propagatedBuildInputs = [requests six]; -} - diff --git a/rollbar/test/__init__.py b/rollbar/test/__init__.py index 2a8cdfda..9a6903ad 100644 --- a/rollbar/test/__init__.py +++ b/rollbar/test/__init__.py @@ -1,13 +1,33 @@ -import unittest2 +import unittest +import sys SNOWMAN = b'\xe2\x98\x83' SNOWMAN_UNICODE = SNOWMAN.decode('utf8') -class BaseTest(unittest2.TestCase): +class BaseTest(unittest.TestCase): pass +class SkipAsyncTestLoader(unittest.TestLoader): + """ + Python 2 does not have the async keyword, so when tests are run under python 2.7 the loader + will fail with a syntaxerror. This loader class does the following: + - try to load as normal + - if loading fails because of a syntax error in python < 3.4, skip the file. + """ + def _get_module_from_name(self, name): + try: + return super(SkipAsyncTestLoader, self)._get_module_from_name(name) + except SyntaxError as e: + if sys.version_info < (3, 5): + return None + else: + raise + + def discover(): - return unittest2.defaultTestLoader.discover(__name__) + loader = SkipAsyncTestLoader() + suite = loader.discover(__name__) + return suite diff --git a/rollbar/test/asgi_tests/__init__.py b/rollbar/test/asgi_tests/__init__.py index f937df26..6f51d3b1 100644 --- a/rollbar/test/asgi_tests/__init__.py +++ b/rollbar/test/asgi_tests/__init__.py @@ -1,9 +1,9 @@ import sys -import unittest2 +import unittest def _load_tests(loader, tests, pattern): - return unittest2.TestSuite() + return unittest.TestSuite() if sys.version_info < (3, 5): diff --git a/rollbar/test/asgi_tests/test_integration.py b/rollbar/test/asgi_tests/test_integration.py index 84578094..23312aed 100644 --- a/rollbar/test/asgi_tests/test_integration.py +++ b/rollbar/test/asgi_tests/test_integration.py @@ -1,6 +1,12 @@ +import unittest +import sys + from rollbar.test import BaseTest +ALLOWED_PYTHON_VERSION = sys.version_info >= (3, 5) + +@unittest.skipUnless(ALLOWED_PYTHON_VERSION, 'ASGI implementation requires Python3.5+') class IntegrationTest(BaseTest): def test_should_integrate_if__integrate_defined(self): from rollbar.contrib.asgi.integration import IntegrationBase diff --git a/rollbar/test/asgi_tests/test_middleware.py b/rollbar/test/asgi_tests/test_middleware.py index bbafe3c2..28ac42a0 100644 --- a/rollbar/test/asgi_tests/test_middleware.py +++ b/rollbar/test/asgi_tests/test_middleware.py @@ -7,7 +7,7 @@ except ImportError: import mock -import unittest2 +import unittest import rollbar from rollbar.lib._async import AsyncMock @@ -17,7 +17,7 @@ ASYNC_REPORT_ENABLED = sys.version_info >= (3, 6) -@unittest2.skipUnless(ALLOWED_PYTHON_VERSION, 'ASGI implementation requires Python3.5+') +@unittest.skipUnless(ALLOWED_PYTHON_VERSION, 'ASGI implementation requires Python3.5+') class ReporterMiddlewareTest(BaseTest): default_settings = copy.deepcopy(rollbar.SETTINGS) @@ -62,7 +62,7 @@ def test_should_add_framework_name_to_payload(self, mock_send_payload, *mocks): self.assertIn('asgi', payload['data']['framework']) - @unittest2.skipUnless(ASYNC_REPORT_ENABLED, 'Requires Python 3.6+') + @unittest.skipUnless(ASYNC_REPORT_ENABLED, 'Requires Python 3.6+') @mock.patch('rollbar.lib._async.report_exc_info', new_callable=AsyncMock) @mock.patch('rollbar.report_exc_info') def test_should_use_async_report_exc_info_if_default_handler( @@ -81,7 +81,7 @@ def test_should_use_async_report_exc_info_if_default_handler( self.assertTrue(async_report_exc_info.called) self.assertFalse(sync_report_exc_info.called) - @unittest2.skipUnless(ASYNC_REPORT_ENABLED, 'Requires Python 3.6+') + @unittest.skipUnless(ASYNC_REPORT_ENABLED, 'Requires Python 3.6+') @mock.patch('rollbar.lib._async.report_exc_info', new_callable=AsyncMock) @mock.patch('rollbar.report_exc_info') def test_should_use_async_report_exc_info_if_any_async_handler( @@ -100,7 +100,7 @@ def test_should_use_async_report_exc_info_if_any_async_handler( self.assertTrue(async_report_exc_info.called) self.assertFalse(sync_report_exc_info.called) - @unittest2.skipUnless(ASYNC_REPORT_ENABLED, 'Requires Python 3.6+') + @unittest.skipUnless(ASYNC_REPORT_ENABLED, 'Requires Python 3.6+') @mock.patch('logging.Logger.warning') @mock.patch('rollbar.lib._async.report_exc_info', new_callable=AsyncMock) @mock.patch('rollbar.report_exc_info') diff --git a/rollbar/test/asgi_tests/test_spec.py b/rollbar/test/asgi_tests/test_spec.py index cec8f42a..82cd17c8 100644 --- a/rollbar/test/asgi_tests/test_spec.py +++ b/rollbar/test/asgi_tests/test_spec.py @@ -1,14 +1,14 @@ import inspect import sys -import unittest2 +import unittest from rollbar.test import BaseTest ALLOWED_PYTHON_VERSION = sys.version_info >= (3, 5) -@unittest2.skipUnless(ALLOWED_PYTHON_VERSION, 'ASGI implementation requires Python3.5+') +@unittest.skipUnless(ALLOWED_PYTHON_VERSION, 'ASGI implementation requires Python3.5+') class ASGISpecTest(BaseTest): def test_asgi_v3_middleware_is_single_callable_coroutine(self): from rollbar.contrib.asgi import ReporterMiddleware diff --git a/rollbar/test/async_tests/__init__.py b/rollbar/test/async_tests/__init__.py index b461bd75..3fd86539 100644 --- a/rollbar/test/async_tests/__init__.py +++ b/rollbar/test/async_tests/__init__.py @@ -1,9 +1,9 @@ import sys -import unittest2 +import unittest def _load_tests(loader, tests, pattern): - return unittest2.TestSuite() + return unittest.TestSuite() if sys.version_info < (3, 6): diff --git a/rollbar/test/async_tests/test_async.py b/rollbar/test/async_tests/test_async.py index 7c5e1abf..9779f587 100644 --- a/rollbar/test/async_tests/test_async.py +++ b/rollbar/test/async_tests/test_async.py @@ -6,7 +6,7 @@ except ImportError: import mock -import unittest2 +import unittest import rollbar from rollbar.lib._async import AsyncMock @@ -15,7 +15,7 @@ ALLOWED_PYTHON_VERSION = sys.version_info >= (3, 6) -@unittest2.skipUnless(ALLOWED_PYTHON_VERSION, 'Async support requires Python3.6+') +@unittest.skipUnless(ALLOWED_PYTHON_VERSION, 'Async support requires Python3.6+') class AsyncLibTest(BaseTest): default_settings = copy.deepcopy(rollbar.SETTINGS) diff --git a/rollbar/test/fastapi_tests/__init__.py b/rollbar/test/fastapi_tests/__init__.py index b461bd75..3fd86539 100644 --- a/rollbar/test/fastapi_tests/__init__.py +++ b/rollbar/test/fastapi_tests/__init__.py @@ -1,9 +1,9 @@ import sys -import unittest2 +import unittest def _load_tests(loader, tests, pattern): - return unittest2.TestSuite() + return unittest.TestSuite() if sys.version_info < (3, 6): diff --git a/rollbar/test/fastapi_tests/test_logger.py b/rollbar/test/fastapi_tests/test_logger.py index d9ca3754..4ef2cdb0 100644 --- a/rollbar/test/fastapi_tests/test_logger.py +++ b/rollbar/test/fastapi_tests/test_logger.py @@ -13,7 +13,7 @@ except ImportError: FASTAPI_INSTALLED = False -import unittest2 +import unittest import rollbar from rollbar.test import BaseTest @@ -21,7 +21,7 @@ ALLOWED_PYTHON_VERSION = sys.version_info >= (3, 6) -@unittest2.skipUnless( +@unittest.skipUnless( FASTAPI_INSTALLED and ALLOWED_PYTHON_VERSION, 'FastAPI LoggerMiddleware requires Python3.6+', ) diff --git a/rollbar/test/fastapi_tests/test_middleware.py b/rollbar/test/fastapi_tests/test_middleware.py index 26c929eb..6cecf48b 100644 --- a/rollbar/test/fastapi_tests/test_middleware.py +++ b/rollbar/test/fastapi_tests/test_middleware.py @@ -14,7 +14,7 @@ except ImportError: FASTAPI_INSTALLED = False -import unittest2 +import unittest import rollbar from rollbar.lib._async import AsyncMock @@ -23,7 +23,7 @@ ALLOWED_PYTHON_VERSION = sys.version_info >= (3, 6) -@unittest2.skipUnless( +@unittest.skipUnless( FASTAPI_INSTALLED and ALLOWED_PYTHON_VERSION, 'FastAPI requires Python3.6+' ) class ReporterMiddlewareTest(BaseTest): @@ -258,7 +258,7 @@ async def root(): 'Failed to report asynchronously. Trying to report synchronously.' ) - @unittest2.skipUnless( + @unittest.skipUnless( sys.version_info >= (3, 6), 'Global request access requires Python 3.6+' ) @mock.patch('rollbar.contrib.starlette.middleware.store_current_request') @@ -305,7 +305,7 @@ async def read_root(): scope = store_current_request.call_args[0][0] self.assertDictContainsSubset(expected_scope, scope) - @unittest2.skipUnless( + @unittest.skipUnless( sys.version_info >= (3, 6), 'Global request access is supported in Python 3.6+' ) def test_should_return_current_request(self): diff --git a/rollbar/test/fastapi_tests/test_routing.py b/rollbar/test/fastapi_tests/test_routing.py index 28fb0467..bd7f6e71 100644 --- a/rollbar/test/fastapi_tests/test_routing.py +++ b/rollbar/test/fastapi_tests/test_routing.py @@ -17,7 +17,7 @@ FASTAPI_INSTALLED = False ALLOWED_FASTAPI_VERSION = False -import unittest2 +import unittest import rollbar from rollbar.lib._async import AsyncMock @@ -27,7 +27,7 @@ ALLOWED_PYTHON_VERSION = sys.version_info >= (3, 6) -@unittest2.skipUnless( +@unittest.skipUnless( FASTAPI_INSTALLED and ALLOWED_PYTHON_VERSION, 'FastAPI requires Python3.6+' ) class LoggingRouteUnsupportedFastAPIVersionTest(BaseTest): @@ -64,10 +64,10 @@ def test_should_disable_loading_route_handler_if_fastapi_is_too_old(self): fastapi.__version__ = fastapi_version -@unittest2.skipUnless( +@unittest.skipUnless( FASTAPI_INSTALLED and ALLOWED_PYTHON_VERSION, 'FastAPI requires Python3.6+' ) -@unittest2.skipUnless(ALLOWED_FASTAPI_VERSION, 'FastAPI v0.41.0+ is required') +@unittest.skipUnless(ALLOWED_FASTAPI_VERSION, 'FastAPI v0.41.0+ is required') class LoggingRouteTest(BaseTest): default_settings = copy.deepcopy(rollbar.SETTINGS) @@ -686,7 +686,7 @@ def test_should_warn_if_middleware_in_use(self): ' This can cause in duplicate occurrences.' ) - @unittest2.skipUnless( + @unittest.skipUnless( sys.version_info >= (3, 6), 'Global request access requires Python 3.6+' ) @mock.patch('rollbar.contrib.fastapi.routing.store_current_request') @@ -733,7 +733,7 @@ async def read_root(): scope = store_current_request.call_args[0][0] self.assertDictContainsSubset(expected_scope, scope) - @unittest2.skipUnless( + @unittest.skipUnless( sys.version_info >= (3, 6), 'Global request access is supported in Python 3.6+' ) def test_should_return_current_request(self): diff --git a/rollbar/test/fastapi_tests/test_utils.py b/rollbar/test/fastapi_tests/test_utils.py index 9a787372..db14e126 100644 --- a/rollbar/test/fastapi_tests/test_utils.py +++ b/rollbar/test/fastapi_tests/test_utils.py @@ -7,14 +7,14 @@ except ImportError: FASTAPI_INSTALLED = False -import unittest2 +import unittest from rollbar.test import BaseTest ALLOWED_PYTHON_VERSION = sys.version_info >= (3, 6) -@unittest2.skipUnless( +@unittest.skipUnless( FASTAPI_INSTALLED and ALLOWED_PYTHON_VERSION, 'FastAPI requires Python3.6+' ) class UtilsMiddlewareTest(BaseTest): @@ -66,7 +66,7 @@ def test_should_return_empty_list_if_rollbar_middlewares_not_installed(self): self.assertListEqual(middlewares, []) -@unittest2.skipUnless( +@unittest.skipUnless( FASTAPI_INSTALLED and ALLOWED_PYTHON_VERSION, 'FastAPI requires Python3.6+' ) class UtilsBareRoutingTest(BaseTest): diff --git a/rollbar/test/starlette_tests/__init__.py b/rollbar/test/starlette_tests/__init__.py index b461bd75..3fd86539 100644 --- a/rollbar/test/starlette_tests/__init__.py +++ b/rollbar/test/starlette_tests/__init__.py @@ -1,9 +1,9 @@ import sys -import unittest2 +import unittest def _load_tests(loader, tests, pattern): - return unittest2.TestSuite() + return unittest.TestSuite() if sys.version_info < (3, 6): diff --git a/rollbar/test/starlette_tests/test_logger.py b/rollbar/test/starlette_tests/test_logger.py index ed9acb44..6c7b61d7 100644 --- a/rollbar/test/starlette_tests/test_logger.py +++ b/rollbar/test/starlette_tests/test_logger.py @@ -13,7 +13,7 @@ except ImportError: STARLETTE_INSTALLED = False -import unittest2 +import unittest import rollbar from rollbar.test import BaseTest @@ -21,7 +21,7 @@ ALLOWED_PYTHON_VERSION = sys.version_info >= (3, 6) -@unittest2.skipUnless( +@unittest.skipUnless( STARLETTE_INSTALLED and ALLOWED_PYTHON_VERSION, 'Starlette LoggerMiddleware requires Python3.6+', ) diff --git a/rollbar/test/starlette_tests/test_middleware.py b/rollbar/test/starlette_tests/test_middleware.py index 1500f487..fcc26136 100644 --- a/rollbar/test/starlette_tests/test_middleware.py +++ b/rollbar/test/starlette_tests/test_middleware.py @@ -14,7 +14,7 @@ except ImportError: STARLETTE_INSTALLED = False -import unittest2 +import unittest import rollbar from rollbar.lib._async import AsyncMock @@ -23,7 +23,7 @@ ALLOWED_PYTHON_VERSION = sys.version_info >= (3, 6) -@unittest2.skipUnless( +@unittest.skipUnless( STARLETTE_INSTALLED and ALLOWED_PYTHON_VERSION, 'Starlette requires Python3.6+' ) class ReporterMiddlewareTest(BaseTest): @@ -232,7 +232,7 @@ async def root(request): 'Failed to report asynchronously. Trying to report synchronously.' ) - @unittest2.skipUnless( + @unittest.skipUnless( sys.version_info >= (3, 6), 'Global request access requires Python 3.6+' ) @mock.patch('rollbar.contrib.starlette.middleware.store_current_request') @@ -276,7 +276,7 @@ async def root(request): scope = store_current_request.call_args[0][0] self.assertDictContainsSubset(expected_scope, scope) - @unittest2.skipUnless( + @unittest.skipUnless( sys.version_info >= (3, 6), 'Global request access is supported in Python 3.6+' ) def test_should_return_current_request(self): diff --git a/rollbar/test/starlette_tests/test_requests.py b/rollbar/test/starlette_tests/test_requests.py index 34aabebe..75bacb1d 100644 --- a/rollbar/test/starlette_tests/test_requests.py +++ b/rollbar/test/starlette_tests/test_requests.py @@ -7,14 +7,14 @@ except ImportError: STARLETTE_INSTALLED = False -import unittest2 +import unittest from rollbar.test import BaseTest ALLOWED_PYTHON_VERSION = sys.version_info >= (3, 6) -@unittest2.skipUnless( +@unittest.skipUnless( STARLETTE_INSTALLED and ALLOWED_PYTHON_VERSION, 'Global request access requires Python3.6+', ) diff --git a/rollbar/test/test_lib.py b/rollbar/test/test_lib.py index 2793fab8..1facb933 100644 --- a/rollbar/test/test_lib.py +++ b/rollbar/test/test_lib.py @@ -2,6 +2,8 @@ from rollbar.test import BaseTest +import six + class RollbarLibTest(BaseTest): def test_dict_merge_not_dict(self): a = {'a': {'b': 42}} @@ -56,4 +58,4 @@ def test_dict_merge_dicts_select_poll(self): self.assertIn('b', result['a']) self.assertEqual(42, result['a']['b']) self.assertIn('y', result['a']) - self.assertRegex(result['a']['y'], r'Uncopyable obj') + six.assertRegex(self, result['a']['y'], r'Uncopyable obj') diff --git a/rollbar/test/test_rollbar.py b/rollbar/test/test_rollbar.py index 8cc2be29..26d9ab6f 100644 --- a/rollbar/test/test_rollbar.py +++ b/rollbar/test/test_rollbar.py @@ -17,6 +17,7 @@ import mock import unittest +import six import rollbar from rollbar.lib import python_major_version, string_types @@ -1189,7 +1190,7 @@ def test_args_lambda_with_star_args(self, send_payload): varargs = payload['data']['body']['trace']['frames'][-1]['varargspec'] self.assertEqual(1, len(payload['data']['body']['trace']['frames'][-1]['locals'][varargs])) - self.assertRegex(payload['data']['body']['trace']['frames'][-1]['locals'][varargs][0], r'\*+') + six.assertRegex(self, payload['data']['body']['trace']['frames'][-1]['locals'][varargs][0], r'\*+') @mock.patch('rollbar.send_payload') def test_args_lambda_with_star_args_and_args(self, send_payload): @@ -1216,8 +1217,8 @@ def test_args_lambda_with_star_args_and_args(self, send_payload): self.assertEqual('arg1-value', payload['data']['body']['trace']['frames'][-1]['locals']['arg1']) self.assertEqual(2, len(payload['data']['body']['trace']['frames'][-1]['locals'][varargs])) - self.assertRegex(payload['data']['body']['trace']['frames'][-1]['locals'][varargs][0], r'\*+') - self.assertRegex(payload['data']['body']['trace']['frames'][-1]['locals'][varargs][1], r'\*+') + six.assertRegex(self, payload['data']['body']['trace']['frames'][-1]['locals'][varargs][0], r'\*+') + six.assertRegex(self, payload['data']['body']['trace']['frames'][-1]['locals'][varargs][1], r'\*+') @mock.patch('rollbar.send_payload') def test_args_lambda_with_kwargs(self, send_payload): @@ -1382,8 +1383,8 @@ def _raise(password='sensitive', clear='text'): self.assertEqual(2, len(payload['data']['body']['trace']['frames'][-1]['argspec'])) self.assertEqual('password', payload['data']['body']['trace']['frames'][-1]['argspec'][0]) - self.assertRegex(payload['data']['body']['trace']['frames'][-1]['locals']['password'], r'\*+') - self.assertRegex(payload['data']['body']['trace']['frames'][-1]['locals']['headers']['Authorization'], r'\*+') + six.assertRegex(self, payload['data']['body']['trace']['frames'][-1]['locals']['password'], r'\*+') + six.assertRegex(self, payload['data']['body']['trace']['frames'][-1]['locals']['headers']['Authorization'], r'\*+') self.assertEqual('clear', payload['data']['body']['trace']['frames'][-1]['argspec'][1]) self.assertEqual('text', payload['data']['body']['trace']['frames'][-1]['locals']['clear']) @@ -1437,7 +1438,7 @@ def _raise(**kwargs): self.assertEqual(2, len(payload['data']['body']['trace']['frames'][-1]['locals'][keywords])) self.assertIn('password', payload['data']['body']['trace']['frames'][-1]['locals'][keywords]) - self.assertRegex(payload['data']['body']['trace']['frames'][-1]['locals'][keywords]['password'], r'\*+') + six.assertRegex(self, payload['data']['body']['trace']['frames'][-1]['locals'][keywords]['password'], r'\*+') self.assertIn('clear', payload['data']['body']['trace']['frames'][-1]['locals'][keywords]) self.assertEqual('text', payload['data']['body']['trace']['frames'][-1]['locals'][keywords]['clear']) @@ -1468,8 +1469,8 @@ def _raise(): payload = send_payload.call_args[0][0] - self.assertRegex(payload['data']['body']['trace']['frames'][-1]['locals']['password'], r'\*+') - self.assertRegex(payload['data']['body']['trace']['frames'][-1]['locals']['Password'], r'\*+') + six.assertRegex(self, payload['data']['body']['trace']['frames'][-1]['locals']['password'], r'\*+') + six.assertRegex(self, payload['data']['body']['trace']['frames'][-1]['locals']['Password'], r'\*+') self.assertIn('_invalid', payload['data']['body']['trace']['frames'][-1]['locals']) binary_type_name = 'str' if python_major_version() < 3 else 'bytes' @@ -1786,19 +1787,19 @@ def test_scrub_webob_request_data(self): self.assertEqual('I am from NSA', unscrubbed['headers']['Authorization']) scrubbed = rollbar._transform(unscrubbed) - self.assertRegex(scrubbed['url'], r'http://example.com/the/path\?(q=hello&password=-+)|(password=-+&q=hello)') + six.assertRegex(self, scrubbed['url'], r'http://example.com/the/path\?(q=hello&password=-+)|(password=-+&q=hello)') self.assertEqual(scrubbed['GET']['q'], 'hello') - self.assertRegex(scrubbed['GET']['password'], r'\*+') + six.assertRegex(self, scrubbed['GET']['password'], r'\*+') self.assertEqual(scrubbed['POST']['foo'], 'bar') - self.assertRegex(scrubbed['POST']['confirm_password'], r'\*+') - self.assertRegex(scrubbed['POST']['token'], r'\*+') + six.assertRegex(self, scrubbed['POST']['confirm_password'], r'\*+') + six.assertRegex(self, scrubbed['POST']['token'], r'\*+') self.assertEqual('5.6.7.8', scrubbed['headers']['X-Real-Ip']) - self.assertRegex(scrubbed['headers']['Cookies'], r'\*+') - self.assertRegex(scrubbed['headers']['Authorization'], r'\*+') + six.assertRegex(self, scrubbed['headers']['Cookies'], r'\*+') + six.assertRegex(self, scrubbed['headers']['Authorization'], r'\*+') def test_filter_ip_no_user_ip(self): request_data = {'something': 'but no ip'} diff --git a/rollbar/test/test_scruburl_transform.py b/rollbar/test/test_scruburl_transform.py index cabeabe6..b0a63e08 100644 --- a/rollbar/test/test_scruburl_transform.py +++ b/rollbar/test/test_scruburl_transform.py @@ -1,4 +1,5 @@ import copy +import six from rollbar.lib import map, transforms, string_types, urlparse, parse_qs, python_major_version from rollbar.lib.transforms.scruburl import ScrubUrlTransform, _starts_with_auth_re @@ -146,5 +147,5 @@ def test_scrub_dict_nested_key_match_with_circular_ref(self): self.assertNotIn('secret', result['url'][0]['link']) self.assertNotIn('secr3t', result['link'][0]['url']) self.assertNotIn('secret', result['link'][0]['url']) - self.assertNotRegex(result['url'][0]['link'], r'^-+$') - self.assertNotRegex(result['link'][0]['url'], r'^-+$') + six.assertNotRegex(self, result['url'][0]['link'], r'^-+$') + six.assertNotRegex(self, result['link'][0]['url'], r'^-+$') diff --git a/rollbar/test/test_serializable_transform.py b/rollbar/test/test_serializable_transform.py index 4ae96248..3a3cab85 100644 --- a/rollbar/test/test_serializable_transform.py +++ b/rollbar/test/test_serializable_transform.py @@ -2,6 +2,7 @@ import base64 import copy import enum +import sys try: # Python 3 @@ -10,6 +11,8 @@ # Python 2.7 from collections import Mapping +import six + from rollbar.lib import transforms, python_major_version from rollbar.lib.transforms.serializable import SerializableTransform @@ -145,7 +148,13 @@ def test_encode_int(self): def test_encode_empty_tuple(self): start = () expected = () - self._assertSerialized(start, expected) + + skip_id_check = False + # different behavior in 3.11 + if sys.version_info >= (3, 11): + skip_id_check = True + + self._assertSerialized(start, expected, skip_id_check=skip_id_check) def test_encode_empty_list(self): start = [] @@ -237,7 +246,7 @@ def __repr__(self): if python_major_version() < 3: self.assertEqual(result['custom'], b'hello') else: - self.assertRegex(result['custom'], "") + six.assertRegex(self, result['custom'], "") def test_encode_with_custom_repr_returns_object(self): class CustomRepr(object): @@ -248,7 +257,7 @@ def __repr__(self): serializable = SerializableTransform(safelist_types=[CustomRepr]) result = transforms.transform(start, serializable) - self.assertRegex(result['custom'], "") + six.assertRegex(self, result['custom'], "") def test_encode_with_custom_repr_returns_unicode(self): class CustomRepr(object): @@ -268,7 +277,7 @@ def __repr__(self): start = {'hello': 'world', 'custom': CustomRepr()} serializable = SerializableTransform(safelist_types=[CustomRepr]) result = transforms.transform(start, serializable) - self.assertRegex(result['custom'], "") + six.assertRegex(self, result['custom'], "") def test_encode_with_bad_str_doesnt_die(self): @@ -284,4 +293,4 @@ def __repr__(self): start = {'hello': 'world', 'custom': CustomRepr()} serializable = SerializableTransform(safelist_types=[CustomRepr]) result = transforms.transform(start, serializable) - self.assertRegex(result['custom'], "") + six.assertRegex(self, result['custom'], "") diff --git a/rollbar/test/test_shortener_transform.py b/rollbar/test/test_shortener_transform.py index 20736f94..11fffb2f 100644 --- a/rollbar/test/test_shortener_transform.py +++ b/rollbar/test/test_shortener_transform.py @@ -103,6 +103,8 @@ def test_shorten_frozenset(self): def test_shorten_array(self): expected = 'array(\'l\', [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, ...])' + if sys.version_info >= (3, 10): + expected = '[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, ...]' self._assert_shortened('array', expected) def test_shorten_deque(self): diff --git a/rollbar/test/twisted_tests/test_twisted.py b/rollbar/test/twisted_tests/test_twisted.py index 66a57305..c8e4939a 100644 --- a/rollbar/test/twisted_tests/test_twisted.py +++ b/rollbar/test/twisted_tests/test_twisted.py @@ -54,7 +54,7 @@ def test_base_case(self, send_payload): self.proto.dataReceived('8') self.assertEqual(int(self.tr.value()), 64) - self.assertEqual(send_payload.called, False) + self.assertFalse(send_payload.called) @mock.patch('rollbar.send_payload') def test_caught_exception(self, send_payload): @@ -63,7 +63,7 @@ def test_caught_exception(self, send_payload): errors = self.flushLoggedErrors(ValueError) self.assertEqual(len(errors), 1) - self.assertEqual(send_payload.called, True) + self.assertTrue(send_payload.called) payload = send_payload.call_args[0][0] data = payload['data'] diff --git a/setup.py b/setup.py index 165391d5..59bde98b 100644 --- a/setup.py +++ b/setup.py @@ -19,7 +19,6 @@ tests_require = [ 'webob', 'blinker', - 'unittest2', 'mock<=3.0.5; python_version < "3.3"', 'enum34; python_version < "3.4"', 'httpx; python_version >= "3.6"', @@ -55,6 +54,9 @@ "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Development Status :: 5 - Production/Stable", @@ -83,8 +85,8 @@ # always installs the latest version of the package. 'requests>=0.12.1; python_version == "2.7"', 'requests>=0.12.1; python_version >= "3.6"', - 'requests<2.26,>=0.12.1; python_version == "3.5"', - 'requests<2.22,>=0.12.1; python_version == "3.4"', + 'requests>=0.12.1; python_version == "3.5"', + 'requests>=0.12.1; python_version == "3.4"', 'six>=1.9.0' ], tests_require=tests_require, diff --git a/shell.nix b/shell.nix deleted file mode 100644 index edeea083..00000000 --- a/shell.nix +++ /dev/null @@ -1,31 +0,0 @@ -{ - pkgs ? import {} -}: - -with pkgs; -let -python = let - packageOverrides = self: super: { - pandas = super.pandas.overridePythonAttrs(old: { - doCheck = false; - }); - - twine = super.twine.overridePythonAttrs(old: { - doCheck = false; - }); - - tqdm = super.tqdm.overridePythonAttrs(old: { - doCheck = false; - }); - }; -in python36.override { inherit packageOverrides; }; -pyrollbar = pkgs.callPackage ./. { inherit python; }; -pyenv = python.withPackages(ps: with ps; [ pyrollbar twine unittest2 mock pyramid ]); - -in - -stdenv.mkDerivation { - name = "pyrollbar-shell"; - buildInputs = [ pyenv ]; -} -