Skip to content

Commit

Permalink
fix: install backports-zoneinfo only for python<3.9
Browse files Browse the repository at this point in the history
  • Loading branch information
UsamaSadiq committed Mar 6, 2024
1 parent 5cdc10b commit 159a53d
Show file tree
Hide file tree
Showing 14 changed files with 74 additions and 25 deletions.
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ 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
pip-compile --allow-unsafe --rebuild --upgrade -o requirements/pip.txt requirements/pip.in
pip-compile --upgrade -o requirements/pip-tools.txt requirements/pip-tools.in
pip-compile --allow-unsafe --upgrade -o requirements/pip-tools.txt requirements/pip-tools.in
pip install -qr requirements/pip.txt
pip install -qr requirements/pip-tools.txt
pip-compile --rebuild --upgrade -o requirements/dev.txt requirements/base.in requirements/dev.in requirements/quality.in
pip-compile --rebuild --upgrade -o requirements/doc.txt requirements/base.in requirements/doc.in
pip-compile --rebuild --upgrade -o requirements/quality.txt requirements/quality.in
pip-compile --rebuild --upgrade -o requirements/test.txt requirements/base.in requirements/test.in
pip-compile --rebuild --upgrade -o requirements/ci.txt requirements/ci.in
pip-compile --allow-unsafe --rebuild --upgrade -o requirements/dev.txt requirements/base.in requirements/dev.in requirements/quality.in
pip-compile --allow-unsafe --rebuild --upgrade -o requirements/doc.txt requirements/base.in requirements/doc.in
pip-compile --allow-unsafe --rebuild --upgrade -o requirements/quality.txt requirements/quality.in
pip-compile --allow-unsafe --rebuild --upgrade -o requirements/test.txt requirements/base.in requirements/test.in
pip-compile --allow-unsafe --rebuild --upgrade -o requirements/ci.txt requirements/ci.in
# Let tox control the Django version for tests
sed '/^django==/d' requirements/test.txt > requirements/test.tmp
mv requirements/test.tmp requirements/test.txt
Expand Down
1 change: 1 addition & 0 deletions requirements/base.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ attrs>=17.2.0 # Attributes without boilerplate
sailthru-client==2.2.3
six
stevedore>=1.10.0
setuptools
6 changes: 4 additions & 2 deletions requirements/ci.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ tomli==2.0.1
# via
# pyproject-api
# tox
tox==4.14.0
# via -r requirements/ci.in
tox==4.13.0
# via
# -c requirements/constraints.txt
# -r requirements/ci.in
virtualenv==20.25.1
# via tox
4 changes: 4 additions & 0 deletions requirements/constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,7 @@

# Common constraints for edx repos
-c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt

backports.zoneinfo==0.2.1; python_version<'3.9'

tox==4.13.0
4 changes: 3 additions & 1 deletion requirements/dev.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@ edx-i18n-tools # For i18n_tool dummy
pip-tools # Requirements file management
tox # virtualenv management for tests
twine # Utility for PyPI package uploads
wheel # For generation of wheels for PyPI
wheel # For generation of wheels for PyPI
backports.zoneinfo; python_version<'3.9' # Needed for Python 3.12 compatibility
setuptools
23 changes: 17 additions & 6 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,12 @@ astroid==3.1.0
# pylint-celery
attrs==23.2.0
# via -r requirements/base.in
backports-zoneinfo==0.2.1
# via django
backports-zoneinfo==0.2.1 ; python_version < "3.9"
# via
# -c requirements/constraints.txt
# -r requirements/dev.in
# -r requirements/quality.in
# django
build==1.1.1
# via pip-tools
cachetools==5.3.3
Expand Down Expand Up @@ -199,8 +203,10 @@ tomli==2.0.1
# tox
tomlkit==0.12.4
# via pylint
tox==4.14.0
# via -r requirements/dev.in
tox==4.13.0
# via
# -c requirements/constraints.txt
# -r requirements/dev.in
twine==5.0.0
# via -r requirements/dev.in
typing-extensions==4.10.0
Expand All @@ -225,5 +231,10 @@ zipp==3.17.0
# importlib-resources

# 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
# -r requirements/base.in
# -r requirements/dev.in
# pip-tools
3 changes: 3 additions & 0 deletions requirements/doc.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@ sphinx-book-theme # Common theme for all Open edX projects
readme_renderer # Validates README.rst for usage on PyPI
Sphinx # Documentation builder
twine
backports.zoneinfo; python_version<'3.9' # Needed for Python 3.12 compatibility
setuptools
wheel
15 changes: 13 additions & 2 deletions requirements/doc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,11 @@ babel==2.14.0
# via
# pydata-sphinx-theme
# sphinx
backports-zoneinfo==0.2.1
# via django
backports-zoneinfo==0.2.1 ; python_version < "3.9"
# via
# -c requirements/constraints.txt
# -r requirements/doc.in
# django
beautifulsoup4==4.12.3
# via pydata-sphinx-theme
certifi==2024.2.2
Expand Down Expand Up @@ -154,7 +157,15 @@ urllib3==2.2.1
# via
# requests
# twine
wheel==0.42.0
# via -r requirements/doc.in
zipp==3.17.0
# via
# importlib-metadata
# importlib-resources

# The following packages are considered to be unsafe in a requirements file:
setuptools==69.1.1
# via
# -r requirements/base.in
# -r requirements/doc.in
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
1 change: 1 addition & 0 deletions requirements/quality.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ edx-lint # edX pylint rules and plugins
isort # to standardize order of imports
pycodestyle # PEP 8 compliance validation
pydocstyle # PEP 257 compliance validation
backports.zoneinfo; python_version<'3.9' # Needed for Python 3.12 compatibility
4 changes: 4 additions & 0 deletions requirements/quality.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ astroid==3.1.0
# via
# pylint
# pylint-celery
backports-zoneinfo==0.2.1 ; python_version < "3.9"
# via
# -c requirements/constraints.txt
# -r requirements/quality.in
click==8.1.7
# via
# click-log
Expand Down
1 change: 1 addition & 0 deletions requirements/test.in
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ mock
pudb # For easier test debugging
hypothesis[pytz] # For property-based testing
hypothesis-pytest
backports.zoneinfo; python_version<'3.9' # Needed for Python 3.12 compatibility
11 changes: 9 additions & 2 deletions requirements/test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@ attrs==23.2.0
# via
# -r requirements/base.in
# hypothesis
backports-zoneinfo==0.2.1
# via django
backports-zoneinfo==0.2.1 ; python_version < "3.9"
# via
# -c requirements/constraints.txt
# -r requirements/test.in
# django
certifi==2024.2.2
# via requests
charset-normalizer==3.3.2
Expand Down Expand Up @@ -109,3 +112,7 @@ wcwidth==0.2.13
# via urwid
zipp==3.17.0
# via importlib-metadata

# The following packages are considered to be unsafe in a requirements file:
setuptools==69.1.1
# via -r requirements/base.in
8 changes: 4 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ envlist = py{38, 312}-django{42}, quality
[testenv]
deps =
django42: Django>=4.2,<4.3
quality: Django>=4.2,<4.3
-r{toxinidir}/requirements/test.txt
-r{toxinidir}/requirements/quality.txt
commands =
python -Wd -m pytest {posargs}

Expand All @@ -31,7 +29,10 @@ commands =
setenv =
DJANGO_SETTINGS_MODULE=test_settings
PYTHONPATH = {toxinidir}/:{toxinidir}/edx_ace
basepython = python3.8
deps =
quality: Django>=4.2,<4.3
-r{toxinidir}/requirements/test.txt
-r{toxinidir}/requirements/quality.txt
allowlist_externals =
make
rm
Expand All @@ -43,4 +44,3 @@ commands =
pycodestyle edx_ace
isort --check-only --diff edx_ace manage.py setup.py test_settings.py
make selfcheck

0 comments on commit 159a53d

Please sign in to comment.