From 976c790d2c19fb49891494e2a292e3daea605e3b Mon Sep 17 00:00:00 2001 From: edX requirements bot Date: Fri, 23 Feb 2024 04:26:40 -0500 Subject: [PATCH] feat: add python312 support --- .github/workflows/ci.yml | 6 +-- CHANGELOG.rst | 8 ++++ Makefile | 10 ++++- repo_health/__init__.py | 2 +- requirements/base.in | 2 + requirements/base.txt | 7 +++- requirements/ci.txt | 2 +- requirements/common_constraints.txt | 24 ++++++++++++ requirements/constraints.txt | 2 +- requirements/dev.txt | 8 ++-- requirements/doc.txt | 4 +- requirements/pip-tools.txt | 4 +- requirements/quality.txt | 10 +++-- requirements/test.txt | 4 +- setup.py | 1 + tox.ini | 58 ++++++++++++++++------------- 16 files changed, 106 insertions(+), 46 deletions(-) create mode 100644 requirements/common_constraints.txt diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8c7b05c5..3876896c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 @@ -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 diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 4db8e378..c8e6f52d 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -15,6 +15,14 @@ Unreleased ********** +[1.1.0] - 2024-03-06 +******************** + +Added +===== +* Added support for ``Python 3.12`` + + [1.1.0] - 2023-04-14 ******************** diff --git a/Makefile b/Makefile index bfb79939..3264abbb 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/repo_health/__init__.py b/repo_health/__init__.py index 489e9575..7fa4e2e8 100644 --- a/repo_health/__init__.py +++ b/repo_health/__init__.py @@ -12,7 +12,7 @@ import dockerfile import pytest -__version__ = "1.1.0" +__version__ = "1.1.1" def parse_config_file(path): diff --git a/requirements/base.in b/requirements/base.in index 2777ba6f..b0f15e35 100644 --- a/requirements/base.in +++ b/requirements/base.in @@ -8,3 +8,5 @@ pytest-asyncio # Enable async tests (and checks) pytest-repo-health # plugin used to run the checks in this repo dockerfile # wrapper around docker/docker's parser for dockerfiles. toml +setuptools +backports.zoneinfo; python_version<'3.9' diff --git a/requirements/base.txt b/requirements/base.txt index 2bb85acd..078fb561 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -14,6 +14,8 @@ async-timeout==4.0.3 # via aiohttp attrs==23.2.0 # via aiohttp +backports-zoneinfo==0.2.1 ; python_version < "3.9" + # via -r requirements/base.in cachetools==5.3.3 # via google-auth certifi==2024.2.2 @@ -68,7 +70,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 @@ -104,3 +106,6 @@ urllib3==2.2.1 # via requests yarl==1.9.4 # via aiohttp + +# The following packages are considered to be unsafe in a requirements file: +# setuptools diff --git a/requirements/ci.txt b/requirements/ci.txt index 3567c212..1535f01c 100644 --- a/requirements/ci.txt +++ b/requirements/ci.txt @@ -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 diff --git a/requirements/common_constraints.txt b/requirements/common_constraints.txt new file mode 100644 index 00000000..0ab0ecd2 --- /dev/null +++ b/requirements/common_constraints.txt @@ -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 diff --git a/requirements/constraints.txt b/requirements/constraints.txt index de3a9769..5268303c 100644 --- a/requirements/constraints.txt +++ b/requirements/constraints.txt @@ -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 diff --git a/requirements/dev.txt b/requirements/dev.txt index 0cc9992a..0f205d70 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -30,7 +30,7 @@ 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 # -r requirements/quality.txt # django @@ -93,7 +93,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 @@ -193,7 +193,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 @@ -246,7 +246,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 diff --git a/requirements/doc.txt b/requirements/doc.txt index ed435e9e..677a7351 100644 --- a/requirements/doc.txt +++ b/requirements/doc.txt @@ -29,6 +29,8 @@ babel==2.14.0 # via # pydata-sphinx-theme # sphinx +backports-zoneinfo==0.2.1 ; python_version < "3.9" + # via -r requirements/test.txt beautifulsoup4==4.12.3 # via pydata-sphinx-theme cachetools==5.3.3 @@ -149,7 +151,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 diff --git a/requirements/pip-tools.txt b/requirements/pip-tools.txt index eb22e3fc..cc36b327 100644 --- a/requirements/pip-tools.txt +++ b/requirements/pip-tools.txt @@ -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 diff --git a/requirements/quality.txt b/requirements/quality.txt index 1f8fba46..5e5aa428 100644 --- a/requirements/quality.txt +++ b/requirements/quality.txt @@ -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 + # -r requirements/test.txt + # django cachetools==5.3.3 # via # -r requirements/test.txt @@ -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 @@ -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 diff --git a/requirements/test.txt b/requirements/test.txt index 0452512d..b11e47ed 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -21,6 +21,8 @@ attrs==23.2.0 # via # -r requirements/base.txt # aiohttp +backports-zoneinfo==0.2.1 ; python_version < "3.9" + # via -r requirements/base.txt cachetools==5.3.3 # via # -r requirements/base.txt @@ -105,7 +107,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 diff --git a/setup.py b/setup.py index 807991e0..bca3202d 100644 --- a/setup.py +++ b/setup.py @@ -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": [ diff --git a/tox.ini b/tox.ini index cc71d359..3d11ba10 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py38 +envlist = python, quality [doc8] max-line-length = 120 @@ -11,7 +11,7 @@ max-line-length = 120 [pytest] addopts = --cov repo_health --cov-report term-missing --cov-report xml norecursedirs = .* docs requirements -testpaths = +testpaths = tests [pydocstyle] @@ -19,31 +19,37 @@ ignore = D101,D200,D203,D212,D215,D404,D405,D406,D407,D408,D409,D410,D411,D412,D 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 +