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

Fix 520 drop python2 #564

Closed
wants to merge 19 commits into from
Closed

Fix 520 drop python2 #564

wants to merge 19 commits into from

Conversation

g-k
Copy link
Collaborator

@g-k g-k commented Nov 5, 2020

Fix #520

Changes:

  • update CI and tox configs
  • update package setup.py metadata and CHANGES
  • replace six in non-vendored code

This doesn't:

  • drop six since html5lib needs it
  • add type annotations (TODO: later, but we can use the non-comment syntax now)
  • change code to take advantage of Python 3 features
  • land any other changes planned for the 4.x milestone (thinking add those as time permits and increment the major version number)

I'm planning to squash everything down into 1 to 3 commits if it looks OK.

f? @willkg

@willkg
Copy link
Member

willkg commented Nov 5, 2020

A 4.x milestone. That's phenomenal!

I'll try to review for feedback this tomorrow. If there's anything you want me to pay particular attention to, let me know.

@g-k g-k marked this pull request as ready for review November 5, 2020 21:14
# x.y.z or x.y.z.dev0 -- semver
__version__ = "3.2.1"
__version__ = "4.0.0.dev0"
Copy link
Collaborator Author

@g-k g-k Nov 5, 2020

Choose a reason for hiding this comment

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

should we release an alpha/beta/rc first?

Copy link
Member

Choose a reason for hiding this comment

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

I think the nicety of an alpha/beta/rc comes only when you've got people lined up to use/test it that are representative of Bleach users. If you don't, then you spend a bunch of time doing the alpha/beta/rc, wait a bunch of time, and then it's not clear whether that extra effort bought you anything or reduced the chances of a follow-up fixit release.

In the past, I've kept tabs on bugs and done follow-up fixit releases. I can usually do that pretty quickly.

If it were me, I'd release on a Monday with a few following days that I could turn around a fixit release and not go the alpha/beta/rc route.

raise TypeError("argument must be of text type")

text = force_unicode(text)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

force_unicode checks text it coerces is valid utf-8, but the encoding arg for str uses sys.getdefaultencoding so maybe we should validate that.

Copy link
Member

Choose a reason for hiding this comment

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

Oh, interesting! Nice catch!

Copy link
Member

Choose a reason for hiding this comment

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

I don't think we need to worry about this. If the text value isn't a str, then we don't need to decode it so we don't need to validate encodings.

I think what you did is right and all we need to do is remove the force_unicode call.

@g-k
Copy link
Collaborator Author

g-k commented Nov 5, 2020

Awesome! No rush on the taking a look. There's a lot going on.

Left a couple comments on things I wasn't sure of.

I don't think I did anything crazy (mainly swapping six. variants for the Python 3 specific replacement), but if you can sanity check that I didn't miss anything that'd be good.

@@ -45,7 +45,7 @@ def get_version():
include_package_data=True,
package_data={'': ['README.rst']},
zip_safe=False,
python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*',
Copy link
Member

Choose a reason for hiding this comment

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

Yay!

@willkg
Copy link
Member

willkg commented Nov 6, 2020

This looked fine to me. I didn't look at the code that's not covered in this PR, but it's probably fine and if there are other things we could clean up post-dropping-Python-2, we can do them later.

@g-k g-k mentioned this pull request Jan 22, 2021
@g-k g-k closed this Jan 22, 2021
@g-k g-k deleted the fix-520-drop-python2 branch January 22, 2021 22:02
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.

Drop support for EOL Python versions <3.6
2 participants