Skip to content
Merged
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
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ jobs:
strategy:
matrix:
os: ["ubuntu-latest"]
python-version: ['3.8', '3.11']
python-version: ['3.11', '3.12']
toxenv: [django42]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: setup python
uses: actions/setup-python@v3
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/pypi-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: setup python
uses: actions/setup-python@v3
uses: actions/setup-python@v5
with:
python-version: 3.8
python-version: 3.12

- name: Install pip
run: pip install pip
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
django-require changelog
========================

3.0.0 - 22/04/2025
-------------------

* Added support for python 3.12. Dropped support for python 3.8.

2.2.0 - 09/04/2024
-------------------

Expand Down
2 changes: 1 addition & 1 deletion require/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
"""


__version__ = (2, 2, 0)
__version__ = (3, 0, 0)
8 changes: 6 additions & 2 deletions require/environments.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import unicode_literals

from distutils.spawn import find_executable
from shutil import which

from django.utils.functional import cached_property

Expand Down Expand Up @@ -35,6 +35,10 @@ def args(self):
# Start of the command to run the compiler in Java.
return [
"java",
# The `--add-exports` flag lets Rhino access Java’s internal
# `sun.nio.ch` package, which is restricted by default in
# Java 9+. Without it, file operations in Rhino fail.
"--add-exports", "java.base/sun.nio.ch=ALL-UNNAMED",
Copy link

Choose a reason for hiding this comment

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

Why did this need to be added? Can you add a comment?

Copy link
Member Author

@ttqureshi ttqureshi May 22, 2025

Choose a reason for hiding this comment

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

@feanil
before making this change, I was getting the following error:

class org.mozilla.javascript.MemberBox cannot access class sun.nio.ch.FileChannelImpl 
(in module java.base) because module java.base does not export sun.nio.ch to unnamed module

The --add-exports flag allows Rhino to access Java’s internal sun.nio.ch package, which is restricted by default in Java 9+ due to the module system. Without it, Rhino fails when trying to perform file operations.

Copy link

Choose a reason for hiding this comment

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

Makes sense, please add this as a comment in the file above this line so we can have it as reference if anyone asks the same question in the future.

"-Xss100M",
"-classpath",
":".join((
Expand All @@ -54,7 +58,7 @@ def environment(self):
for environment in self.environments:
environment = environment(self.env)
executable = environment.args()[0]
if find_executable(executable):
if which(executable):
return environment

raise EnvironmentError("no environments detected: {envs}".format(
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Internet :: WWW/HTTP",
],
)
4 changes: 1 addition & 3 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
[tox]
envlist =
py{38, 311}-django{42}
py{311, 312}-django{42}

[testenv]
changedir = {envtmpdir}
basepython =
py38: python3.8
commands =
coverage run --rcfile={toxinidir}/.coveragerc {toxinidir}/test_project/manage.py test --settings=test_project.settings require -v 2
deps =
Expand Down