Skip to content

Commit

Permalink
feat: add python312 support (#483)
Browse files Browse the repository at this point in the history
  • Loading branch information
edx-requirements-bot authored Mar 7, 2024
1 parent b108fe6 commit 2f779b0
Show file tree
Hide file tree
Showing 15 changed files with 100 additions and 46 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ jobs:
strategy:
matrix:
os: [ubuntu-20.04]
python-version: ['3.8']
toxenv: [python,quality]
python-version: ['3.8', '3.12']
toxenv: [python, quality]

steps:
- name: Checkout Repo
Expand All @@ -38,7 +38,7 @@ jobs:
run: tox

- name: Run Coverage
if: matrix.python-version == '3.8' && matrix.toxenv=='python'
if: matrix.python-version == '3.12' && matrix.toxenv=='python'
uses: codecov/codecov-action@v3
with:
flags: unittests
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ Unreleased
**********


[1.1.0] - 2024-03-06
********************

Added
=====
* Added support for ``Python 3.12``


[1.1.0] - 2023-04-14
********************

Expand Down
10 changes: 9 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,18 @@ docs: ## generate Sphinx HTML documentation, including API docs
# Define PIP_COMPILE_OPTS=-v to get more information during make upgrade.
PIP_COMPILE = pip-compile --upgrade $(PIP_COMPILE_OPTS)

COMMON_CONSTRAINTS_TXT=requirements/common_constraints.txt
.PHONY: $(COMMON_CONSTRAINTS_TXT)
$(COMMON_CONSTRAINTS_TXT):
wget -O "$(@)" https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt || touch "$(@)"
echo "$(COMMON_CONSTRAINTS_TEMP_COMMENT)" | cat - $(@) > temp && mv temp $(@)

upgrade: export CUSTOM_COMPILE_COMMAND=make upgrade
upgrade: ## update the requirements/*.txt files with the latest packages satisfying requirements/*.in
upgrade: $(COMMON_CONSTRAINTS_TXT) ## update the requirements/*.txt files satisfying requirements/*.in
sed 's/Django<4.0//g' requirements/common_constraints.txt > requirements/common_constraints.tmp
mv requirements/common_constraints.tmp requirements/common_constraints.txt
pip install -qr requirements/pip-tools.txt
# Make sure to compile files after any other files they include!
$(PIP_COMPILE) --allow-unsafe --rebuild -o requirements/pip.txt requirements/pip.in
$(PIP_COMPILE) -o requirements/pip-tools.txt requirements/pip-tools.in
$(PIP_COMPILE) -o requirements/base.txt requirements/base.in
Expand Down
2 changes: 1 addition & 1 deletion repo_health/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import dockerfile
import pytest

__version__ = "1.1.0"
__version__ = "1.1.1"


def parse_config_file(path):
Expand Down
2 changes: 1 addition & 1 deletion requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ pyasn1==0.5.1
# rsa
pyasn1-modules==0.3.0
# via google-auth
pyparsing==3.1.1
pyparsing==3.1.2
# via packaging
pytest==8.0.2
# via
Expand Down
2 changes: 1 addition & 1 deletion requirements/ci.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ platformdirs==4.2.0
# virtualenv
pluggy==1.4.0
# via tox
pyparsing==3.1.1
pyparsing==3.1.2
# via packaging
pyproject-api==1.5.0
# via tox
Expand Down
24 changes: 24 additions & 0 deletions requirements/common_constraints.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@

# 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
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
6 changes: 5 additions & 1 deletion requirements/constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# linking to it here is good.

# This file contains all common constraints for edx-repos
-c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt
-c common_constraints.txt

# greater version breaking test.
packaging==21.3
Expand All @@ -21,3 +21,7 @@ gspread<5.12.0

# pytest==8.1.0 breaks test plugin [needs to be investigated separately]
pytest<8.1.0

# Needed for Python 3.12 compatibility.
# Can be removed once support for Python<3.12 is dropped.
backports-zoneinfo==0.2.1; python_version < "3.9"
9 changes: 5 additions & 4 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ attrs==23.2.0
# via
# -r requirements/quality.txt
# aiohttp
backports-zoneinfo==0.2.1
backports-zoneinfo==0.2.1 ; python_version < "3.9"
# via
# -c requirements/constraints.txt
# -r requirements/quality.txt
# django
build==1.1.1
Expand Down Expand Up @@ -93,7 +94,7 @@ distlib==0.3.8
# virtualenv
django==4.2.11
# via
# -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt
# -c requirements/common_constraints.txt
# -r requirements/quality.txt
dockerfile==3.3.1
# via -r requirements/quality.txt
Expand Down Expand Up @@ -193,7 +194,7 @@ pbr==6.0.0
# via
# -r requirements/quality.txt
# stevedore
pip-tools==7.4.0
pip-tools==7.4.1
# via -r requirements/pip-tools.txt
platformdirs==4.2.0
# via
Expand Down Expand Up @@ -246,7 +247,7 @@ pylint-plugin-utils==0.8.2
# -r requirements/quality.txt
# pylint-celery
# pylint-django
pyparsing==3.1.1
pyparsing==3.1.2
# via
# -r requirements/ci.txt
# -r requirements/pip-tools.txt
Expand Down
2 changes: 1 addition & 1 deletion requirements/doc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ pygments==2.17.2
# pydata-sphinx-theme
# readme-renderer
# sphinx
pyparsing==3.1.1
pyparsing==3.1.2
# via
# -r requirements/test.txt
# packaging
Expand Down
4 changes: 2 additions & 2 deletions requirements/pip-tools.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ packaging==21.3
# via
# -c requirements/constraints.txt
# build
pip-tools==7.4.0
pip-tools==7.4.1
# via -r requirements/pip-tools.in
pyparsing==3.1.1
pyparsing==3.1.2
# via packaging
pyproject-hooks==1.0.0
# via
Expand Down
10 changes: 6 additions & 4 deletions requirements/quality.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@ attrs==23.2.0
# via
# -r requirements/test.txt
# aiohttp
backports-zoneinfo==0.2.1
# via django
backports-zoneinfo==0.2.1 ; python_version < "3.9"
# via
# -c requirements/constraints.txt
# django
cachetools==5.3.3
# via
# -r requirements/test.txt
Expand Down Expand Up @@ -58,7 +60,7 @@ dill==0.3.8
# via pylint
django==4.2.11
# via
# -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt
# -c requirements/common_constraints.txt
# -r requirements/quality.in
dockerfile==3.3.1
# via -r requirements/test.txt
Expand Down Expand Up @@ -164,7 +166,7 @@ pylint-plugin-utils==0.8.2
# via
# pylint-celery
# pylint-django
pyparsing==3.1.1
pyparsing==3.1.2
# via
# -r requirements/test.txt
# packaging
Expand Down
2 changes: 1 addition & 1 deletion requirements/test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ pyasn1-modules==0.3.0
# via
# -r requirements/base.txt
# google-auth
pyparsing==3.1.1
pyparsing==3.1.2
# via
# -r requirements/base.txt
# packaging
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ def is_requirement(line):
"Natural Language :: English",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.12",
],
entry_points={
"console_scripts": [
Expand Down
58 changes: 32 additions & 26 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py38
envlist = python, quality

[doc8]
max-line-length = 120
Expand All @@ -11,39 +11,45 @@ max-line-length = 120
[pytest]
addopts = --cov repo_health --cov-report term-missing --cov-report xml
norecursedirs = .* docs requirements
testpaths =
testpaths =
tests

[pydocstyle]
ignore = D101,D200,D203,D212,D215,D404,D405,D406,D407,D408,D409,D410,D411,D412,D413,D414
match-dir = (?!migrations)

[testenv]
deps =
-r{toxinidir}/requirements/test.txt
commands =
pytest {posargs}
setenv =
PYTHONPATH = {toxinidir}
deps =
setuptools
-r{toxinidir}/requirements/test.txt
commands =
pytest {posargs}

[testenv:docs]
setenv =
PYTHONPATH = {toxinidir}
allowlist_externals =
make
rm
deps =
-r{toxinidir}/requirements/doc.txt
commands =
doc8 --ignore-path docs/_build README.rst docs
rm -f docs/modules.rst
make -C docs clean
make -C docs html
python setup.py check --restructuredtext --strict
setenv =
PYTHONPATH = {toxinidir}
allowlist_externals =
make
rm
deps =
setuptools
-r{toxinidir}/requirements/doc.txt
commands =
doc8 --ignore-path docs/_build README.rst docs
rm -f docs/modules.rst
make -C docs clean
make -C docs html
python setup.py check --restructuredtext --strict

[testenv:quality]
setenv =
PYTHONPATH = {toxinidir}
deps =
-r{toxinidir}/requirements/quality.txt
commands =
pylint repo_health setup.py repo_health_dashboard tests
isort --check repo_health setup.py repo_health_dashboard tests
setenv =
PYTHONPATH = {toxinidir}
deps =
setuptools
-r{toxinidir}/requirements/quality.txt
commands =
pylint repo_health setup.py repo_health_dashboard tests
isort --check repo_health setup.py repo_health_dashboard tests

0 comments on commit 2f779b0

Please sign in to comment.