Skip to main content

Introduction

Fixers for Zope Component Architecture and the frameworks built with it.

Currently, there is only one fixer, fix_implements. This fixer will change all uses of implements(IFoo) in a class body to the class decorator @implementer(IFoo), which is the most likely Python 3 syntax for zope.interfaces implements statements.

Usage

Typically you will use zope.fixers together with Distribute’s 2to3 support. This is done by adding zope.fixers to some parameters in setup():

>>> setup(
...     install_requires = ['zope.fixers'],
...     use_2to3 = True,
...     use_2to3_fixers = ['zope.fixers'],
... )

For an example usage of a complex case, look at:

http://svn.zope.org/zope.interface/branches/regebro-python3/setup.py?rev=106216&view=markup

That setup.py supports both distutils, setuptools and distribute, all versions of python from 2.4 to 3.1, and has an optional C-extension, so don’t worry if it’s overwhelming. For simple projects all you need is to use Distribute and add the above three lines to the setup.py. Distribute has more documentation on how to use it to support Python 3 porting.

If you don’t want to use Distribute things get a bit more complex, as you have to make the list of fixers yourself and call lib2to3 with that:

>>> from lib2to3.refactor import RefactoringTool, get_fixers_from_package
>>> fixers = get_fixers_from_package('lib2to3.fixes') + \
...          get_fixers_from_package('zope.fixers')

And the run the fixing with the fixers:

>>> tool = RefactoringTool(fixers)
>>> tool.refactor(files, write=True)

Fixer Script

The package also provides a console script called zope-2to3 that has the same arguments as 2to3 but applies the fixers defined in this package.

CHANGES

1.1.2 (2013-02-23)

  • Removed setup.cfg and make sure that we point to real Change Log.

1.1.1 (2013-02-23)

  • Remove support for Python 2.7 again. It did not work.

1.1.0 (2013-02-22)

  • Added console script zope-2to3.

1.0.0 (2009-09-12)

  • Initial release. Includes the implements fix to change implements(IFoo) class body call to @implementer(IFoo) class decorator.

Metadata

Release files for zope.fixers 1.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for zope.fixers 1.1.2
File Size Uploaded Provenance Actions
zope.fixers-1.1.2.zip 18.3 kB Without provenance Details for zope.fixers-1.1.2.zip

Release files / zope.fixers-1.1.2.zip

Download URL zope.fixers-1.1.2.zip
Size 18.3 kB
Tags Source
SHA-256 checksum
How to use checksums
83300f0911ae3b6dff55f9d953d64de0b685cd1dd495cfb410d10fa861646005
BLAKE2b-256 checksum
How to use checksums
a5a81f660c8ed6a0a78618bedba862b04859227015e696fd187839c2d2e7f692
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for zope.fixers 1.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page