Skip to content

Drop support for Python < 3.8 and remove CircleCI#177

Merged
nsaje merged 13 commits intomasterfrom
copilot/drop-python-support-below-3-8
Feb 10, 2026
Merged

Drop support for Python < 3.8 and remove CircleCI#177
nsaje merged 13 commits intomasterfrom
copilot/drop-python-support-below-3-8

Conversation

Copy link
Contributor

Copilot AI commented Jan 23, 2026

What are you trying to accomplish?

Addresses three unresolved review comments from thomasst and movermeyer on PR #177:

  1. Remove unused PY_VERSION_AT_LEAST_38 macro
  2. Simplify SUPPORTS_37_TIMEZONE_API macro definition
  3. Document migration path for users requiring Python < 3.8 support

What approach did you choose and why?

C code cleanup (module.c)

  • Removed PY_VERSION_AT_LEAST_38 macro - confirmed unused via grep across codebase
  • Replaced conditional #ifdef PYPY_VERSION block with single-line macro using thomasst's suggested syntax:
    #define SUPPORTS_37_TIMEZONE_API \
        (!defined(PYPY_VERSION) || PYPY_VERSION_NUM >= 0x07030600)
    More concise and eliminates unnecessary branching.

Documentation (why_ciso8601.md)

  • Added "Do you need to support Python < 3.8?" section pointing to ciso8601 v2.x
  • Updated decision flowchart with new branch for v2.x option
  • Assumes v3.x will be the release with Python 3.8+ requirement

What should reviewers focus on?

  • Verify the simplified SUPPORTS_37_TIMEZONE_API macro logic is equivalent to the original
  • Confirm v2.x documentation approach aligns with release strategy

The impact of these changes

No functional changes. Improves code maintainability and provides clear upgrade/downgrade path for users.

Testing

  • Built package successfully
  • All 43 tests pass
  • clang-format compliance verified

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: nsaje <156006+nsaje@users.noreply.github.com>
Copilot AI changed the title [WIP] Remove support for Python versions below 3.8 and CircleCI build Drop support for Python < 3.8 and remove CircleCI Jan 23, 2026
Copilot AI requested a review from nsaje January 23, 2026 09:59
@nsaje
Copy link
Contributor

nsaje commented Jan 23, 2026

Follow-up to #170 (review) .

Dropping just the versions that can only be tested on CircleCI for now.

Should we remove 3.8 and 3.9 as well since they're EOL?

@nsaje nsaje marked this pull request as ready for review January 23, 2026 12:34
@nsaje

This comment was marked as resolved.

Co-authored-by: nsaje <156006+nsaje@users.noreply.github.com>

This comment was marked as resolved.

Co-authored-by: nsaje <156006+nsaje@users.noreply.github.com>
@thomasst
Copy link
Member

This looks good, but if we are actually dropping support for those versions we should also drop checks for PY_VERSION_AT_LEAST_*, PY_MAJOR_VERSION etc. in the C modules.

Should we remove 3.8 and 3.9 as well since they're EOL?

Yes, but it can still wait. By dropping < 3.8 we should be able to drop all the version conditionals already, so it doesn't give us much (and I suspect some users might use ciso8601 specifically with older Python versions that don't have fast date parsing builtins).

@movermeyer
Copy link
Collaborator

We should also update https://github.com/closeio/ciso8601/blob/master/why_ciso8601.md

(Aside: it seems that the Mermaid rendering broke in some way?)

@nsaje

This comment was marked as resolved.

Copilot AI and others added 2 commits January 27, 2026 07:34
…1.md

Co-authored-by: nsaje <156006+nsaje@users.noreply.github.com>
Co-authored-by: nsaje <156006+nsaje@users.noreply.github.com>

This comment was marked as resolved.

Co-authored-by: nsaje <156006+nsaje@users.noreply.github.com>
@nsaje

This comment was marked as resolved.

Co-authored-by: nsaje <156006+nsaje@users.noreply.github.com>
Co-authored-by: nsaje <156006+nsaje@users.noreply.github.com>
Co-authored-by: nsaje <156006+nsaje@users.noreply.github.com>
Co-authored-by: nsaje <156006+nsaje@users.noreply.github.com>
@nsaje
Copy link
Contributor

nsaje commented Jan 27, 2026

(Aside: it seems that the Mermaid rendering broke in some way?)

@movermeyer updated the why_ciso8601.md. Renders normally for me both on main and on this branch 🤔

@thomasst removed outdated C macros

module.c Outdated
((PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 6) || PY_MAJOR_VERSION > 3)
#define PY_VERSION_AT_LEAST_37 \
((PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 7) || PY_MAJOR_VERSION > 3)
#define PY_VERSION_AT_LEAST_38 \
Copy link
Member

Choose a reason for hiding this comment

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

We can drop this also.

module.c Outdated
#ifdef PYPY_VERSION
#define SUPPORTS_37_TIMEZONE_API \
(PYPY_VERSION_NUM >= 0x07030600) && PY_VERSION_AT_LEAST_38
#define SUPPORTS_37_TIMEZONE_API (PYPY_VERSION_NUM >= 0x07030600)
Copy link
Member

Choose a reason for hiding this comment

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

Also possible:

#define SUPPORTS_37_TIMEZONE_API \
    (!defined(PYPY_VERSION) || PYPY_VERSION_NUM >= 0x07030600)

@movermeyer
Copy link
Collaborator

Renders normally for me both on main and on this branch 🤔

My apologies. It works fine. I had reset my JavaScript allow lists, and apparently Mermaid diagram rendering JS is hosted from a different domain than the rest of GitHub 🙈

A--yes-->Y;
A--no-->C;

C[Do you need to support Python 2.7?];
Copy link
Collaborator

@movermeyer movermeyer Jan 28, 2026

Choose a reason for hiding this comment

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

Another option to consider is to point to ciso8601 v2.x (with the assumption that we'll do a v3.x release for these changes).

- Remove unused PY_VERSION_AT_LEAST_38 macro (thomasst)
- Simplify SUPPORTS_37_TIMEZONE_API macro using suggested syntax (thomasst)
- Add section for Python < 3.8 support pointing to v2.x (movermeyer)
- Update flowchart to include v2.x option for older Python versions

Co-authored-by: nsaje <156006+nsaje@users.noreply.github.com>
Copilot AI changed the title Drop support for Python < 3.8 and remove CircleCI Address code review feedback: cleanup unused macros and add v2.x migration docs Jan 29, 2026
@nsaje nsaje requested a review from movermeyer January 29, 2026 10:24
@nsaje nsaje changed the title Address code review feedback: cleanup unused macros and add v2.x migration docs Drop support for Python < 3.8 and remove CircleCI Jan 29, 2026
@nsaje nsaje merged commit ee5acb8 into master Feb 10, 2026
13 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants