Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add python 3.12 support #146

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 33 additions & 27 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ name: Python CI

on:
push:
branches: [ main ]
branches: [main]
pull_request:
branches:
- '**'
- '**'


jobs:
Expand All @@ -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
50 changes: 16 additions & 34 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,57 +1,38 @@
[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
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
Expand All @@ -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

Loading