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

Drop python3.6 and remove the usage of OrderedDict #1783

Merged
merged 2 commits into from Jan 20, 2022

Conversation

MVrachev
Copy link
Collaborator

@MVrachev MVrachev commented Jan 19, 2022

Description of the changes being introduced by the pull request:

Python version 3.6 was supported until December 23-rd 2021 meaning its
end of life has expired more than 20 days. See https://endoflife.date/python.
Dropping support for python version 3.6 will allow us to remove
OrderedDicts.

After a quick check I saw that Warehouse target python version 3.8.2:

This means it shouldn't cause headache to our users if we drop python
version 3.6 too.

In all versions, python3.7+ dictionaries preserve the insertion order.
This means we can replace the usage of OrderedDict with a standard dictionary.

Something we have to keep in mind is that even though the insertion order is preserved
the equality comparison for normal dicts is insensitive for normal dicts compared to OrderedDict

For example:

>>> OrderedDict([(1,1), (2,2)]) == OrderedDict([(2,2), (1,1)])
False
>>> dict([(1,1), (2,2)]) == dict([(2,2), (1,1)])
True

Python version 3.6 was supported until December 23-rd 2021 meaning its
end of life has expired before more than 20 days.
Dropping support for python version 3.6 will allow us to remove
OrderedDicts.

After a quick check I saw that Warehouse target python version 3.8.2:
- their docker file: https://github.com/pypa/warehouse/blob/main/Dockerfile#L47
- https://github.com/pypa/warehouse/blob/main/.python-version
- last pr updating pr version: pypi/warehouse#7828
Pip supports python version 3.7+ as well. They dropped python 3.6 a
couple of months ago:
pypa/pip#10641

This means it shouldn't cause headache to our users if we drop python
version 3.6 too.

Signed-off-by: Martin Vrachev <mvrachev@vmware.com>
After we drop support for python3.6 we can relly that dictionaries
preserve the insertion order:
https://docs.python.org/3.7/whatsnew/3.7.html

This means we can replace the usage of OrderedDict with a standard
dictionaries.

Something we have to keep in mind is that even thought the insertion
order is preserved the equality comparison for normal dicts is
insensitive for normal dicts compared to OrderedDict

For example:
>>> OrderedDict([(1,1), (2,2)]) == OrderedDict([(2,2), (1,1)])
False
>>> dict([(1,1), (2,2)]) == dict([(2,2), (1,1)])
True

Signed-off-by: Martin Vrachev <mvrachev@vmware.com>
@coveralls
Copy link

Pull Request Test Coverage Report for Build 1719080679

  • 3 of 3 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.001%) to 97.687%

Totals Coverage Status
Change from base Build 1717351178: -0.001%
Covered Lines: 4095
Relevant Lines: 4176

💛 - Coveralls

@MVrachev
Copy link
Collaborator Author

Honestly, I am not sure why the CI started testing with python 3.6 when I removed it from .github/workflows/ci.yml...

@jku
Copy link
Member

jku commented Jan 20, 2022

not sure why the CI started testing with python 3.6 when I removed it from .github/workflows/ci.yml

It didn't: The UI does not make it very clear but current project settings define those tests as required for merge -- so this PR stays blocked because required tests haven't executed.

@lukpueh
Copy link
Member

lukpueh commented Jan 20, 2022

not sure why the CI started testing with python 3.6 when I removed it from .github/workflows/ci.yml

It didn't: The UI does not make it very clear but current project settings define those tests as required for merge -- so this PR stays blocked because required tests haven't executed.

Seems like a good use case for my administrative super powers. 🦸

@lukpueh lukpueh merged commit b2704a5 into theupdateframework:develop Jan 20, 2022
MVrachev added a commit to MVrachev/securesystemslib that referenced this pull request Jan 27, 2022
Python version 3.6 was supported until December 23-rd 2021
(see https://endoflife.date/python) meaning its end of life has expired
before more than 20 days.
Dropping support for python version 3.6 will allow us to make some
small cleanups.

python-tuf dropped support for python3.6 as well:
theupdateframework/python-tuf#1783

Signed-off-by: Martin Vrachev <mvrachev@vmware.com>
@MVrachev MVrachev deleted the drop-python3.6 branch January 27, 2022 13:33
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.

None yet

4 participants