Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/PyCQA/modernize
Modernizes Python code for eventual Python 3 migration. Built on top of fissix (a fork of lib2to3)
https://github.com/PyCQA/modernize
Last synced: about 2 months ago
JSON representation
Modernizes Python code for eventual Python 3 migration. Built on top of fissix (a fork of lib2to3)
- Host: GitHub
- URL: https://github.com/PyCQA/modernize
- Owner: PyCQA
- License: other
- Created: 2013-08-29T02:53:54.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2024-01-08T21:35:53.000Z (5 months ago)
- Last Synced: 2024-01-28T20:00:54.906Z (5 months ago)
- Language: Python
- Homepage: https://modernize.readthedocs.org/
- Size: 387 KB
- Stars: 331
- Watchers: 13
- Forks: 56
- Open Issues: 56
-
Metadata Files:
- Readme: README.rst
- Changelog: CHANGELOG.rst
- License: LICENSE
Lists
- awesome-python - modernize - Modernizes Python code for eventual Python 3 migration. (Compatibility)
- awesome-python-cn - modernize
- python-awesome-case1 - modernize - Modernizes Python code for eventual Python 3 migration. (Compatibility)
- awesome-python - modernize - Modernizes Python code for eventual Python 3 migration. (Compatibility)
- fucking-awesome-python - :octocat: modernize - :star: 318 :fork_and_knife: 55 - Modernizes Python code for eventual Python 3 migration. (Compatibility)
- awesome-python-master - modernize - Modernizes Python code for eventual Python 3 migration. (Compatibility)
- awesome-stars - PyCQA/modernize - Modernizes Python code for eventual Python 3 migration. Built on top of fissix (a fork of lib2to3) (Python)
- awesome-python-cn - modernize
- awesome-python - modernize - Modernizes Python code for eventual Python 3 migration. (Compatibility)
- awesome-python-clone - modernize - Modernizes Python code for eventual Python 3 migration. (Compatibility)
- awesome-python-resources - GitHub - 34% open · ⏱️ 11.01.2021): (兼容性)
- fucking-awesome-python - :octocat: modernize - :star: 232 :fork_and_knife: 44 - Modernizes Python code for eventual Python 3 migration. (Compatibility)
- awesome-python - modernize - Modernizes Python code for eventual Python 3 migration. (Compatibility)
- awesome-python-zh - modernize - 为最终的Python 3迁移实现Python代码的现代化。 (兼容性)
- awesome-python - modernize - Modernizes Python code for eventual Python 3 migration. (Compatibility)
- awesome-python-master - modernize - Modernizes Python code for eventual Python 3 migration. (Compatibility)
- awesome-python - modernize - Modernizes Python code for eventual Python 3 migration. (Compatibility)
- awesome-python - modernize - Modernizes Python code for eventual Python 3 migration. (Compatibility)
- python-awesome - modernize - Modernizes Python code for eventual Python 3 migration. (Compatibility)
- awesome-python - modernize - Modernizes Python code for eventual Python 3 migration. (Compatibility)
- awesome-python - modernize - Modernizes Python code for eventual Python 3 migration. (Compatibility)
- awesome-python - modernize - Modernizes Python code for eventual Python 3 migration. Built on top of fissix (a fork of lib2to3) ` 📝 6 months ago ` (Compatibility [🔝](#readme))
README
::
Python _ _
_ __ ___ __| |___ _ _ _ _ (_)______
| ' \/ _ \/ _` / -_) '_| ' \| |_ / -_)
|_|_|_\___/\__,_\___|_| |_||_|_/__\___|.. image:: https://img.shields.io/coveralls/github/PyCQA/modernize?label=coveralls&logo=coveralls
:alt: Coveralls
:target: https://coveralls.io/github/PyCQA/modernize
.. image:: https://img.shields.io/readthedocs/modernize?logo=read-the-docs
:alt: Read the Docs
:target: https://modernize.readthedocs.io/en/latest/
.. image:: https://img.shields.io/github/workflow/status/PyCQA/modernize/CI?label=GitHub%20Actions&logo=github
:alt: GitHub Actions
:target: https://github.com/PyCQA/modernize
.. image:: https://img.shields.io/pypi/v/modernize?logo=pypi
:alt: PyPI
:target: https://pypi.org/project/modernize/Modernize is a Python program that reads Python 2 source code
and applies a series of fixers to transform it into source code
that is valid on both Python 3 and Python 2.7.This allows you to run your test suite on Python 2.7 and Python 3
so you can gradually port your code to being fully Python 3
compatible without slowing down development of your Python 2
project.The ``python -m modernize`` command works like
``python -m fissix``, see `fissix `_.
Here's how you'd rewrite a
single file::python -m modernize -w example.py
It does not guarantee, but it attempts to spit out a codebase compatible
with Python 2.6+ or Python 3. The code that it generates has a runtime
dependency on `six `_, unless the
``--no-six`` option is used. Version 1.9.0 or later of ``six`` is
recommended. Some of the fixers output code that is not compatible with
Python 2.5 or lower.Once your project is ready to run in production on Python 3 it's
recommended to drop Python 2.7 support using
`pyupgrade `_**Documentation:** `modernize.readthedocs.io
`_.See the ``LICENSE`` file for the license of ``modernize``.
Using this tool does not affect licensing of the modernized code.This library is a very thin wrapper around `fissix
`_, a fork of lib2to3.