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: adding python3.11 and 3.12 support #227

Merged
merged 6 commits into from
Apr 1, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
7 changes: 3 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@ jobs:
strategy:
matrix:
os: [ubuntu-20.04]
python-version: ['3.8']
toxenv: [
quality, docs, django32-drf314, django42-drf314
]
python-version: ['3.8', '3.11']
toxenv: [quality, docs, django42-drf314]


steps:
- uses: actions/checkout@v2
Expand Down
34 changes: 24 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,34 @@ dev_requirements: ## Install Dev Requirements
test_requirements: ## Install Test Requirements
pip install -r requirements/test.txt

upgrade: export CUSTOM_COMPILE_COMMAND=make upgrade
upgrade: ## Update the requirements/*.txt files with the latest packages satisfying requirements/*.in
pip install -qr requirements/pip-tools.txt
piptools:
pip install -q -r requirements/pip-tools.txt

define COMMON_CONSTRAINTS_TEMP_COMMENT
# This is a temporary solution to override the real common_constraints.txt\n# In edx-lint, until the pyjwt constraint in edx-lint has been removed.\n# See BOM-2721 for more details.\n# Below is the copied and edited version of common_constraints\n
endef

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 $(@)

export CUSTOM_COMPILE_COMMAND = make upgrade
upgrade: piptools $(COMMON_CONSTRAINTS_TXT) ## update the requirements/*.txt files with the latest packages satisfying requirements/*.in
# Make sure to compile files after any other files they include!
pip-compile --upgrade --allow-unsafe --rebuild -o requirements/pip.txt requirements/pip.in
pip-compile --upgrade --verbose --rebuild -o requirements/pip-tools.txt requirements/pip-tools.in
pip-compile --upgrade --allow-unsafe --verbose --rebuild -o requirements/pip-tools.txt requirements/pip-tools.in
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--allow-unsafe shouldn't be needed for Python 3.11 support.

pip install -qr requirements/pip.txt
pip install -qr requirements/pip-tools.txt
pip-compile --upgrade --verbose --rebuild -o requirements/base.txt requirements/base.in
pip-compile --upgrade --verbose --rebuild -o requirements/docs.txt requirements/docs.in
pip-compile --upgrade --verbose --rebuild -o requirements/test.txt requirements/test.in
pip-compile --upgrade --verbose --rebuild -o requirements/dev.txt requirements/dev.in
pip-compile --upgrade --verbose --rebuild -o requirements/tox.txt requirements/tox.in
pip-compile --upgrade --verbose --rebuild -o requirements/ci.txt requirements/ci.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-compile --upgrade --allow-unsafe --verbose --rebuild -o requirements/base.txt requirements/base.in
pip-compile --upgrade --allow-unsafe --verbose --rebuild -o requirements/docs.txt requirements/docs.in
pip-compile --upgrade --allow-unsafe --verbose --rebuild -o requirements/test.txt requirements/test.in
pip-compile --upgrade --allow-unsafe --verbose --rebuild -o requirements/dev.txt requirements/dev.in
pip-compile --upgrade --allow-unsafe --verbose --rebuild -o requirements/tox.txt requirements/tox.in
pip-compile --upgrade --allow-unsafe --verbose --rebuild -o requirements/ci.txt requirements/ci.in
# Let tox control the Django and DRF versions for tests
sed -i.tmp '/^django==/d' requirements/test.txt
sed -i.tmp '/^djangorestframework==/d' requirements/test.txt
Expand Down
17 changes: 4 additions & 13 deletions pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
# SERIOUSLY.
#
# ------------------------------
# Generated by edx-lint version: 5.2.5
# Generated by edx-lint version: 5.3.6
# ------------------------------
[MASTER]
ignore =
Expand Down Expand Up @@ -141,7 +141,6 @@ enable =
no-self-argument,
no-value-for-parameter,
non-iterator-returned,
non-parent-method-called,
nonexistent-operator,
not-a-mapping,
not-an-iterable,
Expand All @@ -161,13 +160,10 @@ enable =
return-outside-function,
signature-differs,
super-init-not-called,
super-method-not-called,
syntax-error,
test-inherits-tests,
too-few-format-args,
too-many-format-args,
too-many-function-args,
translation-of-non-string,
truncated-format-string,
undefined-all-variable,
undefined-loop-variable,
Expand Down Expand Up @@ -213,7 +209,6 @@ enable =
consider-using-enumerate,
global-at-module-level,
global-variable-not-assigned,
literal-used-as-attribute,
logging-format-interpolation,
logging-not-lazy,
multiple-imports,
Expand All @@ -224,7 +219,6 @@ enable =
redundant-unittest-assert,
reimported,
simplifiable-if-statement,
simplifiable-range,
singleton-comparison,
superfluous-parens,
unidiomatic-typecheck,
Expand All @@ -233,7 +227,6 @@ enable =
unnecessary-semicolon,
unneeded-not,
useless-else-on-loop,
wrong-assert-type,

deprecated-method,
deprecated-module,
Expand All @@ -259,6 +252,7 @@ enable =
useless-suppression,
disable =
bad-indentation,
broad-exception-raised,
consider-using-f-string,
duplicate-code,
file-ignored,
Expand All @@ -282,9 +276,6 @@ disable =
unused-wildcard-import,
use-maxsplit-arg,

feature-toggle-needs-doc,
illegal-waffle-usage,

logging-fstring-interpolation,

[REPORTS]
Expand Down Expand Up @@ -380,6 +371,6 @@ ext-import-graph =
int-import-graph =

[EXCEPTIONS]
overgeneral-exceptions = Exception
overgeneral-exceptions = builtins.Exception

# 54daa2b24c4b5341a45cdb4727fe15d05ef04c5f
# 5f343c05ade94b1f05eeb1763ca543bf867246f6
8 changes: 2 additions & 6 deletions requirements/base.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,8 @@
-c constraints.txt

Django
django-model-utils>=2.3.1

django-model-utils
jsonfield
pytz


# Don't let edx-platform upgrade DRF past versions that have already been tested here
djangorestframework<3.15.0
djangorestframework

8 changes: 5 additions & 3 deletions requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@
#
asgiref==3.7.2
# via django
django==3.2.24
backports-zoneinfo==0.2.1 ; python_version < "3.9"
# via
# -c requirements/constraints.txt
# django
django==4.2.10
# via
# -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt
# -r requirements/base.in
# django-model-utils
# djangorestframework
Expand All @@ -22,7 +25,6 @@ jsonfield==3.1.0
pytz==2024.1
# via
# -r requirements/base.in
# django
# djangorestframework
sqlparse==0.4.4
# via django
Expand Down
2 changes: 1 addition & 1 deletion requirements/ci.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
# make upgrade
#
cachetools==5.3.2
cachetools==5.3.3
# via
# -r requirements/tox.txt
# tox
Expand Down
47 changes: 47 additions & 0 deletions requirements/common_constraints.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# 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

# 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

# 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

# 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

# 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


# 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
5 changes: 4 additions & 1 deletion requirements/constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,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
# Common constraints for edx repos
-c common_constraints.txt

backports.zoneinfo;python_version<"3.9"
13 changes: 9 additions & 4 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ babel==2.14.0
# -r requirements/test.txt
# pydata-sphinx-theme
# sphinx
backports-zoneinfo==0.2.1 ; python_version < "3.9"
# via
# -c requirements/constraints.txt
# -r requirements/base.txt
# -r requirements/docs.txt
# -r requirements/test.txt
# django
beautifulsoup4==4.12.3
# via
# -r requirements/docs.txt
Expand Down Expand Up @@ -70,9 +77,8 @@ dill==0.3.8
# via
# -r requirements/test.txt
# pylint
django==3.2.24
django==4.2.10
# via
# -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt
# -r requirements/base.txt
# -r requirements/docs.txt
# -r requirements/test.txt
Expand Down Expand Up @@ -236,7 +242,6 @@ pytz==2024.1
# -r requirements/docs.txt
# -r requirements/test.txt
# babel
# django
# djangorestframework
pyyaml==6.0.1
# via
Expand Down Expand Up @@ -329,7 +334,7 @@ tomli==2.0.1
# coverage
# pylint
# pytest
tomlkit==0.12.3
tomlkit==0.12.4
# via
# -r requirements/test.txt
# pylint
Expand Down
9 changes: 6 additions & 3 deletions requirements/docs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,19 @@ babel==2.14.0
# via
# pydata-sphinx-theme
# sphinx
backports-zoneinfo==0.2.1 ; python_version < "3.9"
# via
# -c requirements/constraints.txt
# -r requirements/base.txt
# django
beautifulsoup4==4.12.3
# via pydata-sphinx-theme
certifi==2024.2.2
# via requests
charset-normalizer==3.3.2
# via requests
django==3.2.24
django==4.2.10
# via
# -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt
# -r requirements/base.txt
# django-model-utils
# djangorestframework
Expand Down Expand Up @@ -66,7 +70,6 @@ pytz==2024.1
# via
# -r requirements/base.txt
# babel
# django
# djangorestframework
requests==2.31.0
# via sphinx
Expand Down
6 changes: 4 additions & 2 deletions requirements/pip-tools.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,7 @@ zipp==3.17.0
# via importlib-metadata

# The following packages are considered to be unsafe in a requirements file:
# pip
# setuptools
pip==24.0
# via pip-tools
setuptools==69.1.1
# via pip-tools
10 changes: 7 additions & 3 deletions requirements/test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ babel==2.14.0
# -r requirements/docs.txt
# pydata-sphinx-theme
# sphinx
backports-zoneinfo==0.2.1 ; python_version < "3.9"
# via
# -c requirements/constraints.txt
# -r requirements/base.txt
# -r requirements/docs.txt
# django
beautifulsoup4==4.12.3
# via
# -r requirements/docs.txt
Expand Down Expand Up @@ -54,7 +60,6 @@ ddt==1.7.2
dill==0.3.8
# via pylint
# via
# -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt
# -r requirements/base.txt
# -r requirements/docs.txt
# django-model-utils
Expand Down Expand Up @@ -179,7 +184,6 @@ pytz==2024.1
# -r requirements/base.txt
# -r requirements/docs.txt
# babel
# django
# djangorestframework
pyyaml==6.0.1
# via code-annotations
Expand Down Expand Up @@ -249,7 +253,7 @@ tomli==2.0.1
# coverage
# pylint
# pytest
tomlkit==0.12.3
tomlkit==0.12.4
# via pylint
typing-extensions==4.10.0
# via
Expand Down
2 changes: 1 addition & 1 deletion requirements/tox.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
# make upgrade
#
cachetools==5.3.2
cachetools==5.3.3
# via tox
chardet==5.2.0
# via tox
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,14 @@ def get_version(*file_paths):
classifiers=[
'Development Status :: 3 - Alpha',
'Framework :: Django',
'Framework :: Django :: 3.2',
'Framework :: Django :: 4.0',
'Framework :: Django :: 4.2',
'Intended Audience :: Developers',
'License :: OSI Approved :: GNU Affero General Public License v3',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.11',
],
packages=find_packages(include=['submissions*'], exclude=['*.test', '*.tests']),
install_requires=load_requirements('requirements/base.in'),
Expand Down
2 changes: 1 addition & 1 deletion submissions/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
""" API for creating submissions and scores. """
__version__ = '3.6.1'
__version__ = '3.7.0'
Loading
Loading