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

ci: add multiple test targets #159

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 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
7 changes: 5 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,16 @@ on:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]

steps:
- uses: actions/checkout@v4
- name: Set up Python 3.9
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: '3.9'
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
author = "Martin Eigenmann"

# The full version, including alpha/beta/rc tags
release = "0.2.0"
release = "0.2.1"


# -- General configuration ---------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "icalevents"
version = "0.2.0"
version = "0.2.1"
description = "Simple Python 3 library to download, parse and query iCal sources."
authors = [
{ name = "Martin Eigenmann", email = "[email protected]" },
Expand All @@ -12,8 +12,8 @@ license = "MIT"
requires-python = ">=3.9"

dependencies = [
"icalendar (~=6.0)",
"python-dateutil (~=2.9)",
"icalendar (>=5.0.3)",
Copy link
Contributor

@DerDreschner DerDreschner Jan 17, 2025

Choose a reason for hiding this comment

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

That doesn't work. icalendar 6.0 had a breaking change when using the internal WINDOWS_TO_OLSON map (change of namespace) and use_pytz() needs to be used for the old behaviour as they changed the default timezone database. The latter may be not needed - I didn't tested icalevents with the new default to be honest. But I didn't want to take any risk here. See #145. It must be >=5.0.3,<6.0 here if you revert the changes from #145, but then it will not work for people who need the newest icalendar release.

I'm not that confident with Python, but I guess it's not possible to wrap the code lines in any if clause, depending on the used dependency version?

Copy link
Contributor

Choose a reason for hiding this comment

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

Okay, after doing some research, it may be possible. This Stack Overflow answer - together with the discussion here - would result in something like

from importlib.metadata import version

if version("icalendar") >= "6.0":
    from icalendar import use_pytz
    from icalendar.timezone.windows_to_olson import WINDOWS_TO_OLSON

    use_pytz()
else:
    from icalendar.windows_to_olson import WINDOWS_TO_OLSON

as solution. But the question is how we would test everything with both versions in the pipelines? 🤔 I can only think about two new steps using hard-coded installation actions for icalendar?

Copy link
Member

@andrewgy8 andrewgy8 Jan 19, 2025

Choose a reason for hiding this comment

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

Yep, this would be the proper work around @DerDreschner .

But the question is how we would test everything with both versions in the pipelines?

Typically you use a testing matrix which allows different versions of dependencies and python versions, like the above workflow. However, you can also add into the matrix the versions of icalendar that you would like to see tested. In this case, <6.0 and >6.0. Here is an example that uses Django in that regard and should be straightforward to add in this PR.

"python-dateutil (>=2.9)",
Copy link
Contributor

Choose a reason for hiding this comment

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

I would be interested to learn what the problem with ~= is in this case. 😄

"pytz (>=2024.2)",
"urllib3 (>=1.26.5)",
]
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
from setuptools import setup

version = "0.2.0"
version = "0.2.1"

setup(
name="icalevents",
Expand Down
Loading