Skip to content

Python 3.5 compatibility broken #749

Closed

Description

@clokep

I'm not sure if this was done on purpose or not, but 5cdd5c4 included changes that are not compatible with Python 3.5:

builtins.SyntaxError: invalid syntax (client.py, line 53)

I believe the comma at the end of **kwargs is invalid.

Code Version

6.4.0

Expected Behavior

6.4.0 should either work on Python 3.5 or not install on Python 3.5.

Current Behavior

Trying to use pysaml2 on Python 3.5 errors.

Possible Solution

  • Use python_requires in setup.py / setup.cfg to state that pysaml2 does not support Python 3.5.
  • Fix the syntax error so Python 3.5 can use pysaml2.

Steps to Reproduce

Using Python 3.5:

>>> from saml2.client import Saml2Client
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/clokep/.pyenv/versions/synapse-3.5/lib/python3.5/site-packages/saml2/client.py", line 53
    **kwargs,
            ^
SyntaxError: invalid syntax

Activity

  1. c00kiemon5ter commented on Dec 8, 2020

    @c00kiemon5ter
    Member

    Hello,

    when we dropped python2 support, we agreed to care about python 3.6 onwards (actually, what the latest stable Debian uses, which at the time was python 3.6 -- currently it's python 3.7) and at the same time removed any previous python markers and CI-checks (521b853). I see now that we announced that we drop support for python2 but did not actually say anything about a minimum python3 version.

    In any case, we do support python 3.6 and check for it in the CI. Python 3.5 is not supported, even though the actual compatibility issues are syntax errors because of trailing commas. Those come from the black python formatter which also supports Python 3.6 or newer and soon we will run it across the whole code base.

  2. clokep commented on Dec 8, 2020

    @clokep
    Author

    Thanks for responding! It would be nice to update the python_requires for setuptools to understand this and error when trying to install pysaml2 (instead of getting a runtime error when trying to use it).

  3. c00kiemon5ter commented on Dec 8, 2020

    @c00kiemon5ter
    Member

    b18c500 should do it ;)

    If you think something more is needed let me know, otherwise I will bump a minor version for this.

  4. clokep commented on Dec 8, 2020

    @clokep
    Author

    Thanks! I'll close #750. 👍

  5. c00kiemon5ter commented on Dec 8, 2020

    @c00kiemon5ter
    Member

    I have no idea how I missed #750

    Sorry for the duplication. I'm bumping the version with this minor fix so that people are aware.

    Thank you too 👍

  6. clokep commented on Dec 8, 2020

    @clokep
    Author

    Thank you for the quick fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions