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

Straddle Python 2.6, 2.7, 3.3, and 3.4 #166

Merged
merged 19 commits into from Aug 22, 2015

Conversation

tseaver
Copy link
Contributor

@tseaver tseaver commented Jan 13, 2015

Uses #161, #162, #163, #164, and #165 as diff base.

Tests for all four supported Python versions run under tox, without the need for 2to3.

- Move human-centric metadata to top of 'setup()' call.

- Add Trove classifiers for supported Python versions.

- Use 'find_packages()' + MANIFEST.in to avoid errors in listing modules
  and packages.
- Remove PY25 cruft.

- Selectively apply cleanups from 'python-modernize':

  - New exception syntax.
  - Use 'six' to handle module renames.
  - Use 'six' to handle text / binary stuff.

This PR covers most of the work from #66 which falls inside `python`
(rather than the Python code generation stuff in 'src').
Use stdlib's 'unittest' instead.
Conflicts:
	python/google/protobuf/internal/message_factory_test.py
	python/google/protobuf/internal/reflection_test.py
	python/google/protobuf/internal/text_format_test.py
@liujisi
Copy link
Contributor

liujisi commented Feb 23, 2015

@haberman

@haberman
Copy link
Member

Hi Tres,

Thanks a lot for doing all this work. I inherited maintenance of the protobuf-Python code at Google several months ago, and these changes represent a lot of the direction we want to move in (better Python 3 support, dropping google-apputils dependency, improving setup.py and integration with standard Python packaging).

Unfortunately -- and I'm really sorry about this -- I think there are some problems that will prevent us from being able to merge these changes right now:

  1. I think there was an miscommunication earlier when Update python version / setuptools instructions #143 was merged. We are unfortunately not at liberty to drop Python 2.5 support at this time, because Google AppEngine is committed to supporting Python 2.5 until at least next month, and possibly longer. We may want to drop official 2.5 support for open-source users, but as we use one single code-base for both open-source and internal use (such as AppEngine), we unfortunately must keep the source Python 2.5-compatible for the time being. I'll make this more clear in the Python README.
  2. As far as dropping google-apputils as a dependency (and using unittest) instead: in the internal branch of python Protobuf, the code has started using a feature that doesn't seem to exist in unittest: the ability to parameterize a test, ie. run a whole suite multiple times while varying one parameter. Sample code looks like this:
@parameterized.Parameters(
    (unittest_pb2),
    (unittest_proto3_arena_pb2))
class MessageTest(googletest.TestCase):

  def testExtremeFloatValues(self, message_module):
    message = message_module.TestAllTypes()
    # etc.

I will merge our internal changes back to GitHub as soon as I can, though it might be a couple weeks. Hopefully at that point we can find a way to merge with your changes.

Thanks,
Josh

@haberman
Copy link
Member

haberman commented Jul 9, 2015

Wanted to ping this PR -- we're now free to drop Python 2.5 compat! Don't know if you saw.

If you're willing to bring this PR up to date, I'm really interested in merging Python 3 support now that we don't need 2.5.

@tseaver
Copy link
Contributor Author

tseaver commented Jul 10, 2015

@haberman ATM, my itch is scratched by 3.0.0a1, which supports Python 2.6, 2.7, and 3.4. I still believe that straddling is superior to '2to3', but don't have cycles to update this patch.

@Kentzo
Copy link

Kentzo commented Jul 29, 2015

@haberman What work is required to bring that PR up to date? Do you have some tasks in mind?

@haberman
Copy link
Member

The PR currently doesn't merge cleanly, because it's fallen out of date with the tree. Bringing it up to date so it merges cleanly (and the tests pass) would be a good start.

@jleclanche
Copy link

Commits e17f78b and 58dbea9 can be dropped entirely. There's more conflicts further down...

@haberman haberman merged commit daeaa6a into protocolbuffers:master Aug 22, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants