From a64a58a76ddfd5bebc0ae75a5c9e629eebe8d66e Mon Sep 17 00:00:00 2001 From: edX requirements bot Date: Fri, 23 Feb 2024 07:37:36 -0500 Subject: [PATCH] feat: add python 3.12 support --- .github/workflows/ci.yml | 60 ++++++++++++++++++++++------------------ tox.ini | 50 +++++++++++---------------------- 2 files changed, 49 insertions(+), 61 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3c9ae6fe..768eec2d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,10 +2,10 @@ name: Python CI on: push: - branches: [ main ] + branches: [main] pull_request: branches: - - '**' + - '**' jobs: @@ -15,30 +15,36 @@ jobs: strategy: matrix: os: [ubuntu-20.04] - python-version: ['3.8'] - toxenv: ["py38", "quality", "docs"] + python-version: + - '3.8' + - '3.12' + toxenv: + - "py38" + - "quality" + - "docs" + - django42 steps: - - uses: actions/checkout@v4 - - name: setup python - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - - name: Install pip - run: pip install -r requirements/pip.txt - - - name: Install Dependencies - run: pip install -r requirements/ci.txt - - - name: Run Tests - env: - TOXENV: ${{ matrix.toxenv }} - run: tox - - - name: Run coverage - if: matrix.python-version == '3.8' && matrix.toxenv == 'py38' - uses: codecov/codecov-action@v3 - with: - flags: unittests - fail_ci_if_error: true + - uses: actions/checkout@v4 + - name: setup python + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: Install pip + run: pip install -r requirements/pip.txt + + - name: Install Dependencies + run: pip install -r requirements/ci.txt + + - name: Run Tests + env: + TOXENV: ${{ matrix.toxenv }} + run: tox + + - name: Run coverage + if: matrix.python-version == '3.8' && matrix.toxenv == 'py38' + uses: codecov/codecov-action@v3 + with: + flags: unittests + fail_ci_if_error: true diff --git a/tox.ini b/tox.ini index 54d356ec..ee2e57b0 100644 --- a/tox.ini +++ b/tox.ini @@ -1,10 +1,8 @@ [tox] -envlist = py{38}, quality, docs, pii_check - +envlist = py{38, 312}, quality, docs, pii_check [doc8] -; D001 = Line too long -ignore=D001 +ignore = D001 [pycodestyle] exclude = .git,.tox @@ -12,46 +10,29 @@ max-line-length = 120 max-doc-length = 120 [pydocstyle] -; D101 = Missing docstring in public class -; D200 = One-line docstring should fit on one line with quotes -; D203 = 1 blank line required before class docstring -; D212 = Multi-line docstring summary should start at the first line -; D215 = Section underline is over-indented (numpy style) -; D404 = First word of the docstring should not be This (numpy style) -; D405 = Section name should be properly capitalized (numpy style) -; D406 = Section name should end with a newline (numpy style) -; D407 = Missing dashed underline after section (numpy style) -; D408 = Section underline should be in the line following the section’s name (numpy style) -; D409 = Section underline should match the length of its name (numpy style) -; D410 = Missing blank line after section (numpy style) -; D411 = Missing blank line before section (numpy style) -; D412 = No blank lines allowed between a section header and its content (numpy style) -; D413 = Missing blank line after last section (numpy style) -; D414 = Section has no content (numpy style) ignore = D101,D200,D203,D212,D215,D404,D405,D406,D407,D408,D409,D410,D411,D412,D413,D414 - [pytest] -DJANGO_SETTINGS_MODULE = test_utils.test_settings +django_settings_module = test_utils.test_settings addopts = --cov openedx_filters --cov-report term-missing --cov-report xml norecursedirs = .* docs requirements site-packages [testenv] -deps = +deps = -r{toxinidir}/requirements/test.txt -commands = +commands = pytest {posargs} [testenv:docs] -setenv = +setenv = DJANGO_SETTINGS_MODULE = test_utils.test_settings PYTHONPATH = {toxinidir} -allowlist_externals = +allowlist_externals = make rm -deps = +deps = -r{toxinidir}/requirements/doc.txt -commands = +commands = doc8 --ignore-path docs/_build README.rst docs rm -f docs/openedx_filters.rst rm -f docs/modules.rst @@ -60,19 +41,20 @@ commands = python setup.py check --restructuredtext --strict [testenv:quality] -allowlist_externals = +allowlist_externals = make rm touch -deps = +deps = -r{toxinidir}/requirements/quality.txt -commands = +commands = make quality [testenv:pii_check] -setenv = +setenv = DJANGO_SETTINGS_MODULE = test_utils.test_settings -deps = +deps = -r{toxinidir}/requirements/test.txt -commands = +commands = code_annotations django_find_annotations --config_file .pii_annotations.yml --lint --report --coverage +