Skip to content

Commit 2f6772d

Browse files
fix: pin cssselect and parsel versions
Newer Parsel releases need to know the lxml version (https://github.com/scrapy/parsel/blob/master/parsel/selector.py#L35), which is not exposed by Open edX-flavoured etree. The older version of Parsel uses the cssselect version that does not expose `_unicode_safe_getattr`, so we had to pin this one, too.
1 parent 230abb7 commit 2f6772d

File tree

4 files changed

+32
-15
lines changed

4 files changed

+32
-15
lines changed

image_explorer/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@
2222
"""
2323
from .image_explorer import ImageExplorerBlock
2424

25-
__version__ = '3.0.1'
25+
__version__ = '3.0.2'

requirements/base.txt

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@ botocore==1.38.8
1414
# via
1515
# boto3
1616
# s3transfer
17-
cssselect==1.3.0
18-
# via parsel
17+
cssselect==1.2.0
18+
# via
19+
# -c requirements/constraints.txt
20+
# parsel
1921
django==4.2.20
2022
# via
2123
# -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt
@@ -31,7 +33,6 @@ jmespath==1.0.1
3133
# via
3234
# boto3
3335
# botocore
34-
# parsel
3536
lazy==1.6
3637
# via xblock
3738
lxml==5.4.0
@@ -46,10 +47,10 @@ markupsafe==3.0.2
4647
# xblock
4748
openedx-django-pyfs==3.7.0
4849
# via xblock
49-
packaging==25.0
50-
# via parsel
51-
parsel==1.10.0
52-
# via -r requirements/base.in
50+
parsel==1.6.0
51+
# via
52+
# -c requirements/constraints.txt
53+
# -r requirements/base.in
5354
python-dateutil==2.9.0.post0
5455
# via
5556
# botocore
@@ -66,6 +67,7 @@ six==1.17.0
6667
# via
6768
# fs
6869
# fs-s3fs
70+
# parsel
6971
# python-dateutil
7072
sqlparse==0.5.3
7173
# via django

requirements/constraints.txt

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,19 @@
1010

1111
# Common constraints for edx repos
1212
-c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt
13-
13+
#
14+
# Parsel needs to know the lxml version https://github.com/scrapy/parsel/blob/master/parsel/selector.py#L35.
15+
# Since this information was not being passed and etree flavor of openedx doesn't open version for outside
16+
# we had to pin parsel which doesn't have this code branch.
17+
#
18+
# And this version of parsel has cssselect which doesn't expose
19+
# '_unicode_safe_getattr' hence we had to pin cssselect to the required version.
20+
#
21+
# This issue has been explained in https://github.com/openedx/xblock-image-explorer/pull/195#issuecomment-2844971682
22+
#
23+
# This can be removed once we resolve
24+
# https://github.com/openedx/xblock-image-explorer/issues/197#issue-3048741312,
25+
# one of the ways to do is to remove the dependency on Parsel as explained in
26+
# https://github.com/openedx/xblock-image-explorer/pull/195#pullrequestreview-2808751843
27+
parsel==v1.6
28+
cssselect==v1.2

requirements/test.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,9 @@ cookiecutter==2.6.0
4949
# via xblock-sdk
5050
coverage[toml]==7.8.0
5151
# via pytest-cov
52-
cssselect==1.3.0
52+
cssselect==1.2.0
5353
# via
54+
# -c requirements/constraints.txt
5455
# -r requirements/base.txt
5556
# parsel
5657
dill==0.4.0
@@ -88,7 +89,6 @@ jmespath==1.0.1
8889
# -r requirements/base.txt
8990
# boto3
9091
# botocore
91-
# parsel
9292
lazy==1.6
9393
# via
9494
# -r requirements/base.txt
@@ -122,12 +122,11 @@ openedx-django-pyfs==3.7.0
122122
# -r requirements/base.txt
123123
# xblock
124124
packaging==25.0
125+
# via pytest
126+
parsel==1.6.0
125127
# via
128+
# -c requirements/constraints.txt
126129
# -r requirements/base.txt
127-
# parsel
128-
# pytest
129-
parsel==1.10.0
130-
# via -r requirements/base.txt
131130
pbr==6.1.1
132131
# via stevedore
133132
platformdirs==4.3.7
@@ -203,6 +202,7 @@ six==1.17.0
203202
# edx-lint
204203
# fs
205204
# fs-s3fs
205+
# parsel
206206
# python-dateutil
207207
sqlparse==0.5.3
208208
# via

0 commit comments

Comments
 (0)