diff --git a/.ci/docker-compose-ci.yml b/.ci/docker-compose-ci.yml deleted file mode 100644 index 2a043599..00000000 --- a/.ci/docker-compose-ci.yml +++ /dev/null @@ -1,57 +0,0 @@ -version: "2" - -services: - mysql80: - image: mysql:8.0 - container_name: mysql80 - command: mysqld --character-set-server=utf8 --collation-server=utf8_general_ci - environment: - MYSQL_ROOT_PASSWORD: "" - MYSQL_ALLOW_EMPTY_PASSWORD: "yes" - MYSQL_USER: "notes001" - MYSQL_PASSWORD: "secret" - MYSQL_DATABASE: "edx_notes_api" - es: - image: elasticsearch:7.8.0 - container_name: es - environment: - - discovery.type=single-node - - bootstrap.memory_lock=true - - "ES_JAVA_OPTS=-Xms512m -Xmx512m" - - http.port=9200 - ulimits: - memlock: - soft: -1 - hard: -1 - volumes: - - elasticsearch_data:/usr/share/elasticsearch/data - ports: - - "9200:9200" - notes: - # Uncomment this line to use the official course-discovery base image - image: openedx/edx-notes-api:latest - - # Uncomment the next two lines to build from a local configuration repo - # build: ../configuration/docker/build/discovery/ - - container_name: edx_notes_api - volumes: - - ..:/edx/app/edx_notes_api/edx_notes_api - command: tail -f /dev/null - depends_on: - - "mysql80" - - "es" - environment: - CONN_MAX_AGE: 60 - DB_ENGINE: "django.db.backends.mysql" - DB_HOST: "db" - DB_NAME: "edx_notes_api" - DB_PASSWORD: "" - DB_PORT: "3306" - DB_USER: "root" - ENABLE_DJANGO_TOOLBAR: 1 - ELASTICSEARCH_URL: "http://es:9200" - -volumes: - elasticsearch_data: - driver: local diff --git a/.ci/docker.mk b/.ci/docker.mk deleted file mode 100644 index 79ab4a3f..00000000 --- a/.ci/docker.mk +++ /dev/null @@ -1,20 +0,0 @@ -.PHONY: ci_down ci_start ci_stop ci_test ci_up - -ci_up: ## Create containers used to run tests on ci CI - docker compose -f .ci/docker-compose-ci.yml up -d - -ci_start: ## Start containers stopped by `ci_stop` - docker compose -f .ci/docker-compose-ci.yml start - -ci_test: ## Run tests on Docker containers, as on ci CI - docker exec -e TERM=$(TERM) -e TOXENV=$(TOXENV) -u root -it edx_notes_api /edx/app/edx_notes_api/edx_notes_api/.ci/run_tests.sh - -ci_pii_check: ## Run pii annotations checker on Docker containers, as on ci CI - docker exec -e TERM=$(TERM) -e TOXENV=$(TOXENV) -u root -it edx_notes_api /edx/app/edx_notes_api/edx_notes_api/.ci/run_pii_checker.sh - -ci_stop: ## Stop running containers created by `ci_up` without removing them - docker compose -f .ci/docker-compose-ci.yml stop - -ci_down: ## Stop and remove containers and other resources created by `ci_up` - docker compose -f .ci/docker-compose-ci.yml down - diff --git a/.ci/run_check_keywords.sh b/.ci/run_check_keywords.sh deleted file mode 100755 index 37045bd2..00000000 --- a/.ci/run_check_keywords.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash -xe - -export DJANGO_SETTINGS_MODULE=notesserver.settings.test - -cd /edx/app/edx_notes_api/edx_notes_api - -make check_keywords diff --git a/.ci/run_pii_checker.sh b/.ci/run_pii_checker.sh deleted file mode 100755 index a9262879..00000000 --- a/.ci/run_pii_checker.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -xe - -export DJANGO_SETTINGS_MODULE=notesserver.settings.test - -cd /edx/app/edx_notes_api/edx_notes_api - -make pii_check - diff --git a/.ci/run_tests.sh b/.ci/run_tests.sh deleted file mode 100755 index b112c68c..00000000 --- a/.ci/run_tests.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash -xe - -export DJANGO_SETTINGS_MODULE=notesserver.settings.test - -cd /edx/app/edx_notes_api/edx_notes_api - -make validate diff --git a/.dockerignore b/.dockerignore deleted file mode 100644 index 94143827..00000000 --- a/.dockerignore +++ /dev/null @@ -1 +0,0 @@ -Dockerfile diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f58c737d..36ee66a1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,47 +2,65 @@ name: Django CI on: push: - branches: [ master ] + branches: [master] pull_request: - branches: [ master ] + branches: + - "**" jobs: - build: - + run_tests: runs-on: ubuntu-latest strategy: fail-fast: false - max-parallel: 4 matrix: - python-version: ['py311', 'py312'] - django-version: ['django42'] - db-version: ['mysql80'] + python-version: ["3.11", "3.12"] + toxenv: ["django42"] # "quality", "pii_check", "check_keywords" + + services: + mysql: + image: mysql:8.0 + options: '--health-cmd="mysqladmin ping -h localhost" --health-interval=10s --health-timeout=5s --health-retries=3' + env: + MYSQL_ROOT_PASSWORD: + MYSQL_ALLOW_EMPTY_PASSWORD: "yes" + MYSQL_DATABASE: "edx_notes_api" + ports: + - 3306:3306 + + elasticsearch: + image: elasticsearch:7.13.4 + options: '--health-cmd="curl -f http://localhost:9200 || exit 1" --health-interval=10s --health-timeout=5s --health-retries=3' + env: + discovery.type: single-node + bootstrap.memory_lock: "true" + ES_JAVA_OPTS: "-Xms512m -Xmx512m" + ports: + - 9200:9200 steps: - - uses: actions/checkout@v4 - - name: Start container - run: | - docker compose -f .ci/docker-compose-ci.yml up -d - - name: Install Dependencies - run: | - docker exec -e TOXENV=${{ matrix.python-version }}-${{ matrix.django-version }} --env DB_HOST=${{ matrix.db-version }} -u root edx_notes_api \ - /bin/bash -c "apt-get update && apt-get install python3-dev default-libmysqlclient-dev build-essential pkg-config" - - name: setup python 311 - if: ${{ matrix.python-version == 'py311' }} - run: | - docker exec -e TOXENV=${{ matrix.python-version }}-${{ matrix.django-version }} --env DB_HOST=${{ matrix.db-version }} -u root edx_notes_api \ - /bin/bash -c "add-apt-repository ppa:deadsnakes/ppa -y && apt install python3.11 python3.11-dev python3.11-distutils -y" - - name: setup python 312 - if: ${{ matrix.python-version == 'py312' }} - run: | - docker exec -e TOXENV=${{ matrix.python-version }}-${{ matrix.django-version }} --env DB_HOST=${{ matrix.db-version }} -u root edx_notes_api \ - /bin/bash -c "add-apt-repository ppa:deadsnakes/ppa -y && apt install python3.12 python3.12-dev python3.12-distutils -y" - - name: Run Tests - run: | - docker exec -e TOXENV=${{ matrix.python-version }}-${{ matrix.django-version }} --env DB_HOST=${{ matrix.db-version }} -u root edx_notes_api /edx/app/edx_notes_api/edx_notes_api/.ci/run_tests.sh - - name: Run PII Check - run: | - docker exec -e TOXENV=${{ matrix.python-version }}-${{ matrix.django-version }} -u root edx_notes_api /edx/app/edx_notes_api/edx_notes_api/.ci/run_pii_checker.sh - - name: Run Reserved Keywords Check - run: | - docker exec -e TOXENV=${{ matrix.python-version }}-${{ matrix.django-version }} -u root edx_notes_api /edx/app/edx_notes_api/edx_notes_api/.ci/run_check_keywords.sh + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: Install system packages + run: sudo apt-get update && sudo apt-get install -y libxmlsec1-dev + + - name: Install pip and Tox + run: pip install --upgrade pip tox + + - name: Run Tox tests + env: + CONN_MAX_AGE: 60 + DB_ENGINE: django.db.backends.mysql + DB_HOST: 127.0.0.1 + DB_NAME: edx_notes_api + DB_PASSWORD: + DB_PORT: 3306 + DB_USER: root + ENABLE_DJANGO_TOOLBAR: 1 + ELASTICSEARCH_URL: http://127.0.0.1:9200 + run: tox -e ${{ matrix.toxenv }} diff --git a/.github/workflows/migrations-mysql8-check.yml b/.github/workflows/migrations-mysql8-check.yml index 7c4c8ab6..8acbe813 100644 --- a/.github/workflows/migrations-mysql8-check.yml +++ b/.github/workflows/migrations-mysql8-check.yml @@ -1,4 +1,4 @@ -name: Migrations check on mysql8 +name: Migrations check on MySQL 8 on: workflow_dispatch: @@ -9,74 +9,53 @@ on: jobs: check_migrations: - name: check migrations - runs-on: ${{ matrix.os }} + runs-on: ubuntu-latest strategy: fail-fast: false matrix: - os: [ ubuntu-latest ] - python-version: [ '3.11', '3.12' ] + python-version: ["3.11", "3.12"] steps: - - name: Checkout repo - uses: actions/checkout@v4 - - - name: Setup Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - - name: Install system Packages - run: | - sudo apt-get update - sudo apt-get install -y libxmlsec1-dev - - name: Get pip cache dir - id: pip-cache-dir - run: | - echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT - - name: Cache pip dependencies - id: cache-dependencies - uses: actions/cache@v4 - with: - path: ${{ steps.pip-cache-dir.outputs.dir }} - key: ${{ runner.os }}-pip-${{ hashFiles('requirements/pip-tools.txt') }} - restore-keys: ${{ runner.os }}-pip- - - - name: Ubuntu and sql Versions - run: | - lsb_release -a - mysql -V - - # pinning xmlsec to version 1.3.13 to avoid the CI error, migration checks are failing due to an issue in the latest release of python-xmlsec - # https://github.com/xmlsec/python-xmlsec/issues/314 - - name: Install Python dependencies - run: | - pip install -r requirements/pip-tools.txt - pip install -r requirements/test.txt - pip install -r requirements/base.txt - pip uninstall -y mysqlclient - pip install --no-binary mysqlclient mysqlclient - pip uninstall -y xmlsec - pip install --no-binary xmlsec xmlsec==1.3.13 - - - name: Initiate Services - run: | - sudo /etc/init.d/mysql start - - name: Reset mysql password - run: | - cat < temp && mv temp $(@) - upgrade: export CUSTOM_COMPILE_COMMAND=make upgrade -upgrade: piptools $(COMMON_CONSTRAINTS_TXT) ## update the requirements/*.txt files with the latest packages satisfying requirements/*.in +upgrade: piptools ## update the requirements/*.txt files with the latest packages satisfying requirements/*.in # Make sure to compile files after any other files they include! - sed -i.'' 's/Django<4.0//g' requirements/common_constraints.txt pip-compile --upgrade --rebuild --allow-unsafe -o requirements/pip.txt requirements/pip.in pip-compile --upgrade -o requirements/pip-tools.txt requirements/pip-tools.in pip install -qr requirements/pip.txt pip install -qr requirements/pip-tools.txt - pip-compile --upgrade -o requirements/base.txt requirements/base.in - pip-compile --upgrade -o requirements/test.txt requirements/test.in - pip-compile --upgrade -o requirements/ci.txt requirements/ci.in + pip-compile --upgrade --allow-unsafe -o requirements/base.txt requirements/base.in + pip-compile --upgrade --allow-unsafe -o requirements/test.txt requirements/test.in + pip-compile --upgrade --allow-unsafe -o requirements/ci.txt requirements/ci.in + pip-compile --upgrade --allow-unsafe -o requirements/quality.txt requirements/quality.in # Let tox control the Django version for tests grep -e "^django==" requirements/base.txt > requirements/django.txt sed '/^[dD]jango==/d' requirements/test.txt > requirements/test.tmp mv requirements/test.tmp requirements/test.txt - diff --git a/README.rst b/README.rst index 98634436..fbaaec7e 100644 --- a/README.rst +++ b/README.rst @@ -11,7 +11,7 @@ The edX Notes API is designed to be compatible with the `Annotator `__. +1. Install `ElasticSearch 7.13.4 `__. 2. Install the requirements: @@ -71,7 +71,7 @@ How To Contribute Contributions are very welcome. -Please read `How To Contribute `_ for details. +Please read `How To Contribute `_ for details. Reporting Security Issues ************************* @@ -84,7 +84,7 @@ Mailing List and IRC Channel You can discuss this code on the `edx-code Google Group`__ or in the ``edx-code`` IRC channel on Freenode. -__ https://groups.google.com/forum/#!forum/edx-code +__ https://groups.google.com/g/edx-code .. |build-status| image:: https://github.com/openedx/edx-notes-api/actions/workflows/ci.yml/badge.svg :target: https://github.com/openedx/edx-notes-api/actions/workflows/ci.yml diff --git a/catalog-info.yaml b/catalog-info.yaml index e3a69df9..e283858d 100644 --- a/catalog-info.yaml +++ b/catalog-info.yaml @@ -18,4 +18,3 @@ spec: # (Required) Acceptable Lifecycle Values: experimental, production, deprecated lifecycle: 'production' - \ No newline at end of file diff --git a/pylintrc b/pylintrc index a12ac82f..fd6c4a45 100644 --- a/pylintrc +++ b/pylintrc @@ -64,7 +64,7 @@ # SERIOUSLY. # # ------------------------------ -# Generated by edx-lint version: 5.3.0 +# Generated by edx-lint version: 5.4.1 # ------------------------------ [MASTER] ignore = @@ -259,6 +259,7 @@ enable = useless-suppression, disable = bad-indentation, + broad-exception-raised, consider-using-f-string, duplicate-code, file-ignored, @@ -380,6 +381,6 @@ ext-import-graph = int-import-graph = [EXCEPTIONS] -overgeneral-exceptions = Exception +overgeneral-exceptions = builtins.Exception -# cbdfd50557cf2747f24a700b1caba610ff09bc6b +# 81327117d32c61cfe23ffd4c7fca0bc96d5c118a diff --git a/requirements/base.in b/requirements/base.in index d0978e72..dc2ab72b 100644 --- a/requirements/base.in +++ b/requirements/base.in @@ -20,3 +20,4 @@ edx-django-release-util edx-django-utils edx-drf-extensions pytz +setuptools diff --git a/requirements/base.txt b/requirements/base.txt index 05398f1d..54aa1694 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -5,7 +5,9 @@ # make upgrade # asgiref==3.8.1 - # via django + # via + # django + # django-cors-headers attrs==24.2.0 # via # jsonschema @@ -18,15 +20,15 @@ cffi==1.17.1 # via # cryptography # pynacl -chardet==3.0.4 +charset-normalizer==3.4.0 # via requests click==8.1.7 # via edx-django-utils -cryptography==43.0.1 +cryptography==43.0.3 # via pyjwt django==4.2.16 # via - # -c requirements/common_constraints.txt + # -c https://raw.githubusercontent.com/openedx/edx-lint/master/edx_lint/files/common_constraints.txt # -r requirements/base.in # django-cors-headers # django-crum @@ -38,15 +40,12 @@ django==4.2.16 # edx-django-release-util # edx-django-utils # edx-drf-extensions -django-cors-headers==3.14.0 - # via - # -c requirements/constraints.txt - # -r requirements/base.in +django-cors-headers==4.5.0 + # via -r requirements/base.in django-crum==0.7.9 # via edx-django-utils django-elasticsearch-dsl==7.4 # via - # -c requirements/constraints.txt # -r requirements/base.in # django-elasticsearch-dsl-drf django-elasticsearch-dsl-drf==0.22.5 @@ -64,7 +63,7 @@ djangorestframework==3.15.2 # drf-jwt # drf-spectacular # edx-drf-extensions -dnspython==2.6.1 +dnspython==2.7.0 # via pymongo drf-jwt==1.19.2 # via edx-drf-extensions @@ -72,40 +71,38 @@ drf-spectacular==0.27.2 # via -r requirements/base.in edx-django-release-util==1.4.0 # via -r requirements/base.in -edx-django-utils==5.16.0 +edx-django-utils==7.0.0 # via # -r requirements/base.in # edx-drf-extensions -edx-drf-extensions==10.4.0 +edx-drf-extensions==10.5.0 # via -r requirements/base.in edx-opaque-keys==2.11.0 # via edx-drf-extensions elasticsearch==7.13.4 # via - # -c requirements/common_constraints.txt - # -c requirements/constraints.txt + # -c https://raw.githubusercontent.com/openedx/edx-lint/master/edx_lint/files/common_constraints.txt # -r requirements/base.in # django-elasticsearch-dsl-drf # elasticsearch-dsl elasticsearch-dsl==7.4.1 # via - # -c requirements/constraints.txt # -r requirements/base.in # django-elasticsearch-dsl # django-elasticsearch-dsl-drf gunicorn==23.0.0 # via -r requirements/base.in -idna==2.10 +idna==3.10 # via requests inflection==0.5.1 # via drf-spectacular jsonschema==4.23.0 # via drf-spectacular -jsonschema-specifications==2023.12.1 +jsonschema-specifications==2024.10.1 # via jsonschema -mysqlclient==2.2.4 +mysqlclient==2.2.5 # via -r requirements/base.in -newrelic==10.0.0 +newrelic==10.2.0 # via # -r requirements/base.in # edx-django-utils @@ -113,13 +110,13 @@ packaging==24.1 # via # django-nine # gunicorn -path-py==9.1 - # via - # -c requirements/constraints.txt - # -r requirements/base.in +path==17.0.0 + # via path-py +path-py==12.5.0 + # via -r requirements/base.in pbr==6.1.0 # via stevedore -psutil==6.0.0 +psutil==6.1.0 # via edx-django-utils pycparser==2.22 # via cffi @@ -132,9 +129,8 @@ pymongo==4.10.1 # via edx-opaque-keys pynacl==1.5.0 # via edx-django-utils -python-dateutil==2.4.0 +python-dateutil==2.9.0.post0 # via - # -c requirements/constraints.txt # -r requirements/base.in # elasticsearch-dsl pytz==2024.2 @@ -147,9 +143,8 @@ referencing==0.35.1 # via # jsonschema # jsonschema-specifications -requests==2.25.0 +requests==2.32.3 # via - # -c requirements/constraints.txt # -r requirements/base.in # edx-drf-extensions rpds-py==0.20.0 @@ -172,10 +167,16 @@ stevedore==5.3.0 # edx-django-utils # edx-opaque-keys typing-extensions==4.12.2 - # via edx-opaque-keys + # via + # edx-opaque-keys + # elasticsearch-dsl uritemplate==4.1.1 # via drf-spectacular urllib3==1.26.20 # via # elasticsearch # requests + +# The following packages are considered to be unsafe in a requirements file: +setuptools==75.2.0 + # via -r requirements/base.in diff --git a/requirements/ci.txt b/requirements/ci.txt index 8fa9d54c..d0a77467 100644 --- a/requirements/ci.txt +++ b/requirements/ci.txt @@ -10,7 +10,7 @@ chardet==5.2.0 # via tox colorama==0.4.6 # via tox -distlib==0.3.8 +distlib==0.3.9 # via virtualenv filelock==3.16.1 # via @@ -28,7 +28,7 @@ pluggy==1.5.0 # via tox pyproject-api==1.8.0 # via tox -tox==4.21.0 +tox==4.23.2 # via -r requirements/ci.in -virtualenv==20.26.6 +virtualenv==20.27.1 # via tox diff --git a/requirements/common_constraints.txt b/requirements/common_constraints.txt deleted file mode 100644 index 5ba91047..00000000 --- a/requirements/common_constraints.txt +++ /dev/null @@ -1,36 +0,0 @@ -# This is a temporary solution to override the real common_constraints.txt -# In edx-lint, until the pyjwt constraint in edx-lint has been removed. -# See BOM-2721 for more details. -# Below is the copied and edited version of common_constraints - -# A central location for most common version constraints -# (across edx repos) for pip-installation. -# -# Similar to other constraint files this file doesn't install any packages. -# It specifies version constraints that will be applied if a package is needed. -# When pinning something here, please provide an explanation of why it is a good -# idea to pin this package across all edx repos, Ideally, link to other information -# that will help people in the future to remove the pin when possible. -# Writing an issue against the offending project and linking to it here is good. -# -# Note: Changes to this file will automatically be used by other repos, referencing -# this file from Github directly. It does not require packaging in edx-lint. - - -# using LTS django version -Django<5.0 - -# elasticsearch>=7.14.0 includes breaking changes in it which caused issues in discovery upgrade process. -# elastic search changelog: https://www.elastic.co/guide/en/enterprise-search/master/release-notes-7.14.0.html -# See https://github.com/openedx/edx-platform/issues/35126 for more info -elasticsearch<7.14.0 - -# django-simple-history>3.0.0 adds indexing and causes a lot of migrations to be affected -django-simple-history==3.0.0 - -# Cause: https://github.com/openedx/event-tracking/pull/290 -# event-tracking 2.4.1 upgrades to pymongo 4.4.0 which is not supported on edx-platform. -# We will pin event-tracking to do not break existing installations -# This can be unpinned once https://github.com/openedx/edx-platform/issues/34586 -# has been resolved and edx-platform is running with pymongo>=4.4.0 -event-tracking<2.4.1 diff --git a/requirements/constraints.txt b/requirements/constraints.txt index c26de26f..f27b3f35 100644 --- a/requirements/constraints.txt +++ b/requirements/constraints.txt @@ -8,16 +8,5 @@ # pin when possible. Writing an issue against the offending project and # linking to it here is good. -# This file contains all common constraints for edx-repos --c common_constraints.txt - -astroid==1.6.6 -requests==2.25.0 -elasticsearch>=7.8,<8.0 -elasticsearch-dsl>=7.2,<8.0 -django-elasticsearch-dsl>=7.1,<8.0 -path.py==9.1 -python-dateutil==2.4.0 -more-itertools==5.0.0 -pylint==1.5.0 -django-cors-headers==3.14.0 +# Common constraints for edx repos +-c https://raw.githubusercontent.com/openedx/edx-lint/master/edx_lint/files/common_constraints.txt diff --git a/requirements/pip-tools.txt b/requirements/pip-tools.txt index 6eb4c374..db6c4632 100644 --- a/requirements/pip-tools.txt +++ b/requirements/pip-tools.txt @@ -4,7 +4,7 @@ # # make upgrade # -build==1.2.2 +build==1.2.2.post1 # via pip-tools click==8.1.7 # via pip-tools diff --git a/requirements/pip.txt b/requirements/pip.txt index 36c777e2..26f57393 100644 --- a/requirements/pip.txt +++ b/requirements/pip.txt @@ -9,6 +9,8 @@ wheel==0.44.0 # The following packages are considered to be unsafe in a requirements file: pip==24.2 - # via -r requirements/pip.in -setuptools==75.1.0 + # via + # -c https://raw.githubusercontent.com/openedx/edx-lint/master/edx_lint/files/common_constraints.txt + # -r requirements/pip.in +setuptools==75.2.0 # via -r requirements/pip.in diff --git a/requirements/production.txt b/requirements/production.txt deleted file mode 100644 index e69de29b..00000000 diff --git a/requirements/quality.in b/requirements/quality.in index 499f5e6f..44745233 100644 --- a/requirements/quality.in +++ b/requirements/quality.in @@ -3,3 +3,6 @@ -r base.txt code-annotations +pycodestyle +pylint +edx_lint diff --git a/requirements/quality.txt b/requirements/quality.txt new file mode 100644 index 00000000..69ab04a8 --- /dev/null +++ b/requirements/quality.txt @@ -0,0 +1,289 @@ +# +# This file is autogenerated by pip-compile with Python 3.11 +# by the following command: +# +# make upgrade +# +asgiref==3.8.1 + # via + # -r requirements/base.txt + # django + # django-cors-headers +astroid==3.3.5 + # via + # pylint + # pylint-celery +attrs==24.2.0 + # via + # -r requirements/base.txt + # jsonschema + # referencing +certifi==2024.8.30 + # via + # -r requirements/base.txt + # elasticsearch + # requests +cffi==1.17.1 + # via + # -r requirements/base.txt + # cryptography + # pynacl +charset-normalizer==3.4.0 + # via + # -r requirements/base.txt + # requests +click==8.1.7 + # via + # -r requirements/base.txt + # click-log + # code-annotations + # edx-django-utils + # edx-lint +click-log==0.4.0 + # via edx-lint +code-annotations==1.8.0 + # via + # -r requirements/quality.in + # edx-lint +cryptography==43.0.3 + # via + # -r requirements/base.txt + # pyjwt +dill==0.3.9 + # via pylint +django==4.2.16 + # via + # -c https://raw.githubusercontent.com/openedx/edx-lint/master/edx_lint/files/common_constraints.txt + # -r requirements/base.txt + # django-cors-headers + # django-crum + # django-nine + # django-waffle + # djangorestframework + # drf-jwt + # drf-spectacular + # edx-django-release-util + # edx-django-utils + # edx-drf-extensions +django-cors-headers==4.5.0 + # via -r requirements/base.txt +django-crum==0.7.9 + # via + # -r requirements/base.txt + # edx-django-utils +django-elasticsearch-dsl==7.4 + # via + # -r requirements/base.txt + # django-elasticsearch-dsl-drf +django-elasticsearch-dsl-drf==0.22.5 + # via -r requirements/base.txt +django-nine==0.2.7 + # via + # -r requirements/base.txt + # django-elasticsearch-dsl-drf +django-waffle==4.1.0 + # via + # -r requirements/base.txt + # edx-django-utils + # edx-drf-extensions +djangorestframework==3.15.2 + # via + # -r requirements/base.txt + # django-elasticsearch-dsl-drf + # drf-jwt + # drf-spectacular + # edx-drf-extensions +dnspython==2.7.0 + # via + # -r requirements/base.txt + # pymongo +drf-jwt==1.19.2 + # via + # -r requirements/base.txt + # edx-drf-extensions +drf-spectacular==0.27.2 + # via -r requirements/base.txt +edx-django-release-util==1.4.0 + # via -r requirements/base.txt +edx-django-utils==7.0.0 + # via + # -r requirements/base.txt + # edx-drf-extensions +edx-drf-extensions==10.5.0 + # via -r requirements/base.txt +edx-lint==5.4.1 + # via -r requirements/quality.in +edx-opaque-keys==2.11.0 + # via + # -r requirements/base.txt + # edx-drf-extensions +elasticsearch==7.13.4 + # via + # -c https://raw.githubusercontent.com/openedx/edx-lint/master/edx_lint/files/common_constraints.txt + # -r requirements/base.txt + # django-elasticsearch-dsl-drf + # elasticsearch-dsl +elasticsearch-dsl==7.4.1 + # via + # -r requirements/base.txt + # django-elasticsearch-dsl + # django-elasticsearch-dsl-drf +gunicorn==23.0.0 + # via -r requirements/base.txt +idna==3.10 + # via + # -r requirements/base.txt + # requests +inflection==0.5.1 + # via + # -r requirements/base.txt + # drf-spectacular +isort==5.13.2 + # via pylint +jinja2==3.1.4 + # via code-annotations +jsonschema==4.23.0 + # via + # -r requirements/base.txt + # drf-spectacular +jsonschema-specifications==2024.10.1 + # via + # -r requirements/base.txt + # jsonschema +markupsafe==3.0.2 + # via jinja2 +mccabe==0.7.0 + # via pylint +mysqlclient==2.2.5 + # via -r requirements/base.txt +newrelic==10.2.0 + # via + # -r requirements/base.txt + # edx-django-utils +packaging==24.1 + # via + # -r requirements/base.txt + # django-nine + # gunicorn +path==17.0.0 + # via + # -r requirements/base.txt + # path-py +path-py==12.5.0 + # via -r requirements/base.txt +pbr==6.1.0 + # via + # -r requirements/base.txt + # stevedore +platformdirs==4.3.6 + # via pylint +psutil==6.1.0 + # via + # -r requirements/base.txt + # edx-django-utils +pycodestyle==2.12.1 + # via -r requirements/quality.in +pycparser==2.22 + # via + # -r requirements/base.txt + # cffi +pyjwt[crypto]==2.9.0 + # via + # -r requirements/base.txt + # drf-jwt + # edx-drf-extensions +pylint==3.3.1 + # via + # -r requirements/quality.in + # edx-lint + # pylint-celery + # pylint-django + # pylint-plugin-utils +pylint-celery==0.3 + # via edx-lint +pylint-django==2.6.1 + # via edx-lint +pylint-plugin-utils==0.8.2 + # via + # pylint-celery + # pylint-django +pymongo==4.10.1 + # via + # -r requirements/base.txt + # edx-opaque-keys +pynacl==1.5.0 + # via + # -r requirements/base.txt + # edx-django-utils +python-dateutil==2.9.0.post0 + # via + # -r requirements/base.txt + # elasticsearch-dsl +python-slugify==8.0.4 + # via code-annotations +pytz==2024.2 + # via -r requirements/base.txt +pyyaml==6.0.2 + # via + # -r requirements/base.txt + # code-annotations + # drf-spectacular + # edx-django-release-util +referencing==0.35.1 + # via + # -r requirements/base.txt + # jsonschema + # jsonschema-specifications +requests==2.32.3 + # via + # -r requirements/base.txt + # edx-drf-extensions +rpds-py==0.20.0 + # via + # -r requirements/base.txt + # jsonschema + # referencing +semantic-version==2.10.0 + # via + # -r requirements/base.txt + # edx-drf-extensions +six==1.16.0 + # via + # -r requirements/base.txt + # django-elasticsearch-dsl + # django-elasticsearch-dsl-drf + # edx-django-release-util + # edx-lint + # elasticsearch-dsl + # python-dateutil +sqlparse==0.5.1 + # via + # -r requirements/base.txt + # django +stevedore==5.3.0 + # via + # -r requirements/base.txt + # code-annotations + # edx-django-utils + # edx-opaque-keys +text-unidecode==1.3 + # via python-slugify +tomlkit==0.13.2 + # via pylint +typing-extensions==4.12.2 + # via + # -r requirements/base.txt + # edx-opaque-keys +uritemplate==4.1.1 + # via + # -r requirements/base.txt + # drf-spectacular +urllib3==1.26.20 + # via + # -r requirements/base.txt + # elasticsearch + # requests + +# The following packages are considered to be unsafe in a requirements file: +setuptools==75.2.0 + # via -r requirements/base.txt diff --git a/requirements/test.txt b/requirements/test.txt index ea169672..acf5b249 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -8,9 +8,9 @@ asgiref==3.8.1 # via # -r requirements/base.txt # django -astroid==1.6.6 + # django-cors-headers +astroid==3.3.5 # via - # -c requirements/constraints.txt # -r requirements/test.in # pylint attrs==24.2.0 @@ -18,6 +18,8 @@ attrs==24.2.0 # -r requirements/base.txt # jsonschema # referencing +cachetools==5.5.0 + # via tox certifi==2024.8.30 # via # -r requirements/base.txt @@ -28,10 +30,13 @@ cffi==1.17.1 # -r requirements/base.txt # cryptography # pynacl -chardet==3.0.4 +chardet==5.2.0 # via - # -r requirements/base.txt # diff-cover + # tox +charset-normalizer==3.4.0 + # via + # -r requirements/base.txt # requests click==8.1.7 # via @@ -41,12 +46,12 @@ click==8.1.7 code-annotations==1.8.0 # via -r requirements/test.in colorama==0.4.6 - # via pylint -coverage[toml]==7.6.1 + # via tox +coverage[toml]==7.6.4 # via # -r requirements/test.in # pytest-cov -cryptography==43.0.1 +cryptography==43.0.3 # via # -r requirements/base.txt # pyjwt @@ -54,10 +59,12 @@ ddt==1.7.2 # via -r requirements/test.in diff-cover==9.2.0 # via -r requirements/test.in -distlib==0.3.8 +dill==0.3.9 + # via pylint +distlib==0.3.9 # via virtualenv # via - # -c requirements/common_constraints.txt + # -c https://raw.githubusercontent.com/openedx/edx-lint/master/edx_lint/files/common_constraints.txt # -r requirements/base.txt # django-cors-headers # django-crum @@ -69,17 +76,14 @@ distlib==0.3.8 # edx-django-release-util # edx-django-utils # edx-drf-extensions -django-cors-headers==3.14.0 - # via - # -c requirements/constraints.txt - # -r requirements/base.txt +django-cors-headers==4.5.0 + # via -r requirements/base.txt django-crum==0.7.9 # via # -r requirements/base.txt # edx-django-utils django-elasticsearch-dsl==7.4 # via - # -c requirements/constraints.txt # -r requirements/base.txt # django-elasticsearch-dsl-drf django-elasticsearch-dsl-drf==0.22.5 @@ -100,7 +104,7 @@ djangorestframework==3.15.2 # drf-jwt # drf-spectacular # edx-drf-extensions -dnspython==2.6.1 +dnspython==2.7.0 # via # -r requirements/base.txt # pymongo @@ -112,11 +116,11 @@ drf-spectacular==0.27.2 # via -r requirements/base.txt edx-django-release-util==1.4.0 # via -r requirements/base.txt -edx-django-utils==5.16.0 +edx-django-utils==7.0.0 # via # -r requirements/base.txt # edx-drf-extensions -edx-drf-extensions==10.4.0 +edx-drf-extensions==10.5.0 # via -r requirements/base.txt edx-opaque-keys==2.11.0 # via @@ -124,20 +128,18 @@ edx-opaque-keys==2.11.0 # edx-drf-extensions elasticsearch==7.13.4 # via - # -c requirements/common_constraints.txt - # -c requirements/constraints.txt + # -c https://raw.githubusercontent.com/openedx/edx-lint/master/edx_lint/files/common_constraints.txt # -r requirements/base.txt # django-elasticsearch-dsl-drf # elasticsearch-dsl elasticsearch-dsl==7.4.1 # via - # -c requirements/constraints.txt # -r requirements/base.txt # django-elasticsearch-dsl # django-elasticsearch-dsl-drf factory-boy==3.3.1 # via -r requirements/test.in -faker==30.1.0 +faker==30.8.1 # via factory-boy filelock==3.16.1 # via @@ -145,7 +147,7 @@ filelock==3.16.1 # virtualenv gunicorn==23.0.0 # via -r requirements/base.txt -idna==2.10 +idna==3.10 # via # -r requirements/base.txt # requests @@ -155,6 +157,8 @@ inflection==0.5.1 # drf-spectacular iniconfig==2.0.0 # via pytest +isort==5.13.2 + # via pylint jinja2==3.1.4 # via # code-annotations @@ -163,21 +167,19 @@ jsonschema==4.23.0 # via # -r requirements/base.txt # drf-spectacular -jsonschema-specifications==2023.12.1 +jsonschema-specifications==2024.10.1 # via # -r requirements/base.txt # jsonschema -lazy-object-proxy==1.10.0 - # via astroid -markupsafe==2.1.5 +markupsafe==3.0.2 # via jinja2 -more-itertools==5.0.0 - # via - # -c requirements/constraints.txt - # -r requirements/test.in -mysqlclient==2.2.4 +mccabe==0.7.0 + # via pylint +more-itertools==10.5.0 + # via -r requirements/test.in +mysqlclient==2.2.5 # via -r requirements/base.txt -newrelic==10.0.0 +newrelic==10.2.0 # via # -r requirements/base.txt # edx-django-utils @@ -186,12 +188,15 @@ packaging==24.1 # -r requirements/base.txt # django-nine # gunicorn + # pyproject-api # pytest # tox -path-py==9.1 +path==17.0.0 # via - # -c requirements/constraints.txt # -r requirements/base.txt + # path-py +path-py==12.5.0 + # via -r requirements/base.txt pbr==6.1.0 # via # -r requirements/base.txt @@ -199,18 +204,19 @@ pbr==6.1.0 pep8==1.7.1 # via -r requirements/test.in platformdirs==4.3.6 - # via virtualenv + # via + # pylint + # tox + # virtualenv pluggy==1.5.0 # via # diff-cover # pytest # tox -psutil==6.0.0 +psutil==6.1.0 # via # -r requirements/base.txt # edx-django-utils -py==1.11.0 - # via tox pycparser==2.22 # via # -r requirements/base.txt @@ -222,10 +228,8 @@ pyjwt[crypto]==2.9.0 # -r requirements/base.txt # drf-jwt # edx-drf-extensions -pylint==1.5.0 - # via - # -c requirements/constraints.txt - # -r requirements/test.in +pylint==3.3.1 + # via -r requirements/test.in pymongo==4.10.1 # via # -r requirements/base.txt @@ -234,6 +238,8 @@ pynacl==1.5.0 # via # -r requirements/base.txt # edx-django-utils +pyproject-api==1.8.0 + # via tox pytest==8.3.3 # via # -r requirements/test.in @@ -243,9 +249,8 @@ pytest-cov==5.0.0 # via -r requirements/test.in pytest-django==4.9.0 # via -r requirements/test.in -python-dateutil==2.4.0 +python-dateutil==2.9.0.post0 # via - # -c requirements/constraints.txt # -r requirements/base.txt # elasticsearch-dsl # faker @@ -264,9 +269,8 @@ referencing==0.35.1 # -r requirements/base.txt # jsonschema # jsonschema-specifications -requests==2.25.0 +requests==2.32.3 # via - # -c requirements/constraints.txt # -r requirements/base.txt # edx-drf-extensions rpds-py==0.20.0 @@ -281,15 +285,11 @@ semantic-version==2.10.0 six==1.16.0 # via # -r requirements/base.txt - # astroid # django-elasticsearch-dsl # django-elasticsearch-dsl-drf # edx-django-release-util # elasticsearch-dsl - # more-itertools - # pylint # python-dateutil - # tox sqlparse==0.5.1 # via # -r requirements/base.txt @@ -302,7 +302,9 @@ stevedore==5.3.0 # edx-opaque-keys text-unidecode==1.3 # via python-slugify -tox==3.28.0 +tomlkit==0.13.2 + # via pylint +tox==4.23.2 # via -r requirements/test.in typing-extensions==4.12.2 # via @@ -318,7 +320,9 @@ urllib3==1.26.20 # -r requirements/base.txt # elasticsearch # requests -virtualenv==20.26.6 +virtualenv==20.27.1 # via tox -wrapt==1.16.0 - # via astroid + +# The following packages are considered to be unsafe in a requirements file: +setuptools==75.2.0 + # via -r requirements/base.txt diff --git a/tox.ini b/tox.ini index 5b64eb6b..838605e8 100644 --- a/tox.ini +++ b/tox.ini @@ -1,12 +1,12 @@ [tox] -envlist = py{311,312}-django{42} +envlist = py{311,312}-django{42} #, quality, pii_check, check_keywords skipsdist = true +isolated_build = true # Enable isolated build environments [testenv] +envdir = {toxworkdir}/{envname} deps = - setuptools django42: Django>=4.2,<5.0 - -r {toxinidir}/requirements/test.txt passenv = CONN_MAX_AGE DB_ENGINE @@ -21,3 +21,34 @@ allowlist_externals = make commands = make validate + +[testenv:quality] +envdir = {toxworkdir}/{envname} +allowlist_externals = + make +deps = + -r{toxinidir}/requirements/quality.txt +commands = + make quality + +[testenv:pii_check] +envdir = {toxworkdir}/{envname} +setenv = + DJANGO_SETTINGS_MODULE = notesserver.settings.test +allowlist_externals = + make +deps = + Django>=4.2,<5.0 +commands = + make pii_check + +[testenv:check_keywords] +envdir = {toxworkdir}/{envname} +setenv = + DJANGO_SETTINGS_MODULE = notesserver.settings.test +allowlist_externals = + make +deps = + -r{toxinidir}/requirements/test.txt +commands = + make check_keywords