Skip to main content

Purpose

This package integrates pure-python gettext translation compilation (msgfmt) into the setup.py “build” and “develop” commands.

These commands are extended so that every “data file” identified by setuptools with the .po extension is compiled to a .mo file in the same directory as the .po file.

This integrates very well if you use z3c.recipe.i18n (and hopefully others as well) to manage .po files.

Usage

You need to override the “build” and “develop” commands in your setup.py, for example:

from setuptools import setup, find_packages
from van.potomo import develop, build

setup(
    name = "HelloWorld",
    cmdclass={'build': build,
              'develop': develop},
    setup_requires=["van.potomo"],
    version = "0.1",
    packages = find_packages(),
)

Why

This package exists because the author believes that:

  • Compiled translations should not be stored under revision control, they are not source

  • Compiled translations should not be distributed in tarballs, they are not source

  • Compiled translations should not be “lazily compiled” unless you take into account that filesystems on production machines are often read-only.

  • The process of compiling translations should not require an extra step/options during the build/install or build/develop cycle.

The options available at the time offered all of this:

  • Babel: Not integrated into the “build” distutils command.

  • cc.gettext: Depends on buildout, not useful for deployments by other means.

  • zope.i18n lazy compilation: Very nice for development, but not on some production environments.

Caveats

van.potomo makes your setup.py depend on van.potomo. But outside tools cannot tell this because they need to run the setup.py to figure out the dependencies.

Basically this means your developers/users will need to install van.potomo manually before anything else. If anyone knows a robust/good way to get around this limitation, please let the author know.

Changes

2.1 (2013-08-23)

  • run egg_info before develop to make sure SOURCES.txt exists and is up to date

2.0 (2013-08-15)

  • Conform to Zope repository policy.

  • Support Python 3

  • Fix issue where recently deleted files could cause an exception if they were still in SOURCES.txt

1.0.0 (2009-03-10)

  • Initial Release

Release files for van.potomo 2.1

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

Source distribution (sdist)

Source distribution for van.potomo 2.1
File Size Uploaded
van.potomo-2.1.tar.gz 4.8 kB Details

Release files / van.potomo-2.1.tar.gz

Download URL van.potomo-2.1.tar.gz
Size 4.8 kB
Tags Source
SHA-256 checksum
How to use checksums
7d4f4cefdf98eff88bfccbf76fc0b7f29dfbb47f5b3ef7cbb7be33323d58f254
BLAKE2b-256 checksum
How to use checksums
ff860b3a9f9e0642ce2762e1131a8bf80f028a191dce80608c58b26ffaa550f7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

2.1 This release

1 release file

2.0

1 release file

1.0.0

1 release file

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