Skip to content

Commit

Permalink
Remove icalendar pin for unsupported Python 3.7.
Browse files Browse the repository at this point in the history
Update constraints scripts to not handle Python 3.7.
  • Loading branch information
mauritsvanrees committed Oct 4, 2022
1 parent 88b1eff commit fdf353b
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 25 deletions.
17 changes: 4 additions & 13 deletions release/combine-constraints.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,27 +28,23 @@ def parse_file(filename):


constraints = os.path.join(directory, "constraints.txt")
constraints37 = os.path.join(directory, "constraints37.txt")
constraints38 = os.path.join(directory, "constraints38.txt")
constraints39 = os.path.join(directory, "constraints39.txt")
constraints310 = os.path.join(directory, "constraints310.txt")
for filename in (constraints37, constraints38, constraints39, constraints310):
for filename in (constraints38, constraints39, constraints310):
if not os.path.exists(filename):
print(f"ERROR: {filename} does not exist.")
print(
"Run: tox -p auto -e constraints2,constraints37,constraints38,constraints39,constraints310,constraints"
"Run: tox -p auto -e constraints2,constraints38,constraints39,constraints310,constraints"
)
sys.exit(1)

c37 = parse_file(constraints37)
c38 = parse_file(constraints38)
c39 = parse_file(constraints39)
c310 = parse_file(constraints310)

# Gather them all in one dictionary.
pins = defaultdict(dict)
for package, version in c37.items():
pins[package][37] = version
for package, version in c38.items():
pins[package][38] = version
for package, version in c39.items():
Expand All @@ -59,20 +55,15 @@ def parse_file(filename):
# Combine them.
combi = []
for package, versions in pins.items():
py37_version = versions.pop(37, None)
py38_version = versions.pop(38, None)
py39_version = versions.pop(39, None)
py310_version = versions.pop(310, None)
if py37_version == py38_version == py39_version == py310_version:
if py38_version == py39_version == py310_version:
# All versions are the same.
combi.append(f"{package}=={py37_version}")
combi.append(f"{package}=={py310_version}")
continue
# Some versions are different or missing.
# Start with the lowest Python.
if py37_version is not None:
combi.append(f'{package}=={py37_version}; python_version == "3.7"')
if not (py38_version or py39_version or py310_version):
continue
if py38_version == py39_version == py310_version:
# All higher Python versions are the same.
combi.append(f'{package}=={py38_version}; python_version >= "3.8"')
Expand Down
3 changes: 1 addition & 2 deletions release/constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,7 @@ gunicorn==20.1.0
h11==0.13.0
httplib2==0.20.4
i18ndude==5.5.0
icalendar==4.1.0; python_version == "3.7"
icalendar==5.0.0a1; python_version >= "3.8"
icalendar==5.0.0a1
idna==3.3
imagesize==1.3.0
importlib-metadata==4.12.0
Expand Down
7 changes: 1 addition & 6 deletions release/tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
[tox]
envlist =
constraints37,
constraints38,
constraints39,
constraints310,
Expand All @@ -12,10 +11,6 @@ basepython = python3
skip_install = true
commands_pre = python -m pip install -r {toxinidir}/../requirements.txt

[testenv:constraints37]
basepython = python3.7
commands = python create-constraints.py {toxinidir}/../ecosystem.cfg {toxinidir}/constraints37.txt

[testenv:constraints38]
basepython = python3.8
commands = python create-constraints.py {toxinidir}/../ecosystem.cfg {toxinidir}/constraints38.txt
Expand All @@ -31,7 +26,7 @@ commands = python create-constraints.py {toxinidir}/../ecosystem.cfg {toxinidir}
[testenv:constraints]
basepython = python3
# Specifying other tox envs as dependencies helps when running in parallel.
depends = constraints37, constraints38, constraints39, constraints310
depends = constraints38, constraints39, constraints310
commands_pre =
commands = python combine-constraints.py {toxinidir}

Expand Down
1 change: 0 additions & 1 deletion sources.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ five.customerize = git ${remotes:zope}/five.customerize.git p
five.intid = git ${remotes:plone}/five.intid.git pushurl=${remotes:plone_push}/five.intid.git branch=master
five.pt = git ${remotes:zope}/five.pt.git pushurl=${remotes:zope_push}/five.pt.git branch=master
i18ndude = git ${remotes:collective}/i18ndude.git pushurl=${remotes:collective_push}/i18ndude.git branch=master
# Note: on Python 3.7 you should use icalendar branch 4.x.
icalendar = git ${remotes:collective}/icalendar.git pushurl=${remotes:collective_push}/icalendar.git branch=master
Plone = git ${remotes:plone}/Plone.git pushurl=${remotes:plone_push}/Plone.git branch=master
plone.alterego = git ${remotes:plone}/plone.alterego.git pushurl=${remotes:plone_push}/plone.alterego.git branch=master
Expand Down
3 changes: 0 additions & 3 deletions versions.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,6 @@ wsproto = 1.1.0
wrapt = 1.14.1
zipp = 3.8.1

[versions:python37]
icalendar = 4.1.0

[versionannotations]
# keep this alphabetical please
prompt-toolkit =
Expand Down

0 comments on commit fdf353b

Please sign in to comment.