diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 21eb69730..9fb2d30fc 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -28,10 +28,10 @@ jobs: - name: Set up Python uses: actions/setup-python@v4 with: - python-version: 3.8 + python-version: 3.11 - uses: Gr1N/setup-poetry@v8 with: - poetry-version: 1.8.2 + poetry-version: 1.8.3 - name: Install Poetry run: | poetry config virtualenvs.create false && diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 8b7b4ad5d..c23b614b4 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -30,10 +30,10 @@ jobs: - name: Set up Python uses: actions/setup-python@v4 with: - python-version: 3.8 + python-version: 3.11 - uses: Gr1N/setup-poetry@v8 with: - poetry-version: 1.5.0 + poetry-version: 1.8.3 - name: Install Poetry run: | poetry config virtualenvs.create false && diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index cdf4785db..b04da7592 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ default_language_version: node: 18.4.0 - python: python3.8 + python: python3.11 repos: - repo: https://github.com/python/black rev: 24.4.0 @@ -45,7 +45,19 @@ repos: - stylelint@13.13.1 - stylelint-config-torchbox@1.0.0 - repo: https://github.com/adamchainz/django-upgrade - rev: 1.16.0 + rev: 1.20.0 hooks: - id: django-upgrade args: [--target-version, '4.2'] # Replace with Django version + - repo: https://github.com/asottile/pyupgrade + rev: v3.17.0 + hooks: + - id: pyupgrade + - repo: https://github.com/python-poetry/poetry + rev: '1.8.3' # keep version in sync with version installed in the Dockerfile + hooks: + - id: poetry-check + - id: poetry-lock + # Never update dependencies and only run on changes to pyproject.toml + args: [--no-update] + files: ^pyproject.toml$ diff --git a/.python-version b/.python-version index b91632216..2c0733315 100644 --- a/.python-version +++ b/.python-version @@ -1 +1 @@ -3.8.6 \ No newline at end of file +3.11 diff --git a/Dockerfile b/Dockerfile index 128ee073c..02d5d883b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,12 +17,12 @@ RUN npm run build:prod # ones becase they use a different C compiler. Debian images also come with # all useful packages required for image manipulation out of the box. They # however weight a lot, approx. up to 1.5GiB per built image. -FROM python:3.8 as production +FROM python:3.11-bookworm as production ARG POETRY_INSTALL_ARGS="--no-dev" # IMPORTANT: Remember to review .circleci/config.yml when upgrading -ARG POETRY_VERSION=1.8.2 +ARG POETRY_VERSION=1.8.3 # Install dependencies in a virtualenv ENV VIRTUAL_ENV=/venv @@ -37,8 +37,8 @@ WORKDIR /app # * PATH - Make sure that Poetry is on the PATH, along with our venv # * PYTHONUNBUFFERED - This is useful so Python does not hold any messages # from being output. -# https://docs.python.org/3.8/using/cmdline.html#envvar-PYTHONUNBUFFERED -# https://docs.python.org/3.8/using/cmdline.html#cmdoption-u +# https://docs.python.org/3.11/using/cmdline.html#envvar-PYTHONUNBUFFERED +# https://docs.python.org/3.11/using/cmdline.html#cmdoption-u # * DJANGO_SETTINGS_MODULE - default settings used in the container. # * PORT - default port used. Please match with EXPOSE so it works on Dokku. # Heroku will ignore EXPOSE and only set PORT variable. PORT variable is diff --git a/README.md b/README.md index 2462af2f7..14cfae754 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,7 @@ if you have older versions already installed they _may_ work, but are not guaran - [Install instructions](https://docs.docker.com/compose/install/) (Linux-only: Compose is already installed for Mac users as part of Docker Desktop.) - [Fabric](https://www.fabfile.org/), version 2.4.0 or up - [Install instructions](https://www.fabfile.org/installing.html) -- Python, version 3.6.9 or up +- Python, version 3.11 or up Note that on Mac OS, if you have an older version of fabric installed, you may need to uninstall the old one and then install the new version with pip3: diff --git a/docs/upgrading.md b/docs/upgrading.md index ad81f6158..7b41076c3 100644 --- a/docs/upgrading.md +++ b/docs/upgrading.md @@ -106,50 +106,6 @@ As well as testing the critical paths, these areas of functionality should be ch --- -#### Wagtail v3 Upgrade notes - -When the site was upgraded to Wagtail v3 the original issue at v2.15 & v2.16 noted above was fixed. - -Wagtail 3 introduced a lot of Javascript generated editor template "furniture" such as the admin side bar. To accommodate hiding the search input for Student accounts the following has been implemented. - -- New wagtail_hooks [global_admin_css](https://github.com/torchbox/rca-wagtail-2019/blob/7e5bb3c9201d8a7b7fa6e0288d4bee0ba1c79f52/rca/people/wagtail_hooks.py#L21) and [global_admin_js](https://github.com/torchbox/rca-wagtail-2019/blob/7e5bb3c9201d8a7b7fa6e0288d4bee0ba1c79f52/rca/people/wagtail_hooks.py#L13) -- Wagtail [Base.html](https://github.com/torchbox/rca-wagtail-2019/blob/support/wagtail-3.0-upgrade/rca/account_management/templates/wagtailadmin/base.html) override. Specifically [here](https://github.com/torchbox/rca-wagtail-2019/blob/7e5bb3c9201d8a7b7fa6e0288d4bee0ba1c79f52/rca/account_management/templates/wagtailadmin/base.html#L12) Which adds a new data-attribute for the hooks above to operate on. - -Wagtail 3 introduced a new [FieldPanel `permission` parameter](https://docs.wagtail.org/en/stable/reference/pages/panels.html#wagtail.admin.panels.FieldPanel.permission) which has been use on many fields of the [StudentPage](https://github.com/torchbox/rca-wagtail-2019/blob/support/wagtail-3.0-upgrade/rca/people/models.py#L777) content_panels. - -Additionally there are some Custom Panels which help to add the `permission` parameter to child FieldPanels and control panel visibility in general. - -- [StudentPageInlinePanel](https://github.com/torchbox/rca-wagtail-2019/blob/7e5bb3c9201d8a7b7fa6e0288d4bee0ba1c79f52/rca/people/utils.py#L72), including the custom templates at the following locations: - - `rca/people/templates/admin/panels/student_page_inline_panel.html` - - `rca/people/templates/admin/panels/student_page_inline_panel_child.html` -- [StudentPagePromoteTab](https://github.com/torchbox/rca-wagtail-2019/blob/7e5bb3c9201d8a7b7fa6e0288d4bee0ba1c79f52/rca/people/utils.py#L86) -- [StudentPageSettingsTab](https://github.com/torchbox/rca-wagtail-2019/blob/7e5bb3c9201d8a7b7fa6e0288d4bee0ba1c79f52/rca/people/utils.py#L107) - -`use_json_field` argument added to `StreamField` (creates new migration files) - ---- - -#### Wagtail v4 Upgrade notes - -- Removed `wagtail_redirect_importer` as it's now part of Wagtail since version `2.10` - ---- - -#### Wagtail v5 Upgrade notes - -- Added `index.AutocompleteField` entries for the relevant fields on the model’s `search_fields` definition, as the old `SearchField("some_field", partial_match=True)` format is no longer supported. -- Changes to header CSS classes in `ModelAdmin` templates -- `wagtailsearch.Query` has been moved to `wagtail.contrib.search_promotions` -- `status` classes are now `w-status` - ---- - -#### Wagtail v6 Upgrade notes - -- `StreamField` no longer requires `use_json_field=True` - ---- - ## Overridden core Wagtail templates The following templates are overridden and should be checked for changes when upgrading Wagtail: @@ -183,3 +139,69 @@ This is the path to the Django template which is used to display the “password ```python WAGTAIL_PASSWORD_REQUIRED_TEMPLATE = "patterns/pages/wagtail/password_required.html" ``` + +## Python version upgrade + +We don't generally upgrade python versions until a new LTS/Major version is released and has been stable for a while. We prefer to be running a more stable version of python. + +If you are upgrading python, you should check the following python version references are updated: + +- The `python` key in the `tool.poetry.dependencies` section of the `pyproject.toml` file. +- The `python` key in the pre-commit configuration file `.pre-commit-config.yaml`. +- The `python` image tag in the `Dockerfile`/s. +- Any references to the python version in documentation. +- Any references to the python version in the CI configuration file `gitlab-ci.yaml`. + +### Pyupgrade tool + +If you are upgrading python. There is a development tool available to help with modernising the codebase. This is installed as part of the poetry development dependencies. + +To run the tool, use the following command: + +```bash +git ls-files -z -- '*.py' | xargs -0 pyupgrade [python-version-arg] +``` + +Where `[python-version-arg]` is the version of python you are upgrading to. + +To view the available version arguments, use the following command: + +```bash +pyupgrade --help +``` + +### Pre-commit + Pyupgrade + +The pyupgrade tool is run as a step in the pre-commit configuration. This will help you to use the modern syntax as you work on the codebase. + +You can manually run the pre-commit checks on `*.py` files using the following command: + +```bash +git ls-files -z -- '*.py' | xargs -0 | pre-commit run --files +``` + +## Django upgrades + +If you are upgrading Django. There is a development tool available to help with modernising the codebase. This is installed as part of the poetry development dependencies. + +### Django upgrade tool + +If you are upgrading django. There is a development tool available to help with modernising the codebase. This is installed as part of the poetry development dependencies. + +To run the tool, use the following command: + +```bash +git ls-files -z -- '*.py' | xargs -0 django-upgrade --target-version [django-version-arg] +``` + +Where `[django-version-arg]` is the version of Django you are upgrading to. + +### Pre-commit + django-upgrade + +The django-upgrade tool is run as a step in the pre-commit configuration. This will help you to use the modern syntax as you work on the codebase. + +You can manually run the pre-commit checks on `*.py` files using the following command: + +```bash +git ls-files -z -- '*.py' | xargs -0 | pre-commit run --files +``` diff --git a/fabfile.py b/fabfile.py index dcb00f747..a9e9a0946 100644 --- a/fabfile.py +++ b/fabfile.py @@ -9,7 +9,7 @@ # Process .env file if os.path.exists(".env"): - with open(".env", "r") as f: + with open(".env") as f: for line in f.readlines(): line = line.strip() if not line or line.startswith("#") or "=" not in line: diff --git a/poetry.lock b/poetry.lock index 9552e39bc..bb5bac2b5 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.8.2 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand. [[package]] name = "anyascii" @@ -22,9 +22,6 @@ files = [ {file = "asgiref-3.7.2.tar.gz", hash = "sha256:9e0ce3aa93a819ba5b45120216b23878cf6e8525eb3848653452b4192b92afed"}, ] -[package.dependencies] -typing-extensions = {version = ">=4", markers = "python_version < \"3.11\""} - [package.extras] tests = ["mypy (>=0.800)", "pytest", "pytest-asyncio"] @@ -50,40 +47,9 @@ files = [ {file = "Babel-2.14.0.tar.gz", hash = "sha256:6919867db036398ba21eb5c7a0f6b28ab8cbc3ae7a73a44ebe34ae74a4e7d363"}, ] -[package.dependencies] -pytz = {version = ">=2015.7", markers = "python_version < \"3.9\""} - [package.extras] dev = ["freezegun (>=1.0,<2.0)", "pytest (>=6.0)", "pytest-cov"] -[[package]] -name = "backports-zoneinfo" -version = "0.2.1" -description = "Backport of the standard library zoneinfo module" -optional = false -python-versions = ">=3.6" -files = [ - {file = "backports.zoneinfo-0.2.1-cp36-cp36m-macosx_10_14_x86_64.whl", hash = "sha256:da6013fd84a690242c310d77ddb8441a559e9cb3d3d59ebac9aca1a57b2e18bc"}, - {file = "backports.zoneinfo-0.2.1-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:89a48c0d158a3cc3f654da4c2de1ceba85263fafb861b98b59040a5086259722"}, - {file = "backports.zoneinfo-0.2.1-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:1c5742112073a563c81f786e77514969acb58649bcdf6cdf0b4ed31a348d4546"}, - {file = "backports.zoneinfo-0.2.1-cp36-cp36m-win32.whl", hash = "sha256:e8236383a20872c0cdf5a62b554b27538db7fa1bbec52429d8d106effbaeca08"}, - {file = "backports.zoneinfo-0.2.1-cp36-cp36m-win_amd64.whl", hash = "sha256:8439c030a11780786a2002261569bdf362264f605dfa4d65090b64b05c9f79a7"}, - {file = "backports.zoneinfo-0.2.1-cp37-cp37m-macosx_10_14_x86_64.whl", hash = "sha256:f04e857b59d9d1ccc39ce2da1021d196e47234873820cbeaad210724b1ee28ac"}, - {file = "backports.zoneinfo-0.2.1-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:17746bd546106fa389c51dbea67c8b7c8f0d14b5526a579ca6ccf5ed72c526cf"}, - {file = "backports.zoneinfo-0.2.1-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:5c144945a7752ca544b4b78c8c41544cdfaf9786f25fe5ffb10e838e19a27570"}, - {file = "backports.zoneinfo-0.2.1-cp37-cp37m-win32.whl", hash = "sha256:e55b384612d93be96506932a786bbcde5a2db7a9e6a4bb4bffe8b733f5b9036b"}, - {file = "backports.zoneinfo-0.2.1-cp37-cp37m-win_amd64.whl", hash = "sha256:a76b38c52400b762e48131494ba26be363491ac4f9a04c1b7e92483d169f6582"}, - {file = "backports.zoneinfo-0.2.1-cp38-cp38-macosx_10_14_x86_64.whl", hash = "sha256:8961c0f32cd0336fb8e8ead11a1f8cd99ec07145ec2931122faaac1c8f7fd987"}, - {file = "backports.zoneinfo-0.2.1-cp38-cp38-manylinux1_i686.whl", hash = "sha256:e81b76cace8eda1fca50e345242ba977f9be6ae3945af8d46326d776b4cf78d1"}, - {file = "backports.zoneinfo-0.2.1-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:7b0a64cda4145548fed9efc10322770f929b944ce5cee6c0dfe0c87bf4c0c8c9"}, - {file = "backports.zoneinfo-0.2.1-cp38-cp38-win32.whl", hash = "sha256:1b13e654a55cd45672cb54ed12148cd33628f672548f373963b0bff67b217328"}, - {file = "backports.zoneinfo-0.2.1-cp38-cp38-win_amd64.whl", hash = "sha256:4a0f800587060bf8880f954dbef70de6c11bbe59c673c3d818921f042f9954a6"}, - {file = "backports.zoneinfo-0.2.1.tar.gz", hash = "sha256:fadbfe37f74051d024037f223b8e001611eac868b5c5b06144ef4d8b799862f2"}, -] - -[package.extras] -tzdata = ["tzdata"] - [[package]] name = "bcrypt" version = "4.0.1" @@ -176,8 +142,6 @@ mypy-extensions = ">=0.4.3" packaging = ">=22.0" pathspec = ">=0.9.0" platformdirs = ">=2" -tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} -typing-extensions = {version = ">=4.0.1", markers = "python_version < \"3.11\""} [package.extras] colorama = ["colorama (>=0.4.3)"] @@ -225,13 +189,13 @@ crt = ["awscrt (==0.15.3)"] [[package]] name = "certifi" -version = "2024.6.2" +version = "2024.7.4" description = "Python package for providing Mozilla's CA Bundle." optional = false python-versions = ">=3.6" files = [ - {file = "certifi-2024.6.2-py3-none-any.whl", hash = "sha256:ddc6c8ce995e6987e7faf5e3f1b02b302836a0e5d98ece18392cb1a36c72ad56"}, - {file = "certifi-2024.6.2.tar.gz", hash = "sha256:3cd43f1c6fa7dedc5899d69d3ad0398fd018ad1a17fba83ddaf78aa46c747516"}, + {file = "certifi-2024.7.4-py3-none-any.whl", hash = "sha256:c198e21b1289c2ab85ee4e67bb4b4ef3ead0892059901a8d5b622f24a1101e90"}, + {file = "certifi-2024.7.4.tar.gz", hash = "sha256:5a1e7645bc0ec61a09e26c36f6106dd4cf40c6db3a1fb6352b0244e7fb057c7b"}, ] [[package]] @@ -597,7 +561,6 @@ files = [ [package.dependencies] asgiref = ">=3.6.0,<4" -"backports.zoneinfo" = {version = "*", markers = "python_version < \"3.9\""} sqlparse = ">=0.3.1" tzdata = {version = "*", markers = "sys_platform == \"win32\""} @@ -917,13 +880,13 @@ Django = ">=2.2" [[package]] name = "django-upgrade" -version = "1.18.0" +version = "1.20.0" description = "Automatically upgrade your Django project code." optional = false python-versions = ">=3.8" files = [ - {file = "django_upgrade-1.18.0-py3-none-any.whl", hash = "sha256:bae6a466bb9dd63dd7e23b665499b84499b2661348f06b371b88d2e609aa0df9"}, - {file = "django_upgrade-1.18.0.tar.gz", hash = "sha256:ae2a2de13e7804773201aef6af2245fa5d503b0a7c88b85b12cf1fdb84197065"}, + {file = "django_upgrade-1.20.0-py3-none-any.whl", hash = "sha256:938afa1a531399a12904eb71ffacad0c997ddbe0c45ec38bc0883a1cdcfd99ef"}, + {file = "django_upgrade-1.20.0.tar.gz", hash = "sha256:47aa2133972b600a8d935bab8d58d69b2e426bfc985d4c4f4c2fefecd754dd88"}, ] [package.dependencies] @@ -931,18 +894,17 @@ tokenize-rt = ">=4.1" [[package]] name = "djangorestframework" -version = "3.15.1" +version = "3.15.2" description = "Web APIs for Django, made easy." optional = false -python-versions = ">=3.6" +python-versions = ">=3.8" files = [ - {file = "djangorestframework-3.15.1-py3-none-any.whl", hash = "sha256:3ccc0475bce968608cf30d07fb17d8e52d1d7fc8bfe779c905463200750cbca6"}, - {file = "djangorestframework-3.15.1.tar.gz", hash = "sha256:f88fad74183dfc7144b2756d0d2ac716ea5b4c7c9840995ac3bfd8ec034333c1"}, + {file = "djangorestframework-3.15.2-py3-none-any.whl", hash = "sha256:2b8871b062ba1aefc2de01f773875441a961fefbf79f5eed1e32b2f096944b20"}, + {file = "djangorestframework-3.15.2.tar.gz", hash = "sha256:36fe88cd2d6c6bec23dca9804bab2ba5517a8bb9d8f47ebc68981b56840107ad"}, ] [package.dependencies] -"backports.zoneinfo" = {version = "*", markers = "python_version < \"3.9\""} -django = ">=3.0" +django = ">=4.2" [[package]] name = "draftjs-exporter" @@ -1268,25 +1230,6 @@ files = [ {file = "idna-3.7.tar.gz", hash = "sha256:028ff3aadf0609c1fd278d8ea3089299412a7a8b9bd005dd08b9f8285bcb5cfc"}, ] -[[package]] -name = "importlib-metadata" -version = "5.1.0" -description = "Read metadata from Python packages" -optional = false -python-versions = ">=3.7" -files = [ - {file = "importlib_metadata-5.1.0-py3-none-any.whl", hash = "sha256:d84d17e21670ec07990e1044a99efe8d615d860fd176fc29ef5c306068fda313"}, - {file = "importlib_metadata-5.1.0.tar.gz", hash = "sha256:d5059f9f1e8e41f80e9c56c2ee58811450c31984dfa625329ffd7c0dad88a73b"}, -] - -[package.dependencies] -zipp = ">=0.5" - -[package.extras] -docs = ["furo", "jaraco.packaging (>=9)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)"] -perf = ["ipython"] -testing = ["flake8 (<5)", "flufl.flake8", "importlib-resources (>=1.3)", "packaging", "pyfakefs", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=1.3)", "pytest-flake8", "pytest-mypy (>=0.9.1)", "pytest-perf (>=0.9.2)"] - [[package]] name = "invoke" version = "2.2.0" @@ -1559,9 +1502,6 @@ files = [ {file = "Markdown-3.6.tar.gz", hash = "sha256:ed4f41f6daecbeeb96e576ce414c41d2d876daa9a16cb35fa8ed8c2ddfad0224"}, ] -[package.dependencies] -importlib-metadata = {version = ">=4.4", markers = "python_version < \"3.10\""} - [package.extras] docs = ["mdx-gh-links (>=0.2)", "mkdocs (>=1.5)", "mkdocs-gen-files", "mkdocs-literate-nav", "mkdocs-nature (>=0.6)", "mkdocs-section-index", "mkdocstrings[python]"] testing = ["coverage", "pyyaml"] @@ -1662,7 +1602,6 @@ files = [ click = ">=7.0" colorama = {version = ">=0.4", markers = "platform_system == \"Windows\""} ghp-import = ">=1.0" -importlib-metadata = {version = ">=4.3", markers = "python_version < \"3.10\""} jinja2 = ">=2.11.1" markdown = ">=3.2.1" markupsafe = ">=2.0.1" @@ -2220,42 +2159,78 @@ files = [ {file = "pytz-2022.6.tar.gz", hash = "sha256:e89512406b793ca39f5971bc999cc538ce125c0e51c27941bef4568b460095e2"}, ] +[[package]] +name = "pyupgrade" +version = "3.17.0" +description = "A tool to automatically upgrade syntax for newer versions." +optional = false +python-versions = ">=3.9" +files = [ + {file = "pyupgrade-3.17.0-py2.py3-none-any.whl", hash = "sha256:cbc8f67a61d3f4e7ca9c2ef57b9aae67f023d3780ce30c99fccec78401723754"}, + {file = "pyupgrade-3.17.0.tar.gz", hash = "sha256:d5dd1dcaf9a016c31508bb9d3d09fd335d736578092f91df52bb26ac30c37919"}, +] + +[package.dependencies] +tokenize-rt = ">=5.2.0" + [[package]] name = "pyyaml" -version = "5.4.1" +version = "6.0.1" description = "YAML parser and emitter for Python" optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*" +python-versions = ">=3.6" files = [ - {file = "PyYAML-5.4.1-cp27-cp27m-macosx_10_9_x86_64.whl", hash = "sha256:3b2b1824fe7112845700f815ff6a489360226a5609b96ec2190a45e62a9fc922"}, - {file = "PyYAML-5.4.1-cp27-cp27m-win32.whl", hash = "sha256:129def1b7c1bf22faffd67b8f3724645203b79d8f4cc81f674654d9902cb4393"}, - {file = "PyYAML-5.4.1-cp27-cp27m-win_amd64.whl", hash = "sha256:4465124ef1b18d9ace298060f4eccc64b0850899ac4ac53294547536533800c8"}, - {file = "PyYAML-5.4.1-cp27-cp27mu-manylinux1_x86_64.whl", hash = "sha256:bb4191dfc9306777bc594117aee052446b3fa88737cd13b7188d0e7aa8162185"}, - {file = "PyYAML-5.4.1-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:6c78645d400265a062508ae399b60b8c167bf003db364ecb26dcab2bda048253"}, - {file = "PyYAML-5.4.1-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:4e0583d24c881e14342eaf4ec5fbc97f934b999a6828693a99157fde912540cc"}, - {file = "PyYAML-5.4.1-cp36-cp36m-manylinux2014_aarch64.whl", hash = "sha256:72a01f726a9c7851ca9bfad6fd09ca4e090a023c00945ea05ba1638c09dc3347"}, - {file = "PyYAML-5.4.1-cp36-cp36m-manylinux2014_s390x.whl", hash = "sha256:895f61ef02e8fed38159bb70f7e100e00f471eae2bc838cd0f4ebb21e28f8541"}, - {file = "PyYAML-5.4.1-cp36-cp36m-win32.whl", hash = "sha256:3bd0e463264cf257d1ffd2e40223b197271046d09dadf73a0fe82b9c1fc385a5"}, - {file = "PyYAML-5.4.1-cp36-cp36m-win_amd64.whl", hash = "sha256:e4fac90784481d221a8e4b1162afa7c47ed953be40d31ab4629ae917510051df"}, - {file = "PyYAML-5.4.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:5accb17103e43963b80e6f837831f38d314a0495500067cb25afab2e8d7a4018"}, - {file = "PyYAML-5.4.1-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:e1d4970ea66be07ae37a3c2e48b5ec63f7ba6804bdddfdbd3cfd954d25a82e63"}, - {file = "PyYAML-5.4.1-cp37-cp37m-manylinux2014_aarch64.whl", hash = "sha256:cb333c16912324fd5f769fff6bc5de372e9e7a202247b48870bc251ed40239aa"}, - {file = "PyYAML-5.4.1-cp37-cp37m-manylinux2014_s390x.whl", hash = "sha256:fe69978f3f768926cfa37b867e3843918e012cf83f680806599ddce33c2c68b0"}, - {file = "PyYAML-5.4.1-cp37-cp37m-win32.whl", hash = "sha256:dd5de0646207f053eb0d6c74ae45ba98c3395a571a2891858e87df7c9b9bd51b"}, - {file = "PyYAML-5.4.1-cp37-cp37m-win_amd64.whl", hash = "sha256:08682f6b72c722394747bddaf0aa62277e02557c0fd1c42cb853016a38f8dedf"}, - {file = "PyYAML-5.4.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:d2d9808ea7b4af864f35ea216be506ecec180628aced0704e34aca0b040ffe46"}, - {file = "PyYAML-5.4.1-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:8c1be557ee92a20f184922c7b6424e8ab6691788e6d86137c5d93c1a6ec1b8fb"}, - {file = "PyYAML-5.4.1-cp38-cp38-manylinux2014_aarch64.whl", hash = "sha256:fd7f6999a8070df521b6384004ef42833b9bd62cfee11a09bda1079b4b704247"}, - {file = "PyYAML-5.4.1-cp38-cp38-manylinux2014_s390x.whl", hash = "sha256:bfb51918d4ff3d77c1c856a9699f8492c612cde32fd3bcd344af9be34999bfdc"}, - {file = "PyYAML-5.4.1-cp38-cp38-win32.whl", hash = "sha256:fa5ae20527d8e831e8230cbffd9f8fe952815b2b7dae6ffec25318803a7528fc"}, - {file = "PyYAML-5.4.1-cp38-cp38-win_amd64.whl", hash = "sha256:0f5f5786c0e09baddcd8b4b45f20a7b5d61a7e7e99846e3c799b05c7c53fa696"}, - {file = "PyYAML-5.4.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:294db365efa064d00b8d1ef65d8ea2c3426ac366c0c4368d930bf1c5fb497f77"}, - {file = "PyYAML-5.4.1-cp39-cp39-manylinux1_x86_64.whl", hash = "sha256:74c1485f7707cf707a7aef42ef6322b8f97921bd89be2ab6317fd782c2d53183"}, - {file = "PyYAML-5.4.1-cp39-cp39-manylinux2014_aarch64.whl", hash = "sha256:d483ad4e639292c90170eb6f7783ad19490e7a8defb3e46f97dfe4bacae89122"}, - {file = "PyYAML-5.4.1-cp39-cp39-manylinux2014_s390x.whl", hash = "sha256:fdc842473cd33f45ff6bce46aea678a54e3d21f1b61a7750ce3c498eedfe25d6"}, - {file = "PyYAML-5.4.1-cp39-cp39-win32.whl", hash = "sha256:49d4cdd9065b9b6e206d0595fee27a96b5dd22618e7520c33204a4a3239d5b10"}, - {file = "PyYAML-5.4.1-cp39-cp39-win_amd64.whl", hash = "sha256:c20cfa2d49991c8b4147af39859b167664f2ad4561704ee74c1de03318e898db"}, - {file = "PyYAML-5.4.1.tar.gz", hash = "sha256:607774cbba28732bfa802b54baa7484215f530991055bb562efbed5b2f20a45e"}, + {file = "PyYAML-6.0.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:d858aa552c999bc8a8d57426ed01e40bef403cd8ccdd0fc5f6f04a00414cac2a"}, + {file = "PyYAML-6.0.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:fd66fc5d0da6d9815ba2cebeb4205f95818ff4b79c3ebe268e75d961704af52f"}, + {file = "PyYAML-6.0.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:69b023b2b4daa7548bcfbd4aa3da05b3a74b772db9e23b982788168117739938"}, + {file = "PyYAML-6.0.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:81e0b275a9ecc9c0c0c07b4b90ba548307583c125f54d5b6946cfee6360c733d"}, + {file = "PyYAML-6.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ba336e390cd8e4d1739f42dfe9bb83a3cc2e80f567d8805e11b46f4a943f5515"}, + {file = "PyYAML-6.0.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:326c013efe8048858a6d312ddd31d56e468118ad4cdeda36c719bf5bb6192290"}, + {file = "PyYAML-6.0.1-cp310-cp310-win32.whl", hash = "sha256:bd4af7373a854424dabd882decdc5579653d7868b8fb26dc7d0e99f823aa5924"}, + {file = "PyYAML-6.0.1-cp310-cp310-win_amd64.whl", hash = "sha256:fd1592b3fdf65fff2ad0004b5e363300ef59ced41c2e6b3a99d4089fa8c5435d"}, + {file = "PyYAML-6.0.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:6965a7bc3cf88e5a1c3bd2e0b5c22f8d677dc88a455344035f03399034eb3007"}, + {file = "PyYAML-6.0.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:f003ed9ad21d6a4713f0a9b5a7a0a79e08dd0f221aff4525a2be4c346ee60aab"}, + {file = "PyYAML-6.0.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:42f8152b8dbc4fe7d96729ec2b99c7097d656dc1213a3229ca5383f973a5ed6d"}, + {file = "PyYAML-6.0.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:062582fca9fabdd2c8b54a3ef1c978d786e0f6b3a1510e0ac93ef59e0ddae2bc"}, + {file = "PyYAML-6.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d2b04aac4d386b172d5b9692e2d2da8de7bfb6c387fa4f801fbf6fb2e6ba4673"}, + {file = "PyYAML-6.0.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:e7d73685e87afe9f3b36c799222440d6cf362062f78be1013661b00c5c6f678b"}, + {file = "PyYAML-6.0.1-cp311-cp311-win32.whl", hash = "sha256:1635fd110e8d85d55237ab316b5b011de701ea0f29d07611174a1b42f1444741"}, + {file = "PyYAML-6.0.1-cp311-cp311-win_amd64.whl", hash = "sha256:bf07ee2fef7014951eeb99f56f39c9bb4af143d8aa3c21b1677805985307da34"}, + {file = "PyYAML-6.0.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:855fb52b0dc35af121542a76b9a84f8d1cd886ea97c84703eaa6d88e37a2ad28"}, + {file = "PyYAML-6.0.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:40df9b996c2b73138957fe23a16a4f0ba614f4c0efce1e9406a184b6d07fa3a9"}, + {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a08c6f0fe150303c1c6b71ebcd7213c2858041a7e01975da3a99aed1e7a378ef"}, + {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6c22bec3fbe2524cde73d7ada88f6566758a8f7227bfbf93a408a9d86bcc12a0"}, + {file = "PyYAML-6.0.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:8d4e9c88387b0f5c7d5f281e55304de64cf7f9c0021a3525bd3b1c542da3b0e4"}, + {file = "PyYAML-6.0.1-cp312-cp312-win32.whl", hash = "sha256:d483d2cdf104e7c9fa60c544d92981f12ad66a457afae824d146093b8c294c54"}, + {file = "PyYAML-6.0.1-cp312-cp312-win_amd64.whl", hash = "sha256:0d3304d8c0adc42be59c5f8a4d9e3d7379e6955ad754aa9d6ab7a398b59dd1df"}, + {file = "PyYAML-6.0.1-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:50550eb667afee136e9a77d6dc71ae76a44df8b3e51e41b77f6de2932bfe0f47"}, + {file = "PyYAML-6.0.1-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1fe35611261b29bd1de0070f0b2f47cb6ff71fa6595c077e42bd0c419fa27b98"}, + {file = "PyYAML-6.0.1-cp36-cp36m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:704219a11b772aea0d8ecd7058d0082713c3562b4e271b849ad7dc4a5c90c13c"}, + {file = "PyYAML-6.0.1-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:afd7e57eddb1a54f0f1a974bc4391af8bcce0b444685d936840f125cf046d5bd"}, + {file = "PyYAML-6.0.1-cp36-cp36m-win32.whl", hash = "sha256:fca0e3a251908a499833aa292323f32437106001d436eca0e6e7833256674585"}, + {file = "PyYAML-6.0.1-cp36-cp36m-win_amd64.whl", hash = "sha256:f22ac1c3cac4dbc50079e965eba2c1058622631e526bd9afd45fedd49ba781fa"}, + {file = "PyYAML-6.0.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:b1275ad35a5d18c62a7220633c913e1b42d44b46ee12554e5fd39c70a243d6a3"}, + {file = "PyYAML-6.0.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:18aeb1bf9a78867dc38b259769503436b7c72f7a1f1f4c93ff9a17de54319b27"}, + {file = "PyYAML-6.0.1-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:596106435fa6ad000c2991a98fa58eeb8656ef2325d7e158344fb33864ed87e3"}, + {file = "PyYAML-6.0.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:baa90d3f661d43131ca170712d903e6295d1f7a0f595074f151c0aed377c9b9c"}, + {file = "PyYAML-6.0.1-cp37-cp37m-win32.whl", hash = "sha256:9046c58c4395dff28dd494285c82ba00b546adfc7ef001486fbf0324bc174fba"}, + {file = "PyYAML-6.0.1-cp37-cp37m-win_amd64.whl", hash = "sha256:4fb147e7a67ef577a588a0e2c17b6db51dda102c71de36f8549b6816a96e1867"}, + {file = "PyYAML-6.0.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:1d4c7e777c441b20e32f52bd377e0c409713e8bb1386e1099c2415f26e479595"}, + {file = "PyYAML-6.0.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a0cd17c15d3bb3fa06978b4e8958dcdc6e0174ccea823003a106c7d4d7899ac5"}, + {file = "PyYAML-6.0.1-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:28c119d996beec18c05208a8bd78cbe4007878c6dd15091efb73a30e90539696"}, + {file = "PyYAML-6.0.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7e07cbde391ba96ab58e532ff4803f79c4129397514e1413a7dc761ccd755735"}, + {file = "PyYAML-6.0.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:49a183be227561de579b4a36efbb21b3eab9651dd81b1858589f796549873dd6"}, + {file = "PyYAML-6.0.1-cp38-cp38-win32.whl", hash = "sha256:184c5108a2aca3c5b3d3bf9395d50893a7ab82a38004c8f61c258d4428e80206"}, + {file = "PyYAML-6.0.1-cp38-cp38-win_amd64.whl", hash = "sha256:1e2722cc9fbb45d9b87631ac70924c11d3a401b2d7f410cc0e3bbf249f2dca62"}, + {file = "PyYAML-6.0.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:9eb6caa9a297fc2c2fb8862bc5370d0303ddba53ba97e71f08023b6cd73d16a8"}, + {file = "PyYAML-6.0.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:c8098ddcc2a85b61647b2590f825f3db38891662cfc2fc776415143f599bb859"}, + {file = "PyYAML-6.0.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5773183b6446b2c99bb77e77595dd486303b4faab2b086e7b17bc6bef28865f6"}, + {file = "PyYAML-6.0.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b786eecbdf8499b9ca1d697215862083bd6d2a99965554781d0d8d1ad31e13a0"}, + {file = "PyYAML-6.0.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bc1bf2925a1ecd43da378f4db9e4f799775d6367bdb94671027b73b393a7c42c"}, + {file = "PyYAML-6.0.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:04ac92ad1925b2cff1db0cfebffb6ffc43457495c9b3c39d3fcae417d7125dc5"}, + {file = "PyYAML-6.0.1-cp39-cp39-win32.whl", hash = "sha256:faca3bdcf85b2fc05d06ff3fbc1f83e1391b3e724afa3feba7d13eeab355484c"}, + {file = "PyYAML-6.0.1-cp39-cp39-win_amd64.whl", hash = "sha256:510c9deebc5c0225e8c96813043e62b680ba2f9c50a08d3724c7f28a747d1486"}, + {file = "PyYAML-6.0.1.tar.gz", hash = "sha256:bfdf460b1736c775f2ba9f6a92bca30bc2095067b8a9d77876d1fad6cc3b4a43"}, ] [[package]] @@ -2527,21 +2502,22 @@ wrapt = ">=1.10,<2.0" [[package]] name = "sentry-sdk" -version = "1.45.0" +version = "2.12.0" description = "Python client for Sentry (https://sentry.io)" optional = false -python-versions = "*" +python-versions = ">=3.6" files = [ - {file = "sentry-sdk-1.45.0.tar.gz", hash = "sha256:509aa9678c0512344ca886281766c2e538682f8acfa50fd8d405f8c417ad0625"}, - {file = "sentry_sdk-1.45.0-py2.py3-none-any.whl", hash = "sha256:1ce29e30240cc289a027011103a8c83885b15ef2f316a60bcc7c5300afa144f1"}, + {file = "sentry_sdk-2.12.0-py2.py3-none-any.whl", hash = "sha256:7a8d5163d2ba5c5f4464628c6b68f85e86972f7c636acc78aed45c61b98b7a5e"}, + {file = "sentry_sdk-2.12.0.tar.gz", hash = "sha256:8763840497b817d44c49b3fe3f5f7388d083f2337ffedf008b2cdb63b5c86dc6"}, ] [package.dependencies] certifi = "*" -urllib3 = {version = ">=1.26.11", markers = "python_version >= \"3.6\""} +urllib3 = ">=1.26.11" [package.extras] aiohttp = ["aiohttp (>=3.5)"] +anthropic = ["anthropic (>=0.16)"] arq = ["arq (>=0.23)"] asyncpg = ["asyncpg (>=0.23)"] beam = ["apache-beam (>=2.12)"] @@ -2554,13 +2530,15 @@ django = ["django (>=1.8)"] falcon = ["falcon (>=1.4)"] fastapi = ["fastapi (>=0.79.0)"] flask = ["blinker (>=1.1)", "flask (>=0.11)", "markupsafe"] -grpcio = ["grpcio (>=1.21.1)"] +grpcio = ["grpcio (>=1.21.1)", "protobuf (>=3.8.0)"] httpx = ["httpx (>=0.16.0)"] huey = ["huey (>=2)"] +huggingface-hub = ["huggingface-hub (>=0.22)"] +langchain = ["langchain (>=0.0.210)"] loguru = ["loguru (>=0.5)"] openai = ["openai (>=1.0.0)", "tiktoken (>=0.3.0)"] opentelemetry = ["opentelemetry-distro (>=0.35b0)"] -opentelemetry-experimental = ["opentelemetry-distro (>=0.40b0,<1.0)", "opentelemetry-instrumentation-aiohttp-client (>=0.40b0,<1.0)", "opentelemetry-instrumentation-django (>=0.40b0,<1.0)", "opentelemetry-instrumentation-fastapi (>=0.40b0,<1.0)", "opentelemetry-instrumentation-flask (>=0.40b0,<1.0)", "opentelemetry-instrumentation-requests (>=0.40b0,<1.0)", "opentelemetry-instrumentation-sqlite3 (>=0.40b0,<1.0)", "opentelemetry-instrumentation-urllib (>=0.40b0,<1.0)"] +opentelemetry-experimental = ["opentelemetry-distro"] pure-eval = ["asttokens", "executing", "pure-eval"] pymongo = ["pymongo (>=3.1)"] pyspark = ["pyspark (>=2.4.4)"] @@ -2570,23 +2548,23 @@ sanic = ["sanic (>=0.8)"] sqlalchemy = ["sqlalchemy (>=1.2)"] starlette = ["starlette (>=0.19.1)"] starlite = ["starlite (>=1.48)"] -tornado = ["tornado (>=5)"] +tornado = ["tornado (>=6)"] [[package]] name = "setuptools" -version = "67.8.0" +version = "72.1.0" description = "Easily download, build, install, upgrade, and uninstall Python packages" optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" files = [ - {file = "setuptools-67.8.0-py3-none-any.whl", hash = "sha256:5df61bf30bb10c6f756eb19e7c9f3b473051f48db77fddbe06ff2ca307df9a6f"}, - {file = "setuptools-67.8.0.tar.gz", hash = "sha256:62642358adc77ffa87233bc4d2354c4b2682d214048f500964dbe760ccedf102"}, + {file = "setuptools-72.1.0-py3-none-any.whl", hash = "sha256:5a03e1860cf56bb6ef48ce186b0e557fdba433237481a9a625176c2831be15d1"}, + {file = "setuptools-72.1.0.tar.gz", hash = "sha256:8d243eff56d095e5817f796ede6ae32941278f542e0f941867cc05ae52b162ec"}, ] [package.extras] -docs = ["furo", "jaraco.packaging (>=9)", "jaraco.tidelift (>=1.4)", "pygments-github-lexers (==0.0.5)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-favicon", "sphinx-hoverxref (<2)", "sphinx-inline-tabs", "sphinx-lint", "sphinx-notfound-page (==0.8.3)", "sphinx-reredirects", "sphinxcontrib-towncrier"] -testing = ["build[virtualenv]", "filelock (>=3.4.0)", "flake8-2020", "ini2toml[lite] (>=0.9)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "pip (>=19.1)", "pip-run (>=8.8)", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=1.3)", "pytest-mypy (>=0.9.1)", "pytest-perf", "pytest-ruff", "pytest-timeout", "pytest-xdist", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel"] -testing-integration = ["build[virtualenv]", "filelock (>=3.4.0)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "pytest", "pytest-enabler", "pytest-xdist", "tomli", "virtualenv (>=13.0.0)", "wheel"] +core = ["importlib-metadata (>=6)", "importlib-resources (>=5.10.2)", "jaraco.text (>=3.7)", "more-itertools (>=8.8)", "ordered-set (>=3.1.1)", "packaging (>=24)", "platformdirs (>=2.6.2)", "tomli (>=2.0.1)", "wheel (>=0.43.0)"] +doc = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "pygments-github-lexers (==0.0.5)", "pyproject-hooks (!=1.1)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-favicon", "sphinx-inline-tabs", "sphinx-lint", "sphinx-notfound-page (>=1,<2)", "sphinx-reredirects", "sphinxcontrib-towncrier"] +test = ["build[virtualenv] (>=1.0.3)", "filelock (>=3.4.0)", "importlib-metadata", "ini2toml[lite] (>=0.14)", "jaraco.develop (>=7.21)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "jaraco.test", "mypy (==1.11.*)", "packaging (>=23.2)", "pip (>=19.1)", "pyproject-hooks (!=1.1)", "pytest (>=6,!=8.1.*)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-home (>=0.5)", "pytest-mypy", "pytest-perf", "pytest-ruff (<0.4)", "pytest-ruff (>=0.2.1)", "pytest-ruff (>=0.3.2)", "pytest-subprocess", "pytest-timeout", "pytest-xdist (>=3)", "tomli", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel"] [[package]] name = "six" @@ -2813,24 +2791,13 @@ files = [ [[package]] name = "tokenize-rt" -version = "5.2.0" +version = "6.0.0" description = "A wrapper around the stdlib `tokenize` which roundtrips." optional = false python-versions = ">=3.8" files = [ - {file = "tokenize_rt-5.2.0-py2.py3-none-any.whl", hash = "sha256:b79d41a65cfec71285433511b50271b05da3584a1da144a0752e9c621a285289"}, - {file = "tokenize_rt-5.2.0.tar.gz", hash = "sha256:9fe80f8a5c1edad2d3ede0f37481cc0cc1538a2f442c9c2f9e4feacd2792d054"}, -] - -[[package]] -name = "tomli" -version = "2.0.1" -description = "A lil' TOML parser" -optional = false -python-versions = ">=3.7" -files = [ - {file = "tomli-2.0.1-py3-none-any.whl", hash = "sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc"}, - {file = "tomli-2.0.1.tar.gz", hash = "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f"}, + {file = "tokenize_rt-6.0.0-py2.py3-none-any.whl", hash = "sha256:d4ff7ded2873512938b4f8cbb98c9b07118f01d30ac585a30d7a88353ca36d22"}, + {file = "tokenize_rt-6.0.0.tar.gz", hash = "sha256:b9711bdfc51210211137499b5e355d3de5ec88a85d2025c520cbb921b5194367"}, ] [[package]] @@ -2857,13 +2824,13 @@ files = [ [[package]] name = "urllib3" -version = "1.26.18" +version = "1.26.19" description = "HTTP library with thread-safe connection pooling, file post, and more." optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*" +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,>=2.7" files = [ - {file = "urllib3-1.26.18-py2.py3-none-any.whl", hash = "sha256:34b97092d7e0a3a8cf7cd10e386f401b3737364026c45e622aa02903dffe0f07"}, - {file = "urllib3-1.26.18.tar.gz", hash = "sha256:f8ecc1bba5667413457c529ab955bf8c67b45db799d159066261719e328580a0"}, + {file = "urllib3-1.26.19-py2.py3-none-any.whl", hash = "sha256:37a0344459b199fce0e80b0d3569837ec6b6937435c5244e7fd73fa6006830f3"}, + {file = "urllib3-1.26.19.tar.gz", hash = "sha256:3e3d753a8618b86d7de333b4223005f68720bcd6a7d2bcb9fbd2229ec7c1e429"}, ] [package.extras] @@ -3280,25 +3247,10 @@ files = [ {file = "xlwt-1.3.0.tar.gz", hash = "sha256:c59912717a9b28f1a3c2a98fd60741014b06b043936dcecbc113eaaada156c88"}, ] -[[package]] -name = "zipp" -version = "3.11.0" -description = "Backport of pathlib-compatible object wrapper for zip files" -optional = false -python-versions = ">=3.7" -files = [ - {file = "zipp-3.11.0-py3-none-any.whl", hash = "sha256:83a28fcb75844b5c0cdaf5aa4003c2d728c77e05f5aeabe8e95e56727005fbaa"}, - {file = "zipp-3.11.0.tar.gz", hash = "sha256:a7a22e05929290a67401440b39690ae6563279bced5f314609d9d03798f56766"}, -] - -[package.extras] -docs = ["furo", "jaraco.packaging (>=9)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)"] -testing = ["flake8 (<5)", "func-timeout", "jaraco.functools", "jaraco.itertools", "more-itertools", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=1.3)", "pytest-flake8", "pytest-mypy (>=0.9.1)"] - [extras] gunicorn = ["gunicorn"] [metadata] lock-version = "2.0" -python-versions = "~3.8" -content-hash = "ce5e2563d3c18707441b4eb29bef7a92d7b8dbe461f23778f1813b12930e15aa" +python-versions = "~3.11" +content-hash = "33eb0382836cb0b0c327350fbb8e0332016b36fec5133b83bc5576c1310106e0" diff --git a/pyproject.toml b/pyproject.toml index 04b343724..021b95b45 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ description = "" authors = ["Kevin Howbrook "] [tool.poetry.dependencies] -python = "~3.8" +python = "~3.11" django = "~4.2" wagtail = "~6.1" psycopg2 = "~2.9" @@ -42,7 +42,7 @@ html5lib = "^1.1" lxml = "^5.2.1" mailchimp-marketing = "^3.0.80" scout-apm = "~3.1" -sentry-sdk = "^1.45.0" +sentry-sdk = "^2.12.0" tblib = "^3.0.0" urllib3 = "<2" whitenoise = "~6.6" @@ -69,7 +69,8 @@ mkdocs = "~1.5" mkdocs-material = "~9.5" pymdown-extensions = "~10.8" honcho = "^1.1.0" -django-upgrade = "^1.16.0" +django-upgrade = "^1.20.0" +pyupgrade = "^3.17.0" [build-system] requires = ["poetry>=1,<2"] diff --git a/rca/account_management/views.py b/rca/account_management/views.py index 2c3203916..ca34b4cf3 100644 --- a/rca/account_management/views.py +++ b/rca/account_management/views.py @@ -42,7 +42,7 @@ class CreateStudentFormView(FormView): def dispatch(self, request, *args, **kwargs): if not request.user.is_superuser: raise PermissionDenied - return super(CreateStudentFormView, self).dispatch(request, *args, **kwargs) + return super().dispatch(request, *args, **kwargs) def form_valid(self, form): response = super().form_valid(form) diff --git a/rca/editorial/models.py b/rca/editorial/models.py index e67ac62ce..00481dc5b 100644 --- a/rca/editorial/models.py +++ b/rca/editorial/models.py @@ -75,7 +75,7 @@ def __str__(self): def save(self, *args, **kwargs): self.slug = slugify(self.title) - super(EditorialType, self).save(*args, **kwargs) + super().save(*args, **kwargs) panels = [FieldPanel("title")] diff --git a/rca/enquire_to_study/forms.py b/rca/enquire_to_study/forms.py index 2d0bf52f4..173ae1015 100644 --- a/rca/enquire_to_study/forms.py +++ b/rca/enquire_to_study/forms.py @@ -60,7 +60,7 @@ class EnquireToStudyForm(forms.Form): captcha = ReCaptchaField(widget=ReCaptchaV2Checkbox) def __init__(self, *args, **kwargs): - super(EnquireToStudyForm, self).__init__(*args, **kwargs) + super().__init__(*args, **kwargs) # Placeholder # Set initial values diff --git a/rca/enquire_to_study/views.py b/rca/enquire_to_study/views.py index 6b74e5945..57e614473 100644 --- a/rca/enquire_to_study/views.py +++ b/rca/enquire_to_study/views.py @@ -269,12 +269,10 @@ def send_user_email_notification(self, form): def send_internal_email_notification(self, form, enquiry_submission): # Prettify the form labels so we don't render them with `_` e.g. `first_name: John`. - answers = dict( - [ - (key.replace("_", " ").capitalize(), value) - for key, value in form.cleaned_data.items() - ] - ) + answers = { + key.replace("_", " ").capitalize(): value + for key, value in form.cleaned_data.items() + } # Transform programmes into their string representation since it's going to be a QuerySet. answers["Programmes"] = ", ".join([str(p) for p in answers["Programmes"]]) diff --git a/rca/forms/migrations/0001_initial.py b/rca/forms/migrations/0001_initial.py index eb3ee0542..5f995b8ff 100644 --- a/rca/forms/migrations/0001_initial.py +++ b/rca/forms/migrations/0001_initial.py @@ -1,11 +1,9 @@ -# -*- coding: utf-8 -*- # Generated by Django 1.11.4 on 2017-08-24 14:42 -from __future__ import unicode_literals -from django.db import migrations, models import django.db.models.deletion import modelcluster.fields import wagtail.fields +from django.db import migrations, models class Migration(migrations.Migration): diff --git a/rca/home/migrations/0001_initial.py b/rca/home/migrations/0001_initial.py index 18a40c13c..9d4046273 100644 --- a/rca/home/migrations/0001_initial.py +++ b/rca/home/migrations/0001_initial.py @@ -1,8 +1,5 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import models, migrations import django.db.models.deletion +from django.db import migrations, models class Migration(migrations.Migration): diff --git a/rca/home/migrations/0002_create_homepage.py b/rca/home/migrations/0002_create_homepage.py index 32e2fac3c..4aff1f31a 100644 --- a/rca/home/migrations/0002_create_homepage.py +++ b/rca/home/migrations/0002_create_homepage.py @@ -1,6 +1,3 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - from django.db import migrations diff --git a/rca/images/migrations/0001_initial.py b/rca/images/migrations/0001_initial.py index 5ff50b082..92d4c2a0f 100644 --- a/rca/images/migrations/0001_initial.py +++ b/rca/images/migrations/0001_initial.py @@ -1,14 +1,12 @@ -# -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2017-04-14 09:20 -from __future__ import unicode_literals -from django.conf import settings -from django.db import migrations, models import django.db.models.deletion import taggit.managers -import wagtail.models import wagtail.images.models +import wagtail.models import wagtail.search.index +from django.conf import settings +from django.db import migrations, models class Migration(migrations.Migration): @@ -139,6 +137,6 @@ class Migration(migrations.Migration): ), migrations.AlterUniqueTogether( name="rendition", - unique_together=set([("image", "filter_spec", "focal_point_key")]), + unique_together={("image", "filter_spec", "focal_point_key")}, ), ] diff --git a/rca/navigation/migrations/0001_initial.py b/rca/navigation/migrations/0001_initial.py index bdc3726ae..886af812e 100644 --- a/rca/navigation/migrations/0001_initial.py +++ b/rca/navigation/migrations/0001_initial.py @@ -1,11 +1,9 @@ -# -*- coding: utf-8 -*- # Generated by Django 1.11.8 on 2017-12-20 09:28 -from __future__ import unicode_literals -from django.db import migrations, models import django.db.models.deletion import wagtail.blocks import wagtail.fields +from django.db import migrations, models class Migration(migrations.Migration): diff --git a/rca/navigation/models.py b/rca/navigation/models.py index 84b666507..1b9d4bf46 100644 --- a/rca/navigation/models.py +++ b/rca/navigation/models.py @@ -70,17 +70,10 @@ class LinkBlock(blocks.StructBlock): # Add a page url for the page object def get_api_representation(self, value, context=None): - value = dict( - [ - ( - name, - self.child_blocks[name].get_api_representation( - val, context=context - ), - ) - for name, val in value.items() - ] - ) + value = { + name: self.child_blocks[name].get_api_representation(val, context=context) + for name, val in value.items() + } if value["page"] and not value["url"]: # Stale cache data could store a deleted page ID, so try the get diff --git a/rca/people/admin_forms.py b/rca/people/admin_forms.py index 148c5dc82..58169310d 100644 --- a/rca/people/admin_forms.py +++ b/rca/people/admin_forms.py @@ -6,7 +6,7 @@ class StudentPageAdminForm(WagtailAdminPageForm): """Validation for adding StudentPage""" def __init__(self, *args, **kwargs): - super(StudentPageAdminForm, self).__init__(*args, **kwargs) + super().__init__(*args, **kwargs) user = kwargs.get("for_user") diff --git a/rca/people/filter.py b/rca/people/filter.py index be9f4720b..b98273228 100644 --- a/rca/people/filter.py +++ b/rca/people/filter.py @@ -47,11 +47,11 @@ def apply(self, queryset, querydict): def get_deprefixed_value_set(self, prefix): if not self.querydict: return set() - return set( + return { val[len(prefix) :] # noqa (flake8 and black fighting) for val in self.querydict.getlist(self.name) if val.startswith(prefix) - ) + } @cached_property def selected_school_values(self): diff --git a/rca/people/models.py b/rca/people/models.py index e9be5a76a..c0b70072e 100644 --- a/rca/people/models.py +++ b/rca/people/models.py @@ -65,7 +65,7 @@ def __str__(self): def save(self, *args, **kwargs): self.slug = slugify(self.title) - super(AreaOfExpertise, self).save(*args, **kwargs) + super().save(*args, **kwargs) class Directorate(models.Model): @@ -82,7 +82,7 @@ def __str__(self): def save(self, *args, **kwargs): self.slug = slugify(self.title) - super(Directorate, self).save(*args, **kwargs) + super().save(*args, **kwargs) class StaffRole(Orderable): @@ -973,7 +973,7 @@ def save(self, *args, **kwargs): """On saving the student page, make sure the student_user_account has a group created with the necessary permissions """ - super(StudentPage, self).save() + super().save() if self.student_user_image_collection and self.student_user_account: diff --git a/rca/programmes/models.py b/rca/programmes/models.py index 898f68fed..9fbf98474 100644 --- a/rca/programmes/models.py +++ b/rca/programmes/models.py @@ -80,7 +80,7 @@ def get_fake_slug(self): def save(self, *args, **kwargs): self.slug = slugify(self.title) - super(Subject, self).save(*args, **kwargs) + super().save(*args, **kwargs) def degree_level_serializer(*args, **kwargs): diff --git a/rca/standardpages/migrations/0001_initial.py b/rca/standardpages/migrations/0001_initial.py index 01d653cb7..2efe86b8f 100644 --- a/rca/standardpages/migrations/0001_initial.py +++ b/rca/standardpages/migrations/0001_initial.py @@ -1,16 +1,14 @@ -# -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2017-04-14 09:30 -from __future__ import unicode_literals -from django.db import migrations, models import django.db.models.deletion import modelcluster.fields import wagtail.blocks -import wagtail.fields import wagtail.documents.blocks import wagtail.embeds.blocks +import wagtail.fields import wagtail.images.blocks import wagtail.snippets.blocks +from django.db import migrations, models class Migration(migrations.Migration): @@ -136,9 +134,7 @@ class Migration(migrations.Migration): ), ( "caption", - wagtail.blocks.CharBlock( - required=False - ), + wagtail.blocks.CharBlock(required=False), ), ) ), @@ -149,15 +145,11 @@ class Migration(migrations.Migration): ( ( "quote", - wagtail.blocks.CharBlock( - classname="title" - ), + wagtail.blocks.CharBlock(classname="title"), ), ( "attribution", - wagtail.blocks.CharBlock( - required=False - ), + wagtail.blocks.CharBlock(required=False), ), ) ), @@ -180,9 +172,7 @@ class Migration(migrations.Migration): ), ( "title", - wagtail.blocks.CharBlock( - required=False - ), + wagtail.blocks.CharBlock(required=False), ), ) ), diff --git a/rca/utils/cache.py b/rca/utils/cache.py index 034be2bf8..86bea20cf 100644 --- a/rca/utils/cache.py +++ b/rca/utils/cache.py @@ -9,7 +9,7 @@ def purge_cache_on_all_sites(path): return for site in Site.objects.all(): - purge_url_from_cache("%s%s" % (site.root_url.rstrip("/"), path)) + purge_url_from_cache("{}{}".format(site.root_url.rstrip("/"), path)) def get_default_cache_control_kwargs(): diff --git a/rca/utils/migrations/0001_initial.py b/rca/utils/migrations/0001_initial.py index b8912b1b2..03ca46f20 100644 --- a/rca/utils/migrations/0001_initial.py +++ b/rca/utils/migrations/0001_initial.py @@ -1,10 +1,8 @@ -# -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2017-04-14 09:23 -from __future__ import unicode_literals -from django.db import migrations, models import django.db.models.deletion import wagtail.fields +from django.db import migrations, models class Migration(migrations.Migration): @@ -54,9 +52,7 @@ class Migration(migrations.Migration): ), ( "title", - wagtail.blocks.CharBlock( - required=False - ), + wagtail.blocks.CharBlock(required=False), ), ), icon="link", diff --git a/rca/utils/models.py b/rca/utils/models.py index d635cbe64..c92525bb6 100644 --- a/rca/utils/models.py +++ b/rca/utils/models.py @@ -860,7 +860,7 @@ def __str__(self): def save(self, *args, **kwargs): self.slug = slugify(self.title) - super(ResearchType, self).save(*args, **kwargs) + super().save(*args, **kwargs) @register_setting @@ -894,7 +894,7 @@ def __str__(self): def save(self, *args, **kwargs): self.slug = slugify(self.title) - super(SluggedTaxonomy, self).save(*args, **kwargs) + super().save(*args, **kwargs) class ResearchTheme(SluggedTaxonomy): diff --git a/rca/wagtailapi/serializers.py b/rca/wagtailapi/serializers.py index fb1f591c7..bd3f8bdf0 100644 --- a/rca/wagtailapi/serializers.py +++ b/rca/wagtailapi/serializers.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import, unicode_literals - from collections import OrderedDict from rest_framework.fields import Field @@ -137,7 +135,7 @@ class ImageRenditionField(Field): def __init__(self, filter_spec, *args, **kwargs): self.filter_spec = filter_spec - super(ImageRenditionField, self).__init__(*args, **kwargs) + super().__init__(*args, **kwargs) def get_attribute(self, instance): return instance