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

Port examples #6210

Merged
merged 1 commit into from
Jul 21, 2018
Merged

Port examples #6210

merged 1 commit into from
Jul 21, 2018

Conversation

Eric-Arellano
Copy link
Contributor

Part of #6062

This folder was unlike any we've worked with. Because it's a dist, you aren't allowed to include future as a 3rd party library. So we unfortunately can't use the backports.

I also couldn't find tests for the particular folder

cc @CMLivingston if you could help review please.

@@ -8,8 +8,8 @@
from distutils.core import Extension


c_module = Extension(str('c_greet'), sources=[str('c_greet.c')])
cpp_module = Extension(str('cpp_greet'), sources=[str('cpp_greet.cpp')])
c_module = Extension(b'c_greet', sources=[b'c_greet.c'])
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm assuming the call to str() around string literals was to convert into byte strings, because from __future__ import unicode_literals is toggled on? If not, and unicode works, we can remove both b prefix and str().

@@ -14,7 +14,7 @@
# This is for testing purposes so we can assert that setup_requires is functioning
# correctly (because Pants swallows print statements).
if os.getenv('PANTS_TEST_SETUP_REQUIRES', ''):
output = [str(pycountry)]
output = [bytes(pycountry)]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Assuming similar logic here that you want bytes instead of unicode?

If you want unicode, I don't know of a Py2 Py3 compatible way of specifying we want unicode because we can't import six or future. unicode() is only supported in Py2.

Copy link
Member

@stuhood stuhood left a comment

Choose a reason for hiding this comment

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

Works for me.

@CMLivingston : PTAL.

Copy link
Contributor

@CMLivingston CMLivingston left a comment

Choose a reason for hiding this comment

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

You are correct, these need to be bytes and not unicode.

@stuhood stuhood merged commit a783046 into pantsbuild:master Jul 21, 2018
@Eric-Arellano Eric-Arellano deleted the port-examples branch July 22, 2018 12:57
CMLivingston pushed a commit to CMLivingston/pants that referenced this pull request Aug 27, 2018
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.

3 participants