Skip to content

Commit 1b06d66

Browse files
authored
Merge pull request #241 from graingert/purpose
2 parents cadb8cd + c5a1665 commit 1b06d66

File tree

2 files changed

+42
-13
lines changed

2 files changed

+42
-13
lines changed

README.rst

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,14 @@
1919
:alt: PyPI
2020
:target: https://pypi.org/project/modernize/
2121

22-
This library is a very thin wrapper around `fissix
23-
<https://github.com/jreese/fissix>`_, a fork of lib2to3, to utilize it
24-
to make Python 2 code more modern with the intention of eventually
25-
porting it over to Python 3.
22+
Modernize is a Python program that reads Python 2 source code
23+
and applies a series of fixers to transform it into source code
24+
that is valid on both Python 3 and Python 2.7.
25+
26+
This allows you to run your test suite on Python 2.7 and Python 3
27+
so you can gradually port your code to being fully Python 3
28+
compatible without slowing down development of your Python 2
29+
project.
2630

2731
The ``python -m modernize`` command works like
2832
``python -m fissix``, see `fissix <https://github.com/jreese/fissix>`_.
@@ -38,8 +42,15 @@ dependency on `six <https://pypi.python.org/pypi/six>`_, unless the
3842
recommended. Some of the fixers output code that is not compatible with
3943
Python 2.5 or lower.
4044

45+
Once your project is ready to run in production on Python 3 it's
46+
recommended to drop Python 2.7 support using
47+
`pyupgrade <https://pypi.org/project/pyupgrade/>`_
48+
4149
**Documentation:** `modernize.readthedocs.io
4250
<https://modernize.readthedocs.io/>`_.
4351

4452
See the ``LICENSE`` file for the license of ``modernize``.
4553
Using this tool does not affect licensing of the modernized code.
54+
55+
This library is a very thin wrapper around `fissix
56+
<https://github.com/jreese/fissix>`_, a fork of lib2to3.

docs/index.rst

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,39 @@ Modernize
1212
Purpose of the project
1313
======================
1414

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
2327
single file::
2428

2529
python -m modernize -w example.py
2630

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``.
2843
Using this tool does not affect licensing of the modernized code.
2944

45+
This library is a very thin wrapper around `fissix
46+
<https://github.com/jreese/fissix>`_, a fork of lib2to3.
47+
3048
The `project website`_ can be found on GitHub and the PyPI project name is
3149
modernize_
3250

0 commit comments

Comments
 (0)