@@ -12,21 +12,39 @@ Modernize
12
12
Purpose of the project
13
13
======================
14
14
15
- .. TODO Explain WHY someone would want to have their code be Python 2/3 compatible
16
-
17
- This library is a very thin wrapper around ``fissix `` to utilize it
18
- to make Python 2 code more modern with the intention of eventually
19
- porting it over to Python 3.
20
-
21
- The ``python -m modernize `` command works like `fissix
22
- <https://github.com/jreese/fissix> `_. Here's how you'd rewrite a
15
+ Modernize is a Python program that reads Python 2 source code
16
+ and applies a series of fixers to transform it into source code
17
+ that is valid on both Python 3 and Python 2.7.
18
+
19
+ This allows you to run your test suite on Python 2.7 and Python 3
20
+ so you can gradually port your code to being fully Python 3
21
+ compatible without slowing down development of your Python 2
22
+ project.
23
+
24
+ The ``python -m modernize `` command works like
25
+ ``python -m fissix ``, see `fissix <https://github.com/jreese/fissix >`_.
26
+ Here's how you'd rewrite a
23
27
single file::
24
28
25
29
python -m modernize -w example.py
26
30
27
- See the ``LICENSE `` file for the license of ``python -m modernize ``.
31
+ It does not guarantee, but it attempts to spit out a codebase compatible
32
+ with Python 2.6+ or Python 3. The code that it generates has a runtime
33
+ dependency on `six <https://pypi.python.org/pypi/six >`_, unless the
34
+ ``--no-six `` option is used. Version 1.9.0 or later of ``six `` is
35
+ recommended. Some of the fixers output code that is not compatible with
36
+ Python 2.5 or lower.
37
+
38
+ Once your project is ready to run in production on Python 3 it's
39
+ recommended to drop Python 2.7 support using
40
+ `pyupgrade <https://pypi.org/project/pyupgrade/ >`_
41
+
42
+ See the ``LICENSE `` file for the license of ``modernize ``.
28
43
Using this tool does not affect licensing of the modernized code.
29
44
45
+ This library is a very thin wrapper around `fissix
46
+ <https://github.com/jreese/fissix> `_, a fork of lib2to3.
47
+
30
48
The `project website `_ can be found on GitHub and the PyPI project name is
31
49
modernize _
32
50
0 commit comments